1

I can get extension value in byte array.

byte[] value = x509Cert.getExtensionValue(oid);

How can I read the value?

zhh
  • 2,346
  • 1
  • 11
  • 22
  • 1
    [new String(value)](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#String-byte:A-)? – rmlan Oct 10 '17 at 14:06
  • What is the format you want to have your bytes in? Hexadecimal values? – david a. Oct 10 '17 at 14:12
  • @rmlan it caused messy code – zhh Oct 10 '17 at 14:28
  • @zhh don't put parts of your actual question in comments. What question are you actually asking, because the subject line and the body of the question do not match very closely. Explain how creating a new String is not what works for you. https://stackoverflow.com/help/how-to-ask –  Oct 10 '17 at 14:57

1 Answers1

0

I think, this may help you, since hex-values or a base64 encoded string is actually not readable for humans: https://stackoverflow.com/a/13802277/5847341