node_modules/node-forge/lib/pkcs7.js
/**
 * Converts a single recipient object to an ASN.1 object.
 *
 * @param obj the recipient object.
 *
 * @return the ASN.1 RecipientInfo.
 */
Converts a single recipient object to an ASN.1 object.
@param obj the recipient object.


Converts a single recipient object to an ASN . 1 object . @param obj the recipient object .
function _recipientToAsn1(obj) {
  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
      asn1.integerToDer(obj.version).getBytes()),
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
      forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),
      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
        forge.util.hexToBytes(obj.serialNumber))
    ]),
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
        asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),
      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
    ]),
    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
      obj.encryptedContent.content)
  ]);
}
function _recipientToAsn1 ( obj ) { return asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . SEQUENCE , true , [ asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . INTEGER , false , asn1 . integerToDer ( obj . version ) . getBytes ( ) ) , asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . SEQUENCE , true , [ forge . pki . distinguishedNameToAsn1 ( { attributes : obj . issuer } ) , asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . INTEGER , false , forge . util . hexToBytes ( obj . serialNumber ) ) ] ) , asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . SEQUENCE , true , [ asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . OID , false , asn1 . oidToDer ( obj . encryptedContent . algorithm ) . getBytes ( ) ) , asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . NULL , false , '' ) ] ) , asn1 . create ( asn1 . Class . UNIVERSAL , asn1 . Type . OCTETSTRING , false , obj . encryptedContent . content ) ] ) ; }
Converts a single recipient object to an ASN.1 object.
Converts a single recipient object to an ASN . 1 object .
// Version // IssuerAndSerialNumber // Name // Serial // KeyEncryptionAlgorithmIdentifier // Algorithm // Parameter, force NULL, only RSA supported for now. // EncryptedKey