Skip to main content

We are using Java

After calling:

net.docusign.api_3_0.AuthoritativeCopyExportDocuments authcopy = api.exportAuthoritativeCopy(eid)How do get I a checksum for api.acknowledgeAuthoritativeCopyExport?I’ve tried to use the Javscript example I found and covert to Java, but I am clearly missing something!

 

var CryptoJS = require("crypto-js");
var document1 = "<documentpdfbytes>";
var coc = "<certificatepdfbytes>";
// CryptoJS
var parseB64 = CryptoJS.enc.Base64.parse(document1);
parseB64.concat(CryptoJS.enc.Base64.parse(coc));
var shaB64 = CryptoJS.SHA1(parseB64);
console.log("->", shaB64.toString(CryptoJS.enc.Base64));
</certificatepdfbytes></documentpdfbytes>

I got this to work.. I was so close:
 

	net.docusign.api_3_0.AuthoritativeCopyExportDocuments ac = api.exportAuthoritativeCopy(eid);
DocumentPDF pdf = ac.getDocumentPDF().get(0);
DocumentPDF cert = ac.getDocumentPDF().get(1);
bytee] documentBytes = pdf.getPDFBytes();// Base64 ac
bytee] certBytes = cert.getPDFBytes();// Base64 ac
ByteArrayOutputStream outputStream = new ByteArrayOutputStream( );
outputStream.write( documentBytes );
outputStream.write( certBytes );
byte cc] = outputStream.toByteArray( );
MessageDigest md = MessageDigest.getInstance("SHA-1");
bytee] digest = md.digest(c);
AuthoritativeCopyExportStatus ack = api.acknowledgeAuthoritativeCopyExport(eid, ac.getTransactionId(), digest);

 


Reply