Re: VeriSign cert reader?

New Message Reply About this list Date view Thread view Subject view Author view

Jeff Nisewanger (jdn@puuoo.Eng.Sun.COM)
Thu, 1 Oct 1998 15:00:49 -0700 (PDT)


> Jim Gillogly wrote:
> >
> > Is there some stand-alone tool (maybe in SSL-EAY?) that will look at and
> > parse a file that appears to be a VeriSign cert?
>
> ssleay [x509|der]?

        Or, write your own using JDK1.2. See the docs for CertificateFactory
for more details under http://java.sun.com/products/jdk/1.2/docs/api/.
        
import java.io.*;
import java.security.cert.*;

public class PrintCert {
    public static void main(String args[]) {
        try {
            FileInputStream f = new FileInputStream("certfile");
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            Certificate cert = cf.generateCertificate(f);
            System.out.println("cert is: " + cert);
        } catch (Exception e) {
            System.out.println("Caught: " + e);
        }
    }
    

        Run this as "java PrintCert" and it will print out a cert looking
something like this:

cert is: [
[
  Version: V1
  Subject: OU=Secure Server Certification Authority, O="RSA Data Security,
Inc.", C=US
  Signature Algorithm: MD2withRSA, OID = 1.2.840.113549.1.1.2

  Key: algorithm = RSA, unparsed keybits =
0000: 30 81 85 02 7E 00 92 CE 7A C1 AE 83 3E 5A AA 89 0.......z...>Z..
0010: 83 57 AC 25 01 76 0C AD AE 8E 2C 37 CE EB 35 78 .W.%.v....,7..5x
0020: 64 54 03 E5 84 40 51 C9 BF 8F 08 E2 8A 82 08 D2 0020: 64 54 03 E5 84 40 51 C9 BF 8F 08 E2 8A 82 08 D2 dT...@Q.........
0030: 16 86 37 55 E9 B1 21 02 AD 76 68 81 9A 05 A2 4B ..7U..!..vh....K
0040: C9 4B 25 66 22 56 6C 88 07 8F F7 81 59 6D 84 07 .K%f"Vl.....Ym..
0050: 65 70 13 71 76 3E 9B 77 4C E3 50 89 56 98 48 B9 ep.qv>.wL.P.V.H.
0060: 1D A7 29 1A 13 2E 4A 11 59 9C 1E 15 D5 49 54 2C ..)...J.Y....IT,
0070: 73 3A 69 82 B1 97 39 9C 6D 70 67 48 E5 DD 2D D6 s:i...9.mpgH..-.
0080: C8 1E 7B 02 03 01 00 01 ........

  Validity: [From: Wed Nov 09 16:54:17 GMT-07:00 1994,
               To: Fri Dec 31 16:54:17 GMT-07:00 1999]
  Issuer: OU=Secure Server Certification Authority, O="RSA Data Security, Inc.",
C=US
  SerialNumber: [ 02410000 01]

]
  Algorithm: [MD2withRSA]
  Signature:
0000: 88 D1 D1 79 21 CE E2 8B E8 F8 C1 7D 34 53 3F 61 ...y!.......4S?a
0010: 83 D9 B6 0B 38 17 B6 E8 BE 21 8D 8F 00 B8 8B 53 ....8....!.....S
0020: 7E 44 67 1E 22 BD 97 27 E0 9C 85 CC 4A F6 85 3B .Dg."..'....J..;
0030: B2 E2 BE 92 D3 E5 0D E9 AF 5C 0E 0C 46 95 FF A1 .........\..F...
0040: 1C 5E 3E E8 36 58 7A 73 A6 0A F8 22 11 6B C3 09 .^>.6Xzs...".k..
0050: 38 7E 26 BB 73 EF 00 BD 02 A4 F3 14 0D 30 3F 61 8.&.s........0?a
0060: 70 7B 20 FE 32 A3 9F B3 F4 67 52 DC B4 EE 84 8C p. .2....gR.....
0070: 96 36 20 DE 81 08 83 71 21 8A 0F 9E A9 .6 ....q!....

]


New Message Reply About this list Date view Thread view Subject view Author view

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

The following archive was created by hippie-mail 7.98617-22 on Sat Apr 10 1999 - 01:15:19