Export CA Certificate From Key Manager
To export a CA Certificate from the Key Manager:
Create an
NAESession
object (session).Call the
CACertificateExport
method of theNAECertificate
class. SinceCACertificateExport
is static, anNAECertificate
object isn't needed. Pass the CA name and the NAESession object to the method. Pass the method output to a byte array.Use a
FileOutputStream
(fos) to send the byte array to a file.Close the stream.
Code sample
NAESession session = NAESession.getSession("userOne", "1234".toCharArray());
byte[] exportData = NAECertificate.CACertificateExport("LocalCA_CL", session);
FileOutputStream fos = new FileOutputStream("/caCertificate.crt");
fos.write(exportData);
fos.close();