Export CA Certificate From Key Manager
To export a CA Certificate from the Key Manager:
Create an
NAESessionobject (session).Call the
CACertificateExportmethod of theNAECertificateclass. SinceCACertificateExportis static, anNAECertificateobject 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();