Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing private key for Box Developer Edition. #168

Closed
majoely opened this issue Nov 19, 2015 · 7 comments
Closed

Error parsing private key for Box Developer Edition. #168

majoely opened this issue Nov 19, 2015 · 7 comments

Comments

@majoely
Copy link

majoely commented Nov 19, 2015

I am getting the error above when testing the CreateAppUser.java code.

I have downloaded both the pre-compiled jar from oss.sonatype.org and I have downloaded the source and compiled it and the error appears in both.

I followed the instructions for generation the public/private key pair and it looks fine.

When I googled parts of the stack trace "PBKDF-OpenSSL" it was suggesting that I should be searching for "PBKDF2-OpenSSL" but from what I could see that was part of the bouncycastle code.

I have been looking into this on and off for a couple of days now and have run out of options. Is this the right place to be bringing this up?

Here is the stacktrace:

Exception in thread "main" com.box.sdk.BoxAPIException: Error parsing private key for Box Developer Edition.
at com.box.sdk.BoxDeveloperEditionAPIConnection.decryptPrivateKey(BoxDeveloperEditionAPIConnection.java:271)
at com.box.sdk.BoxDeveloperEditionAPIConnection.constructJWTAssertion(BoxDeveloperEditionAPIConnection.java:219)
at com.box.sdk.BoxDeveloperEditionAPIConnection.authenticate(BoxDeveloperEditionAPIConnection.java:162)
at com.box.sdk.BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(BoxDeveloperEditionAPIConnection.java:118)
at boxapitest.AccessAsAppUser.main(AccessAsAppUser.java:50)
Caused by: org.bouncycastle.openssl.PEMException: Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available
at org.bouncycastle.openssl.jcajce.PEMUtilities.getKey(Unknown Source)
at org.bouncycastle.openssl.jcajce.PEMUtilities.getKey(Unknown Source)
at org.bouncycastle.openssl.jcajce.PEMUtilities.crypt(Unknown Source)
at org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder$1$1.decrypt(Unknown Source)
at org.bouncycastle.openssl.PEMEncryptedKeyPair.decryptKeyPair(Unknown Source)
at com.box.sdk.BoxDeveloperEditionAPIConnection.decryptPrivateKey(BoxDeveloperEditionAPIConnection.java:265)
... 4 more
Caused by: java.security.NoSuchAlgorithmException: PBKDF-OpenSSL SecretKeyFactory not available
at javax.crypto.SecretKeyFactory.(SecretKeyFactory.java:122)
at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:160)
at org.bouncycastle.jcajce.util.DefaultJcaJceHelper.createSecretKeyFactory(Unknown Source)
... 10 more
Java Result: 1

@luyseyal
Copy link
Contributor

@bgoldman might have a clue

@dwilcoxen
Copy link

Same problem here on attempting to get a BoxDeveloperEditionAPIConnection:

Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available

@dwilcoxen
Copy link

I was using the 1.53 versions (latest at the moment) of the BouncyCastle jars. When I switched to the prior version (1.52) this error disappeared.

@majoely
Copy link
Author

majoely commented Dec 13, 2015

I was using 1.53 as well, changed to 1.52 and error went away.

@majoely majoely closed this as completed Dec 13, 2015
@cheyrico2
Copy link

@majoely or @dwilcoxen ,How do you change the version? Are you using Maven?

@dwilcoxen
Copy link

I'm not using Maven, just a library of jar files that I downloaded.

@bcgit
Copy link

bcgit commented Aug 26, 2016

The stack trace indicates the JcePEMDecryptorProviderBuilder has not been configured to use the BC provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants