crypto

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MPL-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthKeyNotPem   = errors.New("AuthKey must be a valid .p8 PEM file")
	ErrAuthKeyNotECDSA = errors.New("AuthKey must be of type ecdsa.PrivateKey")
	ErrAuthKeyNil      = errors.New("AuthKey was nil")
)

.p8 errors file.

Functions

func CertificateFromBytes

func CertificateFromBytes(bytes []byte) (*x509.Certificate, error)

func CertificateFromFile

func CertificateFromFile(filename string) (*x509.Certificate, error)

func HashPayload

func HashPayload(message []byte) []byte

func PrivateKeyFromBytes

func PrivateKeyFromBytes(bytes []byte) (*ecdsa.PrivateKey, error)

AuthKeyFromBytes loads a .p8 certificate from an in memory byte array and returns an *ecdsa.PrivateKey.

func PrivateKeyFromFile

func PrivateKeyFromFile(filename string) (*ecdsa.PrivateKey, error)

func PublicKeyFromCert

func PublicKeyFromCert(cert *x509.Certificate) (*ecdsa.PublicKey, error)

func SignMessage

func SignMessage(priv *ecdsa.PrivateKey, message []byte) (*big.Int, *big.Int, error)

func VerifyMessage

func VerifyMessage(pub *ecdsa.PublicKey, message []byte, r, s *big.Int) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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