kjur / jsrsasign

The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES and JSON Web Signature/Token in pure JavaScript.
https://kjur.github.io/jsrsasign
Other
3.28k stars 644 forks source link

CMS - Extra attributes in signedAttrs #623

Closed ivoijen closed 5 months ago

ivoijen commented 5 months ago

Hello,

Thank you very much for the useful library.

I would like to add attribute pdfRevocationInfoArchival (1.2.840.113583.1.1.8) to the SignedAttributes for PDF Long Term Validation. I am currently unable to - it throws error unknown attr: pdfRevocationInfoArchival, which makes sense, because in the tohex function from KJUR.asn1.cms.AttributeList only attributes contentType, messageDigest, signingTime, signingCertificate, signingCertificateV2, signaturePolicyIdentifier, signatureTimeStamp and timeStampToken are supported.

Could you point me in the right direction on how to add the pdfRevocationInfoArchival attribute?

Thank you in advance.

kjur commented 5 months ago

It requires code modification for jsrsasign.

(1) Define custom PdfRevocationInfoArchival attribute class by extending KJUR.asn1.cms.Attribute. (2) Add support for it in KJUR.asn1.cms.AttributeList.

ivoijen commented 5 months ago

Thank you @kjur

I was able to minify the files in /src using the Makefile and the yuicmp script you provided in an older issue.

I however do not see any Makefile for combining them into jsrsasign-all-min.js, jsrsasign-jwths-min.js and jsrsasign-rsa-min.js.

Is there any specific command/script you use for that?

Thank you for your time.