Results 1 to 4 of 4

Thread: bouncy castle exception with osgi

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    21

    Default bouncy castle exception with osgi

    Hello,

    I have a billing service that is trying to encrypt some information using Jasypt and Bouncy Castle. The billing service is exported as an osgi service through a bundle and referenced through osgi in my web module. The web module tries to take some billing information, and using the billing service, encrypt that information and save it.

    When I try to enter the billing information now, I get a jce security provider exception:

    Code:
    org.jasypt.exceptions.EncryptionInitializationException: java.lang.SecurityException: JCE cannot authenticate the provider BC
    	org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:599)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:488)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:541)
    
    
    
    java.lang.SecurityException: JCE cannot authenticate the provider BC
    	javax.crypto.SunJCE_b.a(DashoA13*..)
    	javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
    	org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:558)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:488)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:541)
    
    
    java.util.jar.JarException: Cannot parse file:/C:/p4/main/Web/extern/s2ap/dev-profiles/web/work/equinox-config/org.eclipse.osgi/bundles/96/1/bundlefile
    	javax.crypto.SunJCE_c.a(DashoA13*..)
    	javax.crypto.SunJCE_b.b(DashoA13*..)
    	javax.crypto.SunJCE_b.a(DashoA13*..)
    	javax.crypto.SunJCE_b.a(DashoA13*..)
    	javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
    	org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:558)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:488)
    	org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:541)
    Is there something that the jar needs to access to authenticate the provider? I am using the jasypt module and bouncy castle module provided by spring source

    com.springsource.org.bouncycastle.jce;resolution:= optional,com.trionworld.arc.org.jasypt.jasypt;reso lution:=optional

  2. #2
    Join Date
    Sep 2007
    Posts
    21

    Default

    After further investigation, it looks like the bouncy castle module provided by spring source repository is not signed, which is why I was getting the error. Instead of deploying bouncy castle as a module, I am now including the entire bouncy castle jar in my billing service module.

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Could you please report this to the BRITS issue tracker? It will definitely prevent other users to run into this problem again.
    Thanks,
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #4
    Join Date
    Sep 2007
    Posts
    21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •