Skip to content

Commit b6646a5

Browse files
author
August Johann
committed
Allow to specify generic attributes by OID
1 parent 1136cce commit b6646a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/asn1cms-1.0.js

+8
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,10 @@ extendClass(KJUR.asn1.cms.SubjectKeyIdentifier, KJUR.asn1.ASN1Object);
10011001
* array: [{
10021002
* attr: "contentType",
10031003
* type: "data"
1004+
* },{
1005+
* attr: "oid",
1006+
* oid: "1.2.840.113549.1.9.16.2.80",
1007+
* value: { set: [{ set: [{enum: int 1}] }] }
10041008
* }],
10051009
* sortflag: false
10061010
* })
@@ -1050,6 +1054,10 @@ KJUR.asn1.cms.AttributeList = function(params) {
10501054
} else if (attrName == "signatureTimeStamp" ||
10511055
attrName == "timeStampToken") {
10521056
a.push(new KJUR.asn1.cades.SignatureTimeStamp(pAttr));
1057+
} else if (attrName == "oid") {
1058+
if (pAttr.oid == undefined || pAttr.value == undefined)
1059+
throw new _Error("missing oid or value attribute");
1060+
a.push(KJUR.asn1.ASN1Util.newObject({seq: [{"oid": pAttr.oid, pAttr.value}]));
10531061
} else {
10541062
throw new _Error("unknown attr: " + attrName);
10551063
}

0 commit comments

Comments
 (0)