-
-
Save rsatrio/9b8da632c010da20af6cde12445397b5 to your computer and use it in GitHub Desktop.
Get Message Digest Algorithm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageDigest digest=MessageDigest.getInstance(signerInfo.getDigestAlgOID()); | |
//Get Attribute | |
Attribute attribute1 =signerInfo.getSignedAttributes().get(PKCSObjectIdentifiers.pkcs_9_at_messageDigest); | |
Attribute attribute2=null; | |
if(signerInfo.getUnsignedAttributes()!=null) { | |
attribute2 =signerInfo.getUnsignedAttributes().get(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken); | |
} | |
messageDigest=Base64.getEncoder().encodeToString( | |
Hex.decode(attribute1.getAttributeValues()[0].toString().substring(1))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment