Skip to Content.
Sympa Menu

mace-opensaml-users - XMLSignatureException: algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not exist.

Subject: OpenSAML user discussion

List archive

XMLSignatureException: algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not exist.


Chronological Thread 
  • From:
  • To:
  • Subject: XMLSignatureException: algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not exist.
  • Date: Mon, 4 Aug 2008 10:51:27 -0400 (EDT)

Hi to all

i'm an university student and i'm developing a project that need to use some
SAML component. In particular i've choose openSAML 1.1b for the java side;
after i have create the build directory and have included the classes in my
project i have installed all required jars:

-xmlsec.jar
-log4j-1.2.15.jar
-xalan.jar

I've created a simple java application with just a main that take a
certificate from file (standard X.509) and simply populate a SAMLAssertion
object. It all works without problem untill i try to sign the assertion. I
report here the exception:

##################################################################################
Exception in thread "main"
org.apache.xml.security.signature.XMLSignatureException: The requested
algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not exist. Original
Message was: null
Original Exception was java.lang.NullPointerException
at org.opensaml.SAMLSignedObject.sign(Unknown Source)
at MappingAssertion.main(MappingAssertion.java:211)
Caused by: org.apache.xml.security.signature.XMLSignatureException: The
requested algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 does not
exist. Original Message was: null
Original Exception was java.lang.NullPointerException
at
org.apache.xml.security.algorithms.SignatureAlgorithm.<init>(SignatureAlgorithm.java:148)
at
org.apache.xml.security.signature.SignedInfo.<init>(SignedInfo.java:154)
at
org.apache.xml.security.signature.XMLSignature.<init>(XMLSignature.java:236)
at
org.apache.xml.security.signature.XMLSignature.<init>(XMLSignature.java:214)
... 2 more
##################################################################################

here there is a part of code and the line (the last) that generate the
exception:

##################################################################################
KeyPairGenerator keyGen =KeyPairGenerator.getInstance("DSA", "SUN");
SecureRandom random =
SecureRandom.getInstance("SHA1PRNG", "SUN");
keyGen.initialize(1024, random);
KeyPair pair = keyGen.generateKeyPair();
PrivateKey priv = pair.getPrivate();
PublicKey pub = pair.getPublic();

ArrayList nuova=new ArrayList();
nuova.add(cert);


asr.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1,MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1,
priv, nuova);
##################################################################################

XMLSignature and MessageDigestAlgorithm are classes included in the xmlsec
jar. I think it was a problem of cunfigurantion but after looking in the
config.xml of xmlsec jar i havent' found problem so i have not modifying
nothing.

To develop this software i'm using

Eclipse SDK
Version: 3.4.0
Build id: I20080617-2000
with
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode)
installed on Windows Vista

I've read the SAML specification but about the use of XML Signature i'm new.
What can i do to solve my problem? Any suggestion.

Thank you very much for your help.

Best Regards
Omar Cavagna

PS for any informations tell me and sorry for my bad english.




Archive powered by MHonArc 2.6.16.

Top of Page