use of com.bluenimble.platform.crypto.generator.CertificatesManager in project serverless by bluenimble.
the class ExportPKCS10CSRCertificate method main.
public static void main(String[] args) throws CertificateExportException, StoreLoaderException, IOException, CertificateException {
String storeFileName = "files/test.p12";
String certFileName = "files/test.csr";
Map<String, Object> EMPTY_MAP = new HashMap<String, Object>();
// Create generator instance
CertificatesManager manager = new DefaultCertificatesManager();
// Export Certification Request
OutputStream os = new FileOutputStream(certFileName);
manager.export(manager.load(new FileInputStream(storeFileName), EMPTY_MAP), EMPTY_MAP, CertificatesManager.ExportFormat.PKCS10_CSR, os);
os.close();
}
Aggregations