Skip to content

Commit

Permalink
Allow to specify generic attributes by OID
Browse files Browse the repository at this point in the history
  • Loading branch information
August Johann committed Jun 10, 2021
1 parent 1136cce commit b6646a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/asn1cms-1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,10 @@ extendClass(KJUR.asn1.cms.SubjectKeyIdentifier, KJUR.asn1.ASN1Object);
* array: [{
* attr: "contentType",
* type: "data"
* },{
* attr: "oid",
* oid: "1.2.840.113549.1.9.16.2.80",
* value: { set: [{ set: [{enum: int 1}] }] }
* }],
* sortflag: false
* })
Expand Down Expand Up @@ -1050,6 +1054,10 @@ KJUR.asn1.cms.AttributeList = function(params) {
} else if (attrName == "signatureTimeStamp" ||
attrName == "timeStampToken") {
a.push(new KJUR.asn1.cades.SignatureTimeStamp(pAttr));
} else if (attrName == "oid") {
if (pAttr.oid == undefined || pAttr.value == undefined)
throw new _Error("missing oid or value attribute");
a.push(KJUR.asn1.ASN1Util.newObject({seq: [{"oid": pAttr.oid, pAttr.value}]));
} else {
throw new _Error("unknown attr: " + attrName);
}
Expand Down

0 comments on commit b6646a5

Please sign in to comment.