Optional
certificatesOptional certificates to include in originator info
Optional
contentAlgorithm used to encrypt the content
Content type identifier, defaults to PKCS#7 data
Certificate Revocation Lists to include
Optional
dataThe data to be encrypted
Recipients who can decrypt the enveloped data
Static
Readonly
DEFAULT_Default key encryption algorithm (RSA-OAEP with SHA-1). Used when no specific key encryption algorithm is provided for a recipient.
Gets the originator info containing certificates and CRLs. Returns undefined if no certificates are present.
OriginatorInfo or undefined
Adds a Certificate Revocation List to the enveloped data. CRLs can be used by recipients to verify certificate validity.
The certificate revocation list to include
This builder instance for method chaining
Adds an OCSP response to the enveloped data for certificate status validation. OCSP responses provide real-time certificate revocation status.
The OCSP response to include
This builder instance for method chaining
Adds one or more recipients who can decrypt the enveloped data. Each recipient's public key will be used to encrypt the content encryption key.
One or more recipient configurations
This builder instance for method chaining
Builds the EnvelopedData structure by encrypting the content and creating recipient infos.
The build process:
Promise resolving to the constructed EnvelopedData
Sets the symmetric encryption algorithm used to encrypt the content. If not set, defaults to AES-256-CBC with a random IV.
The content encryption algorithm parameters
This builder instance for method chaining
Sets the content type identifier for the encrypted data.
The content type as ObjectIdentifier or string
This builder instance for method chaining
Sets the data to be encrypted and optionally the content type.
The data to encrypt, either as bytes or string
Optional
contentType: ObjectIdentifierStringOptional content type identifier
This builder instance for method chaining
Builder class for creating CMS EnvelopedData structures.
This builder allows setting the data to be encrypted, the content encryption algorithm, and adding multiple recipients who can decrypt the data. It also supports including certificates and revocation information in the originator info.
Example