我使用Bouncycastle SMIME包使用rsassa-pss证书加密邮件:
openssl x509 -text -in certificate.crt | grep -i "algorithm"
Signature Algorithm: rsassaPss
Hash Algorithm: sha256
Mask Algorithm: mgf1 with sha256
我试过了:
public void encrypt(Collection<X509Certificate> certs) {
OutputEncryptor enc = new BcCMSContentEncryptorBuilder(CMSAlgorithm.AES192_CBC).build();
SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
for (X509Certificate nCert : certs) {
gen.addRecipientInfoGenerator(
new JceKeyTransRecipientInfoGenerator(nCert, new AlgorithmIdentifier(PKCSObjectIdentifiers.id_RSAES_OAEP))
.setProvider("BC"));
}
但它不起作用。有什么想法吗?