Skip to content

Instantly share code, notes, and snippets.


Enrico Bianchi henryx

View GitHub Profile
henryx /
Created May 19, 2020
Read PKCS#8 RSA key
public class ReadPKCS8 {
Read PKCS#8 RSA key, with or without passphrase. It requires Bouncycastle library
public static void main(String[] args) throws IOException, PKCSException, OperatorCreationException {
var file = "a_pkcs8_rsa_key.p8";
var password = "passphrase";
Security.addProvider(new BouncyCastleProvider());