WebCrypto GOST Class: EnvelopedDataContentInfo

GostCMS. EnvelopedDataContentInfo

Constructor

new EnvelopedDataContentInfo(contentInfo)

This class encapsulates a CMS object of content type enveloped-data.
Parameters:
Name Type Description
contentInfo FormatedData | GostASN1.ContentInfo The encrypted data content.
Source:

Extends

Methods

addRecipient(recipientCert, keyEncryptionAlgorithm, senderKey, senderCert) → {Promise}

Add a recipient.

Uses the Recipient Information with IssuerAndSerialNumber as the Recipient Identifier. Note: If senderCert specified uses the Key Agreement algorithm overwise Key Transport algorithm.
Parameters:
Name Type Description
recipientCert GostCert.X509 The certificate of recepient
keyEncryptionAlgorithm AlgorithmIdentifier | string Key encryption algorithm or provider name
senderKey GostASN1.PrivateKeyInfo The private key of sender for key agreement protocol
senderCert GostCert.X509 The certificate of sender for key agreement protocol
Source:
Returns:
Promise to return self object after add recipient
Type
Promise

check()

Check the object structure
Inherited From:
Source:

decode(source)

Decode the source to self object
Parameters:
Name Type Description
source FormatedData Encoded data
Inherited From:
Source:

encloseContent(contentInfo, encryptionAlgorithm) → {Promise}

Generate content encryption key with given encryption algorithm and encrypt the content
Parameters:
Name Type Description
contentInfo FormatedData | GostASN1.ContentInfo The content data to be enclosed.
encryptionAlgorithm AlgorithmIdentifier | string The encryption algorithm or provider name
Overrides:
Source:
Returns:
Promise to return self object after encrypt content
Type
Promise

encode(format) → {FormatedData}

Encode the object
Parameters:
Name Type Description
format string Encoding format 'DER', 'CER' or 'PEM'
Inherited From:
Source:
Returns:
Type
FormatedData

getEnclosed(recipientKey, recipientCert, contentInfo, originatorCert) → {Promise}

Returns the decrypted content.
Parameters:
Name Type Description
recipientKey GostASN1.PrivateKeyInfo The decryption key or password for derive key
recipientCert GostCert.X509 The decryption key or password for derive key
contentInfo FormatedData | GostASN1.ContentInfo The detached content (optional).
originatorCert GostCert.X509 The originator certificate (optional).
Overrides:
Source:
Returns:
Promise to return enclosed object {@ling GostASN1.ContentInfo} after decrypt content
Type
Promise

setEnclosed(contentInfo)

Sets the content of attached document.

This is necessary only in detached mode.
Parameters:
Name Type Description
contentInfo FormatedData | GostASN1.ContentInfo The encapsulated CMS Object.
Inherited From:
Source:

writeDetached(createDetached)

Indicates if an external (detached) signature must be created.
Parameters:
Name Type Description
createDetached boolean True if detached; false otherwise.
Inherited From:
Source: