crypto

package module
v0.0.0-...-3e4be4d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPK = errors.New("invalid pk")
View Source
var ErrInvalidSK = errors.New("invalid sk")
View Source
var ErrInvalidSign = errors.New("invalid sign")

Functions

func RandBytes

func RandBytes(n int) []byte

func Verify

func Verify(blob []byte, signature B64, publicKey B64) error

Verify verifies the signature of msg by public key and returns nil if valid

Types

type B64

type B64 string

func DerivePK

func DerivePK(secretKey B64) (publicKey B64, err error)

DerivePK generates public key for/from secretKey

func Digest

func Digest(blob []byte) (base64 B64)

func Encode

func Encode(blob []byte) (b64 B64)

func GenSK

func GenSK() B64

GenSK generates a new Secret Key

func Sign

func Sign(secretKey B64, blob []byte) (signature B64, _ error)

Sign generates a signature for msg by secretKey

func (B64) Decode

func (b64 B64) Decode() ([]byte, error)

func (B64) String

func (b64 B64) String() string

Jump to

Keyboard shortcuts

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