keys

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptRSA

func EncryptRSA(pub *publicKey, data []byte) ([]byte, error)

func SignRSA

func SignRSA(priv *privateKey, data []byte) ([]byte, error)

func VerifyRSA

func VerifyRSA(pub *publicKey, data, signature []byte) error

Types

type OperatorDecrypter

type OperatorDecrypter interface {
	Decrypt(data []byte) ([]byte, error)
}

type OperatorPrivateKey

type OperatorPrivateKey interface {
	OperatorSigner
	OperatorDecrypter
	StorageHash() (string, error)
	EKMHash() (string, error)
	Bytes() []byte
	Base64() []byte
}

func GeneratePrivateKey

func GeneratePrivateKey() (OperatorPrivateKey, error)

func PrivateKeyFromBytes

func PrivateKeyFromBytes(pemData []byte) (OperatorPrivateKey, error)

func PrivateKeyFromString

func PrivateKeyFromString(privKeyString string) (OperatorPrivateKey, error)

type OperatorPublicKey

type OperatorPublicKey interface {
	Encrypt(data []byte) ([]byte, error)
	Verify(data []byte, signature []byte) error
	Base64() ([]byte, error)
}

func PublicKeyFromString

func PublicKeyFromString(pubKeyString string) (OperatorPublicKey, error)

type OperatorSigner

type OperatorSigner interface {
	Sign(data []byte) ([]byte, error)
	Public() OperatorPublicKey
}

Jump to

Keyboard shortcuts

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