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
。任何想法都可能導致這個問題?