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.
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.
Click to show internal directories.
Click to hide internal directories.