Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.security.NoSuchAlgorithmException: RIPEMD160 MessageDigest not available

Tags:

java

saml

We have a project where it initializes various algorithms while starting the an saml application. While starting, it throws the below error (please check the log) of not getting RIPEMD160,HMACRIPEMD160 and RIPEMD160withRSA. I tried to dig in for RIPEMD160 and found that the RIPEMD160 is mapped to the URL "http://www.w3.org/2001/04/xmlenc#ripemd160" in the DigestMethod.java file inside the rt.jar.

But could not find the cause of why the only algorithms failing are RIPEMD160, RIPEMD160withRSA, HMACRIPEMD160 and not the others.

14:28:38.930 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'BlockEncryption' with URI 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc': org.opensaml.xmlsec.algorithm.descriptors.BlockEncryptionDESede
    14:28:38.930 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#tripledes-cbc
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#md5': org.opensaml.xmlsec.algorithm.descriptors.DigestMD5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#md5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#ripemd160': org.opensaml.xmlsec.algorithm.descriptors.DigestRIPEMD160
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#ripemd160
    14:28:38.944 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmlenc#ripemd160
    java.security.NoSuchAlgorithmException: RIPEMD160 MessageDigest not available
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
        at java.security.Security.getImpl(Security.java:695)
        at java.security.MessageDigest.getInstance(MessageDigest.java:167)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:267)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.944 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmlenc#ripemd160
    14:28:38.948 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2000/09/xmldsig#sha1': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA1
    14:28:38.948 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#sha1
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#sha224': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA224
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#sha224
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#sha256': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA256
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#sha256
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#sha384': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA384
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#sha384
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#sha512': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA512
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#sha512
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-md5': org.opensaml.xmlsec.algorithm.descriptors.HMACMD5
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-md5
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160': org.opensaml.xmlsec.algorithm.descriptors.HMACRIPEMD160
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    java.security.NoSuchAlgorithmException: Algorithm HMACRIPEMD160 not available
        at javax.crypto.Mac.getInstance(Mac.java:181)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:263)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.952 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2000/09/xmldsig#hmac-sha1': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA1
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#hmac-sha1
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha224': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA224
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha224
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha256': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA256
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha256
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha384': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA384
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha384
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha512': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA512
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha512
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2001/04/xmlenc#rsa-1_5': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSA15
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#rsa-1_5
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2009/xmlenc11#rsa-oaep': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSAOAEP
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2009/xmlenc11#rsa-oaep
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSAOAEPMGF1P
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2000/09/xmldsig#dsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureDSASHA1
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#dsa-sha1
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2009/xmldsig11#dsa-sha256': org.opensaml.xmlsec.algorithm.descriptors.SignatureDSASHA256
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2009/xmldsig11#dsa-sha256
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA1
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1
    14:28:38.958 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA224
    14:28:38.958 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224
    14:28:38.959 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA256
    14:28:38.959 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA384
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA512
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSAMD5
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#rsa-md5
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSARIPEMD160
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    java.security.NoSuchAlgorithmException: RIPEMD160withRSA Signature not available
        at java.security.Signature.getInstance(Signature.java:229)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:259)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.963 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    14:28:38.963 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2000/09/xmldsig#rsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSASHA1
    14:28:38.963 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#rsa-sha1
like image 648
Pratim Singha Avatar asked Nov 06 '22 21:11

Pratim Singha


1 Answers

Added bouncycastle in my project and it worked fine.

Add below dependency in the pom:

    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.60</version>
    </dependency>

And added this line in the main method:

Security.addProvider(new BouncyCastleProvider());
like image 95
Pratim Singha Avatar answered Nov 14 '22 22:11

Pratim Singha