diff --git a/lib/oids.js b/lib/oids.js index 6a937f571..0e4be4639 100644 --- a/lib/oids.js +++ b/lib/oids.js @@ -65,6 +65,7 @@ _IN('1.2.840.113549.1.9.6', 'counterSignature'); _IN('1.2.840.113549.1.9.7', 'challengePassword'); _IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); _IN('1.2.840.113549.1.9.14', 'extensionRequest'); +_IN('1.2.840.113549.1.9.16.2.47', 'signingCertificateV2'); _IN('1.2.840.113549.1.9.20', 'friendlyName'); _IN('1.2.840.113549.1.9.21', 'localKeyId'); diff --git a/lib/pkcs7.js b/lib/pkcs7.js index bb87de363..99c8a7f47 100644 --- a/lib/pkcs7.js +++ b/lib/pkcs7.js @@ -1089,12 +1089,23 @@ function _attributeToAsn1(attr) { asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, asn1.dateToGeneralizedTime(date)); } + } else if(attr.type === forge.pki.oids.signingCertificateV2) { + value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, + attr.value + ) + ]) + ]) + ]); } - + // TODO: expose as common API call // create a RelativeDistinguishedName set // each value in the set is an AttributeTypeAndValue first // containing the type (an OID) and second the value + return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,