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 recipientCertGostCert.X509 The certificate of recepient keyEncryptionAlgorithmAlgorithmIdentifier | string Key encryption algorithm or provider name senderKeyGostASN1.PrivateKeyInfo The private key of sender for key agreement protocol senderCertGostCert.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 sourceFormatedData 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 contentInfoFormatedData | GostASN1.ContentInfo The content data to be enclosed. encryptionAlgorithmAlgorithmIdentifier | 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 formatstring 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 recipientKeyGostASN1.PrivateKeyInfo The decryption key or password for derive key recipientCertGostCert.X509 The decryption key or password for derive key contentInfoFormatedData | GostASN1.ContentInfo The detached content (optional). originatorCertGostCert.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 contentInfoFormatedData | GostASN1.ContentInfo The encapsulated CMS Object. - Inherited From:
- Source:
-
writeDetached(createDetached)
-
Indicates if an external (detached) signature must be created.
Parameters:
Name Type Description createDetachedboolean True if detached; false otherwise. - Inherited From:
- Source: