Harakiri
2014-06-04 09:22:43 UTC
Hello,
im attaching a testkey that im unable to use with bc due a passphrase with umlauts.
The passphrase is
123ä
I looked at the sample here: https://github.com/bcgit/bc-java/blob/master/pg/src/test/java/org/bouncycastle/openpgp/test/PGPUnicodeTest.java
but this does not work for me im getting
org.bouncycastle.openpgp.PGPException: checksum mismatch at 0 of 20
at org.bouncycastle.openpgp.PGPSecretKey.extractKeyData(Unknown Source)
at org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey(Unknown Source)
I tried it with 1.45 and 1.50 both with
PGPPrivateKey pKey =
pgpKey.extractPrivateKey(pin.toCharArray(), "BC");
and
PGPDigestCalculatorProvider calcProvider = new JcaPGPDigestCalculatorProviderBuilder()
.setProvider(BouncyCastleProvider.PROVIDER_NAME).build();
PBESecretKeyDecryptor decryptor = new JcePBESecretKeyDecryptorBuilder(calcProvider)
.setProvider(BouncyCastleProvider.PROVIDER_NAME).build(pin.toCharArray());
PGPPrivateKey pKey = pgpKey.extractPrivateKey(decryptor);
I also made sure of the string encoding
String passphrase = new String("123ä".getBytes("UTF-8"), "UTF-8");
also tried with UTF-16.
Im still using JDK 1.6.
Thanks
im attaching a testkey that im unable to use with bc due a passphrase with umlauts.
The passphrase is
123ä
I looked at the sample here: https://github.com/bcgit/bc-java/blob/master/pg/src/test/java/org/bouncycastle/openpgp/test/PGPUnicodeTest.java
but this does not work for me im getting
org.bouncycastle.openpgp.PGPException: checksum mismatch at 0 of 20
at org.bouncycastle.openpgp.PGPSecretKey.extractKeyData(Unknown Source)
at org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey(Unknown Source)
I tried it with 1.45 and 1.50 both with
PGPPrivateKey pKey =
pgpKey.extractPrivateKey(pin.toCharArray(), "BC");
and
PGPDigestCalculatorProvider calcProvider = new JcaPGPDigestCalculatorProviderBuilder()
.setProvider(BouncyCastleProvider.PROVIDER_NAME).build();
PBESecretKeyDecryptor decryptor = new JcePBESecretKeyDecryptorBuilder(calcProvider)
.setProvider(BouncyCastleProvider.PROVIDER_NAME).build(pin.toCharArray());
PGPPrivateKey pKey = pgpKey.extractPrivateKey(decryptor);
I also made sure of the string encoding
String passphrase = new String("123ä".getBytes("UTF-8"), "UTF-8");
also tried with UTF-16.
Im still using JDK 1.6.
Thanks