0
我使用下面的方法来提取使用海绵城堡从密钥私钥:SpongyCastle私钥提取很慢
public static PGPPrivateKey findPrivateKey(PGPSecretKey pgpSecKey, char[] pass)
throws PGPException
{
if (pgpSecKey == null) return null;
PBESecretKeyDecryptor decryptor = new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(pass);
return pgpSecKey.extractPrivateKey(decryptor);
}
然而最后一行代码的运行速度非常慢(aproximately 90秒)在Android上。有没有更好的方法来从加密的密钥中提取PGPPrivateKey?也许我在从linux中导出密钥时犯了一些错误,但我不认为这是问题,因为我使用简单的命令gpg --export-secret-keys > key.skr
。任何想法都可能导致这个问题?