Reputation: 791
I am pretty new to Mac OS, or Bouncy Castle/Encryption at all, hence I am following the guide here and downloaded the PGP-JDK1.5-1.7 version of Bouncy Castle jar.
I issued the below command to see where Java is installed:
bash-3.2$ sudo find / -name "*.security"
Password:
/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/java/lib/security/java.security
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/java.security
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/security/java.security
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/java.security
/Users/fn.lastname/code/vault/security_java_jars_Aug11/java.security
I then added security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/security/java.security and also added the bouncy castle jar to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext
The changed java.security content is as below:
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=sun.security.ec.SunEC
security.provider.4=com.sun.net.ssl.internal.ssl.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
security.provider.7=com.sun.security.sasl.Provider
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.9=sun.security.smartcardio.SunPCSC
security.provider.10=apple.security.AppleProvider
security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider
I went to eclipse(STS) and executed the program here to see if the Bouncy Castle is successfully installed. It just returned "BC provider not installed".
I tried the same on the location at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/java.security
Again ran the program with out any success. I also tried googling other sites, alas much help. Seems to have good support for Windows, but for mac I need help even to find if I am at the right Java version.
Could any of you please let me know where I could sense issues? Thanks in advance.
Upvotes: 1
Views: 5842
Reputation: 424
I remember having to run a key tool command...
Found it here:
How Do You Configure BouncyCastle For Mac OSX Maverick
Upvotes: -1
Reputation: 93978
Bouncy Castle is a set of libraries. There is the core library with the provider, called jcprov-*
. To use (a subset of) the Bouncy Castle core cryptography you need to install the provider using the signed .jar
. This .jar
is the only one containing the provider.
The bcpkix
(ANSI X standards PKI), bcpg
(PGP) and bcmail
(SMIME/CMS/PKCS#7) libraries are standalone libraries that provide specific functionality on top of JCE. You may not even have to install the provider for a lot of the functionality. They do not contain the provider themselves.
So you can use the .jar
directly, and if required, download the .jar
containing the provider and put it in your classpath...
Upvotes: 0