symmetric

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptDecompressVerify

func DecryptDecompressVerify(
	ciphertext *EncryptedData,
	sessionKeyDecrypter pkg.KeyOrCardInterface,
	signatureValidator pkg.KeyOrCardInterface) (data []byte, err error)

DecryptDecompressVerify decrypts the data using XChaCha20-Poly1305, decompresses the data using zstd and verifies the signature using RSA.

func SignCompressEncryptMultiple added in v1.3.0

func SignCompressEncryptMultiple(sessionKeyEncryptionCertificates []*x509.Certificate, plaintextSigner pkg.KeyOrCardInterface, plaintext []byte) (encMap map[*x509.Certificate]*EncryptedData, err error)

Types

type EncryptedData

type EncryptedData struct {
	Ciphertext          []byte `json:"ciphertext"`
	Signature           []byte `json:"signature"`
	Nonce               []byte `json:"nonce"`
	EncryptedSessionKey []byte `json:"encryptedSessionKey"`
}

func SignCompressEncrypt

func SignCompressEncrypt(sessionKeyEncryptionCertificate *x509.Certificate, plaintextSigner pkg.KeyOrCardInterface, plaintext []byte) (encryptedMessage *EncryptedData, err error)

SignCompressEncrypt compresses the data using zstd, encrypts the data using XChaCha20-Poly1305 and signs the data using RSA.

Jump to

Keyboard shortcuts

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