I am using following method to extract private key from secret key using Spongy Castle:
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);
}
However the last line of code runs very slow (aproximately 90 secs) on Android. Is there any better way on how to extract PGPPrivateKey from encrypted secret keys? Maybe I am doing some mistake when exporting secret key from linux but I dont think that this is the problem since I use simple command gpg --export-secret-keys > key.skr
. Any ideas on what could be causing this problem?