Module builder

Source
Available on crate feature builder only.
Expand description

CMS Builder

Structs§

EnvelopedDataBuilder
Builds CMS EnvelopedData according to RFC 5652 § 6.
KekRecipientInfoBuilder
Builds a KekRecipientInfo according to RFC 5652 § 6. Uses symmetric key-encryption keys: the content-encryption key is encrypted in a previously distributed symmetric key-encryption key.
KeyAgreeRecipientInfoBuilder
Builds a KeyAgreeRecipientInfo according to RFC 5652 § 6. This type uses key agreement: the recipient’s public key and the sender’s private key are used to generate a pairwise symmetric key, then the content-encryption key is encrypted in the pairwise symmetric key.
KeyTransRecipientInfoBuilder
Builds a KeyTransRecipientInfo according to RFC 5652 § 6. This type uses the recipient’s public key to encrypt the content-encryption key.
OtherRecipientInfoBuilder
Builds an OtherRecipientInfo according to RFC 5652 § 6. This type makes no assumption about the encryption method or the needed information.
PasswordRecipientInfoBuilder
Builds a PasswordRecipientInfo according to RFC 5652 § 6. Uses a password or shared secret value to encrypt the content-encryption key.
SignedDataBuilder
Builder for signedData (CMS and PKCS #7)
SignerInfoBuilder
Collect info needed for creating a SignerInfo. Calling build() on this struct will

Enums§

ContentEncryptionAlgorithm
Supported content encryption algorithms.
Error
Error type
KeyEncryptionInfo
Contains information required to encrypt the content encryption key with a specific method
RecipientInfoType
RecipientInfoBuilder must be implemented for these 5 recipient info types as defined in RFC 5652 § 6:

Traits§

RecipientInfoBuilder
Trait for builders of a RecipientInfo. RFC 5652 § 6 defines 5 different RecipientInfo formats. All implementations must implement this trait.

Functions§

create_content_type_attribute
Create a content-type attribute according to RFC 5652 § 11.1
create_message_digest_attribute
Create a message digest attribute according to RFC 5652 § 11.2
create_signing_time_attribute
Create a signing time attribute according to RFC 5652 § 11.3 Dates between 1 January 1950 and 31 December 2049 (inclusive) MUST be encoded as UTCTime. Any dates with year values before 1950 or after 2049 MUST be encoded as GeneralizedTime.