itext-questions  

Re: [iText-questions] Re trieving Certificate subject fields

Paulo Soares
Thu, 26 Jun 2008 02:20:43 -0700

 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [EMAIL PROTECTED] On 
> Behalf Of jasonmd
> Sent: Wednesday, June 25, 2008 9:07 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Re trieving Certificate subject fields
> 
> I am trying to retrieve the field values of a digital 
> certificate. I have several lines of code that I think should 
> get me most of the way there, however, I'm now stuck. I 
> expected the PdfPKCS7.X509Name class to contain constant 
> String values as keys to be used in a HashMap, however, the 
> values are of type DERObjectIdentifier. 
> 
> How do you obtain the values for CN, O, OU, etc.? 
> 
> Code is below. Thanks in advance.
> 
> -- Jason
> 
> 
> 
> PdfPKCS7 pk = af.verifySignature(fieldName);
> Calender cal = pk.getSignDate();
> boolean validSig = pk.verify();
> X509Certificate cert = af.getSigningCertificate();
> 

PdfPKCS7.X509Name xName = pk.getSubjectFields(cert);
String cn = xName.getField("CN");

Paulo



Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar