digital signature - How to programatically digitally sign an open office XML Docx document with X509 Certificate? -


i want programatically digitally sign open office xml docx document x509 certificate either in java or c#.

this link brilliantly c# using packagedigitalsignaturemanager system.io.packaging: http://blogs.infosupport.com/blogs/wouterv/archive/2007/02/24/signing-office-open-xml-documents-using-the-packaging-api.aspx

altough works fine, @ end prompts user dialog ask him pin number authenticated digital signature.

do know how set pin number programatically?

cheers


thank detailed answer. basically, i'm using electronic id smartcard, has certificate signing digital documents.

typically pass public key in x509certificate type, packagedigitalsignaturemanager sign() method.

this method sign document, prompt user pin in order retrieve private key stored in smart card.

isn't possible pass packagedigitalsignaturemanager object includes both public/private key pair in pkcs12 file, , won't prompt user pin number.

cheers,

the answer question #2 depends on technology use and, more importantly, certificate stored.

in java key storage (jks) certificates protected passwords , passwords passed in code.

in windows certificate storage (location .net cryptography classes use) certificates protected using pin can not set code cryptoproviders (there's extension command set pin providers don't support it) , user needs confirm access private key hand.

if use certificate stored in pkcs12 file, password file set in code.

and, well, offer components signing office documents in .net, if interested (check here). maintained , supported, unlike sample code.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -