Skip to content
Snippets Groups Projects
Commit 88d9be6d authored by Damyan Mitev's avatar Damyan Mitev :beach:
Browse files

Fix pkijs.RelativeDistinguishedNames.toSchema()

parent 270354e3
No related branches found
Tags 1.6 1.7
1 merge request!57Ssj 1 signing service java initial
......@@ -124,8 +124,28 @@ function generateKeys(algorithms) {
return crypto.generateKey(algorithm.algorithm, true, algorithm.usages);
}
function fixPkijsRDN() {
pkijs.RelativeDistinguishedNames.prototype.toSchema = function () {
//region Decode stored TBS value
if (this.valueBeforeDecode.byteLength === 0) // No stored encoded array, create "from scratch"
{
return (new asn1js.Sequence({
value: Array.from(this.typesAndValues, element => new asn1js.Set({value: [element.toSchema()]}))
}));
}
const asn1 = asn1js.fromBER(this.valueBeforeDecode);
//endregion
//region Construct and return new ASN.1 schema for this object
return asn1.result;
//endregion
};
}
//*********************************************************************************
function createCertificate(certData, issuerData = null) {
if (typeof certData === "undefined") {
return Promise.reject("No Certificate data provided");
}
......@@ -1252,3 +1272,6 @@ export const verifySMIME = (smimeString, rootCaPem) => {
}, 50);
});
};
//Initialization block
fixPkijsRDN();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment