I saved the Base64 encoded certificate in the database. I can read this from the database and decode, but I would like to convert the decoded byte [] to the X509 certificate. I am looking for sample code for this. I tried:
CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); InputStream in = new ByteArrayInputStream(bytes); X509Certificate cert = (X509Certificate)certFactory.generateCertificate(in);
This leads to a problem with the encoding type. A valid String or byte [] pattern that represents the certificate would be good.
Any pointers would be great! Thanks.
source share