Exception when creating the signature using OpenSAML lib

Yaowen Tu yaowen.tu at gmail.com
Wed Oct 31 18:55:53 EDT 2012


Thanks Brent. What I am trying to do is a simple unit test case:
1) Create an SP metadata file with signature.
2) Load the metadata and validate couple things including the signature.

Attached is the metadata file I created. When I try to validate it, I got
the exception.

I have been using createSAMLObject in a lot of places, here is the code:

public static <T> T createSAMLObject( final Class<T> classVar )
    {
        XMLObjectBuilderFactory builderFactory =
Configuration.getBuilderFactory();

        QName defaultElementName;

        T object = null;
        try
        {
            defaultElementName = (QName)classVar.getDeclaredField(
"DEFAULT_ELEMENT_NAME" ).get( null );

            object =
(T)builderFactory.getBuilder(defaultElementName).buildObject(
defaultElementName );

        }
        catch ( Exception e )
        {
            // TODO Add log to show the error when trying to get
DEFAULT_ELEMENT_NAME
            e.printStackTrace();
        }

        return object;
    }


Yaowen


On Wed, Oct 31, 2012 at 3:47 PM, Brent Putman <putmanb at georgetown.edu>wrote:

>
> On 10/31/12 5:37 PM, Yaowen Tu wrote:
> >
> >         Signature signature = createSAMLObject( Signature.class );//a
> > wrapper to create a saml object easier.
>
>
> This is suspicious.  I don't know what you're doing there, but that
> might be related to your problem.  You should use a builder to create
> the Signature object and I don't know how you're doing that based on a
> class literal.  A QName would make sense, but not a Signature.class
> literal.
> --
> To unsubscribe from this list send an email to
> dev-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20121031/74343822/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spMetadataFile.xml
Type: text/xml
Size: 4894 bytes
Desc: not available
Url : http://shibboleth.net/pipermail/dev/attachments/20121031/74343822/attachment-0001.xml 


More information about the dev mailing list