crypto

package
v0.0.0-...-73067b7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceLength  = 12
	SymKeyLength = 16
	TagLength    = 16
	RSAKeyLength = 3072
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GoCrypto

type GoCrypto struct {
}

GoCrypto implements CSP using pure go

func NewGoCrypto

func NewGoCrypto() *GoCrypto

func (GoCrypto) DecryptMessage

func (g GoCrypto) DecryptMessage(key []byte, encryptedMessage []byte) ([]byte, error)

func (GoCrypto) EncryptMessage

func (g GoCrypto) EncryptMessage(key []byte, message []byte) (encryptedMessage []byte, err error)

func (GoCrypto) NewECDSAKeys

func (g GoCrypto) NewECDSAKeys() (publicKey []byte, privateKey []byte, err error)

func (GoCrypto) NewRSAKeys

func (g GoCrypto) NewRSAKeys() (publicKey []byte, privateKey []byte, err error)

func (GoCrypto) NewSymmetricKey

func (g GoCrypto) NewSymmetricKey() ([]byte, error)

func (GoCrypto) PkDecryptMessage

func (g GoCrypto) PkDecryptMessage(privateKey []byte, encryptedMessage []byte) (message []byte, err error)

func (GoCrypto) PkEncryptMessage

func (g GoCrypto) PkEncryptMessage(publicKey []byte, message []byte) ([]byte, error)

func (GoCrypto) SignMessage

func (g GoCrypto) SignMessage(privateKey []byte, message []byte) (signature []byte, e error)

func (GoCrypto) VerifyMessage

func (g GoCrypto) VerifyMessage(publicKey []byte, message []byte, signature []byte) error

Jump to

Keyboard shortcuts

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