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: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址