sec

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAES256CBC

func DecryptAES256CBC(data, key []byte) ([]byte, error)

func EncryptAES256CBC

func EncryptAES256CBC(data []byte, key []byte) ([]byte, error)

func UnparsedPublicKey

func UnparsedPublicKey(curve elliptic.Curve, pubKeyBytes []byte) (*ecdsa.PublicKey, error)

Types

type P256Key

type P256Key struct {
	X []byte
	Y []byte
}

func P256FromCose

func P256FromCose(k *cose.Key) (*P256Key, error)

func P256FromKey

func P256FromKey(public crypto.PublicKey) (*P256Key, error)

func (*P256Key) Bytes

func (p *P256Key) Bytes() []byte

func (*P256Key) ToCose

func (p *P256Key) ToCose() *cose.Key

type PinToken

type PinToken struct {
	Key []byte
}

type SharedSecret

type SharedSecret struct {
	PublicKey *cose.Key
	Secret    []byte
}

func NewSharedSecret

func NewSharedSecret(peerKey *cose.Key) (*SharedSecret, error)

func (*SharedSecret) DecryptPinToken

func (s *SharedSecret) DecryptPinToken(data []byte) (*PinToken, error)

func (*SharedSecret) Encrypt

func (s *SharedSecret) Encrypt(data []byte) ([]byte, error)

func (*SharedSecret) EncryptPin

func (s *SharedSecret) EncryptPin(pin string) ([]byte, error)

Jump to

Keyboard shortcuts

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