[keycloak-user] Crypto

Scott Rossillo srossillo at smartling.com
Mon Oct 5 18:48:51 EDT 2015


Sorry, I sent that too quick. I meant javax.crypto. :)

Scott Rossillo
Smartling | Senior Software Engineer
srossillo at smartling.com

 <https://app.sigstr.com/uc/55e5d41c6533390d03580000>
 <http://www.sigstr.com/>
> On Oct 5, 2015, at 6:47 PM, Scott Rossillo <srossillo at smartling.com> wrote:
> 
> Try adding a dependency on <module name="javax.api"/>
> 
> 
> Scott Rossillo
> Smartling | Senior Software Engineer
> srossillo at smartling.com <mailto:srossillo at smartling.com>
> 
>  <https://app.sigstr.com/uc/55e5d41c6533390d03580000>
>  <http://www.sigstr.com/>
>> On Oct 5, 2015, at 4:38 PM, Remi Cartier <remi.cartier at imetrik.com <mailto:remi.cartier at imetrik.com>> wrote:
>> 
>> Hy guys,
>> 
>> I am trying to use some crypto to match hashes from my old db.
>> The code is :
>> 
>>             KeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt.getBytes(), 2048, 160);
>>             SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
>>             byte[] hash = secretKeyFactory.generateSecret(keySpec).getEncoded();
>> 
>> I cant make it work as a federation provider.
>> 
>> it was complaining about java.lang.ClassNotFoundException: javax.crypto.spec.PBEKeySpec
>> 
>> I added jce.jar to the list of dependencies in my module.xml (I shouldn’t have to do that)
>> 
>> Then I got :
>> 
>> ClassNotFoundException: sun.security.jca.GetInstance
>> 
>> I added rt.jar (which I shouldn’t do either)
>> 
>> and then I got some fancy exception : java.lang.LinkageError: loader constraint violation
>> 
>> I then tried with bouncy castle : bcprov-jdk15on-152.jar to no avail.
>> 
>> what is wrong ?
>> 
>> here is my module.xml file :
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <module xmlns="urn:jboss:module:1.1" name="com.imetrik.saas.server.services.insuranceWebUIBackend.dao.federation">
>>     <resources>
>>         <resource-root path="insuranceWebUIBackend-lib-2.0.5-SNAPSHOT.jar"/>
>>         <resource-root path="jdbi-2.63.1.jar"/>
>>         <resource-root path="postgresql-9.4-1203-jdbc4.jar"/>
>>         <resource-root path="slf4j-api-1.7.12.jar"/>
>>         <resource-root path="slf4j-simple-1.7.12.jar"/>
>>         <resource-root path="global-library-common-2.0.4.jar"/>
>>         <resource-root path="jce.jar"/>
>>         <resource-root path="bcprov-jdk15on-152.jar"/>
>>     </resources>
>>     <dependencies>
>>         <module name="org.keycloak.keycloak-core"/>
>>         <module name="org.keycloak.keycloak-model-api"/>
>>     </dependencies>
>> </module>
>> 
>> 
>> Cheers.
>> 
>> 
>> REMI CARTIER
>> B.O.S.S. (Business & Operation Support Systems) P.O (Product Owner)
>> 
>> IMETRIK GLOBAL INC. 
>> T : +1 514 448-6407 x2009
>> T : +1 866 276-5382 (toll free) 
>> F : +1 514 904-0611 
>> 
>> 740 Notre Dame St. West, Suite 1575 
>> Montreal, Quebec, Canada H3C 3X6 
>> imetrik.com <http://www.imetrik.com/>
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151005/46830d2b/attachment-0001.html 


More information about the keycloak-user mailing list