How to validate if a signed jar contains a timestamp?

前端 未结 4 768
忘了有多久
忘了有多久 2020-12-29 06:46

After a jar is signed and the -tsa option was used, how can I validate that the time stamp was included? I tried:

jarsigner -verify -verbose -certs myApp.jar         


        
4条回答
  •  孤城傲影
    2020-12-29 06:58

    mhaller provides great code (printDSAInfos). Helps me greatly in my work. However a couple of changes required. DEREncodable class is now changed to ASN1Encodable and getDERObject() method are changed to toASN1Primitive. So the code look like this

        ASN1Encodable dob = attribute.getAttrValues().getObjectAt(0);
        CMSSignedData signedData = new CMSSignedData(dob.toASN1Primitive().getEncoded());
    

提交回复
热议问题