从此代码段:
try {
EncryptionUtils smimeUtils = EncryptionManager.getEncryptionUtils(EncryptionManager.SMIME);
char[] smimePw = new String("hello world").toCharArray();
EncryptionKeyManager smimeKeyMgr = smimeUtils.createKeyManager();
smimeKeyMgr.loadPrivateKeystore(privateKeyStore, smimePw);
} catch (NoSuchProviderException e) {
Log.e("NoSuchProvider: ", e.getMessage());
} catch (CertificateException e) {
Log.e("Certificate: ", e.getMessage());
} catch (KeyStoreException e) {
Log.e("KeyStore: ", e.getMessage());
} catch (NoSuchAlgorithmException e) {
Log.e("No Such Algorithm: ", e.getMessage());
} catch (IOException e) {
Log.e("IO: ", e.getMessage());
}
我尝试加载S/MIME
加密管理器,但这段代码会NoSuchProviderException
告诉我:
No provider configured for S/MIME
我正在关注本指南,它告诉我添加以下内容.jar-files
:
- javamail-crypto.jar
- bcprov-jdk14-122.jar
- bcmail-jdk14-122.jar
我找不到带有结尾的确切版本,但我在构建路径中-122
包含了以下内容:jar-files
- bcprov-jdk14-147
- bcmail-jdk14-147
- javamail-crypto
- javamail-crypto-bouncycastle-smime
但它仍然抛出exception
,任何人都可以给我一个关于如何解决这个问题的提示吗?