简体   繁体   中英

How to create .der file using RSA private and public key?

I need to read private key and public key using RSA algorithm. So how to create .der file?

Using CertificateFactory

try{
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    Certificate cert = cf.generateCertificate(new FileInputStream("ca.cert"));
    System.out.println(cert);
}catch(Exception ex){
    ex.printStackTrace();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM