How to convert X509 certificate into PKCS7 using bouncycastle?
问题 Hi, all! My problem is following: I 'm trying to encrypt X509 certificate to PKCS7 but I receive a wrong result. The first attempt is:(used bcmail-jdk16:1.46) Security.addProvider(new BouncyCastleProvider()); keystore = KeyStore.getInstance("PKCS12", "BC"); keystore.load (new FileInputStream(PATH+"//pkcs7-csr-cer//identity.p12"), "testpassword".toCharArray()); PrivateKey privateKey = (PrivateKey)keystore.getKey("testclientcert", "testpassword".toCharArray()); CMSSignedDataGenerator