I have byte[]certificate data and I want to change this type byte[]to Certificate. How can I achieve this?
Now I have used CertificateFactory.generateCertificate(InputStream inStream).
byte[] csr = getCSR(cn, ou, org, loc, state, country,email);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
ByteArrayInputStream bais = new ByteArrayInputStream(csr);
Certificate certificate = cf.generateCertificate(bais);
But there was an error Certificate Certificate = cf.generateCertificate (bais); in this line.
Error: java.security.cert.CertificateParsingException: java.io.IOException: ObjectIdentifier () - the data is not an object identifier (tag = 49)
Why did this error happen? What is wrong with this code? Please explain me. Thank.
source
share