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

javax.naming references in X509LDAPCertStoreSpi? #16

Closed
dc3a42 opened this issue Oct 1, 2013 · 3 comments
Closed

javax.naming references in X509LDAPCertStoreSpi? #16

dc3a42 opened this issue Oct 1, 2013 · 3 comments

Comments

@dc3a42
Copy link

dc3a42 commented Oct 1, 2013

This feels like a real newbie question, sorry if it's just too obvious. I’m using the Spydroid Android app (which uses Spongycastle) and need to debug it. I pulled the latest copy and tried to build a no-edit version to test it all out, and got this error from lint:

Invalid package reference in library; not included in Android: javax.naming.directory. Referenced from org.spongycastle.jce.provider.X509LDAPCertStoreSpi.

This sounds a lot like the issue discussed in http://stackoverflow.com/questions/6898801/how-to-include-the-spongy-castle-jar-in-android, except that X509LDAPCertStoreSpi.java (from scprov-jdk15on-1.47.0.2.jar) clearly uses this API that’s not part of Android. Am I missing some add-on to satisfy these references, or just deeply misunderstanding something?

@rtyley
Copy link
Owner

rtyley commented Oct 1, 2013

As you've noticed, the javax.naming package isn't available in Android, though it's used by Bouncy Castle (and hence referenced by Spongy Castle) in X509LDAPCertStoreSpi ("a general purpose implementation to get X.509 certificates and CRLs from a LDAP location.") and several other classes:

https://github.com/bcgit/bc-java/blob/b4296f9f0650b6e2c57ac3c6ee1093092d510462/prov/src/main/java/org/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java#L24-L31

Are you actually trying to use functionality from X509LDAPCertStoreSpi? The warning from lint is obviously annoying, but you should be able to use other, non-javax.naming related functionality of (Bouncy|Spongy)Castle without problems.

The only way to get X509LDAPCertStoreSpi to work under Android would be to rewrite a fair chunk of it to use an alternative LDAP library, such as UnboundID's SDK: https://www.unboundid.com/products/ldapsdk/

@dc3a42
Copy link
Author

dc3a42 commented Oct 2, 2013

I'm just trying to build the app, so I can debug/fix/extend it. I don't think it uses LDAP at all, so I probably don't really need to fix this. I figured out how to downgrade the lint issue from "Error" to "Warning" and fixed one other issue unrelated to SpongyCastle, and it builds now. So this isn't blocking me anymore. I was just surprised that the issue came up on a vanilla pull of the latest. Thanks for clarifying the situation.

@rtyley
Copy link
Owner

rtyley commented Oct 2, 2013

No problem - closing this issue for now. Similar to the java.awt problem in #7.

@rtyley rtyley closed this as completed Oct 2, 2013
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

2 participants