java security 积累

TOday, i studyed the bouncyCastle for SMIME.
when i run the CreateSignedMail.main() of org.bouncycastle.mail.smime.examples;
I've got this error :
"java.security.NoSuchProviderException: no such provider: BC"
 
To solve this, it looks like i need to add BouncyCastle as a provider.
 
i do this by adding an entry to the java.security file first.
Well in my security file I have BC as this:
security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider
 
 
Then adding the line to my Java source like this :
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
can also solve this problem.
申请:证书:

你可能感兴趣的:(java,.net,Security)