cms

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 0

README

CMS (Cryptographic Message Syntax)

This package implements parsing and decryption of the contents of CiphertextForRecipient fields from the KMS API. It makes no attempt to be a full implementation of RFC 5652.

Credits

A significant portion of the code in this package is borrowed from Mozilla's pkcs7 package - which itself is a fork of fullsailor/pkcs7.

License

The contents of this package are MIT licensed.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OIDs
	OIDData                         = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 1}
	OIDEnvelopedData                = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 3}
	OIDEncryptionAlgorithmRSAESOAEP = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 7}
	OIDEncryptionAlgorithmAES256CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 42}

	// Versions
	EnvelopedDataVersion              = 2
	EnvelopedDataRecipientInfoVersion = 2
)

Functions

func DecryptEnvelopedKey

func DecryptEnvelopedKey(key *rsa.PrivateKey, content []byte) ([]byte, error)

Types

type EncryptedKey

type EncryptedKey struct {
	// contains filtered or unexported fields
}

func Parse

func Parse(ber []byte) (*EncryptedKey, error)

func (*EncryptedKey) Decrypt

func (ek *EncryptedKey) Decrypt(key *rsa.PrivateKey) ([]byte, error)

Jump to

Keyboard shortcuts

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