bouncycastle - Provider-independent crypto in Java? -
i'm trying write program in java digitally sign database entries prior insertion. program algorithm-independent - ideally, user specify jce provider , algorithm arguments @ runtime.
is there way this? i've been testing bouncycastle provider, , code runs fine when dynamically register it:
security.addprovider(new bouncycastleprovider());
however, when try statically register provider adding following lines end of security/java.policy file, error: java.security.nosuchproviderexception: no such provider: bc
when try instance of security object using provider.
security.provider.1=sun.security.provider.sun security.provider.2=org.bouncycastle.jce.provider.bouncycastleprovider
specifically, added lines /etc/java-7-openjdk/security/java.policy
(which linked $java_home/jre/lib/security/java.policy
). on ubuntu 12.04. tried adding bouncycastleprovider first entry , got same error.
am configuring static registration wrong or attempting impossible?
i think adding static registration wrong file. use security.policy
instead of java.policy
within same folder.
see: https://www.bouncycastle.org/wiki/display/ja1/provider+installation
Comments
Post a Comment