security

package module
v0.0.0-...-74763fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: Unlicense Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Private_key []byte
View Source
var Public_key []byte

Functions

func CreateToken

func CreateToken(payload string) (string, error)

CreateToken builds a JWT token

func DGenerateKeyPair

func DGenerateKeyPair() ([]byte, []byte)

DGenerateKeyPair generates a public and private key pair for Dilithium

func DSign

func DSign(privkey []byte, message []byte) []byte

DSign signs a message with a private key via Dilithium

func DVerify

func DVerify(pubkey []byte, message []byte, signature []byte) bool

DVerify verifies a signature with a public key via Dilithium

func DecodeSB

func DecodeSB(data string) ([]byte, error)

DecodeSB decodes a base64 string to a byte slice

func DecodeSS

func DecodeSS(data string) (string, error)

DecodeSS decodes a base64 string to a string

func EncodeBS

func EncodeBS(data []byte) string

EncodeBS encodes a byte slice to a base64 string

func EncodeSS

func EncodeSS(data string) string

EncodeSS encodes a string to a base64 string

func SplitToken

func SplitToken(token string) (string, string, string, error)

SplitToken decodes a JWT token into its header, payload, and signature

func VerifyToken

func VerifyToken(token string, custom_public_key string) (string, error)

VerifyToken verifies a JWT token and returns the payload

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL