2

I'm reading in a CER certificate file which gives me an X.509 certificate object.

There are several extensions that contain DER encoded OCTET strings. e.g.:

Certificate Extensions: 9
[1]: ObjectId: 1.3.6.1.4.1.311.21.10 Criticality=false
Extension unknown: DER encoded OCTET string =
0000: 04 1C 30 1A 30 0A 06 0B   2B 06 01 04 01 82 37 2F  ..0.0...+.....7/
0010: 01 01 30 0E 06 08 2B 06   01 05 05 07 03 02        ..0...+.......

How can I decode these strings using BouncyCastle

user1513388
  • 7,165
  • 14
  • 69
  • 111
  • What did you try, where does it go wrong? – Frank Nov 03 '12 at 21:59
  • I haven't tried anything yet, because I'm not sure how to approach it. I'm thinking I probably need to use org.bouncycastle.asn1 but I'm not sure which of the methods to use and how to parse in the extensions. – user1513388 Nov 03 '12 at 22:56

1 Answers1

0

Google told me to look at the class: JcaX509ExtensionUtils

Now it's up to you.

Frank
  • 16,476
  • 7
  • 38
  • 51