-
-
Save rsatrio/759bab61b222df5c25d63b5e1da961e4 to your computer and use it in GitHub Desktop.
Calculate MD on PDF File
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
byte[] contentToSigned=getByteRangeData(pdfBytes, signature.getByteRange()); | |
private byte[] getByteRangeData(ByteArrayInputStream bis,int[] byteRange) { | |
int length1=byteRange[1]+byteRange[3]; | |
byte[] contentSigned=new byte[length1]; | |
bis.skip(byteRange[0]); | |
bis.read(contentSigned, 0, byteRange[1]); | |
bis.skip(byteRange[2]-byteRange[1]-byteRange[0]); | |
bis.read(contentSigned, byteRange[1], byteRange[3]); | |
bis.reset(); | |
return contentSigned; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment