Hi all,

I want to write some cryptographic operations using RSA, but its provider, bouncy castle, does not come inbuilt in java, which is why when I put in this code:

Provider bcProv = new org.bouncycastle.jce.provider.BouncyCastleProvider();

I went to the providers site and they said something about putting this line "security.provider.N=org.bouncycastle.jce.provider.BouncyCastleProvider" into the java.security file in <JAVA HOME>\jre\lib\security\, where N is the one more number more than the last on the list.

I opened the java.security file with wordpad and sure enough i found these:
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider
security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.8=sun.security.smartcardio.SunPCSC
security.provider.9=sun.security.mscapi.SunMSCAPI

I put in: "security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider", but when I tried saving I got a message saying I wasn't allowed access to the java.security file.

Anyway, right now, I'm stumped. Does anyone know anything about this cryptographic provider and how to install it?

Cheers.

Recommended Answers

All 4 Replies

It may just be a UAC thing with Win7 or Vista. Do you have administrator access on that machine?

I am the administrator and i'm logged in as the administrator. I right-clicked on the file to see if there was an option to open the file as an administrator, but there's no such option.

You could try with UAC disabled I suppose. I'm not sure what else would be preventing you from editing that property file.

Ok, i found a way to sort this out. I just copied the java.security file from the jre folder, edited it somewhere else and copied it back in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.