Skip to Content.
Sympa Menu

mace-opensaml-users - KeyInfo in SubjecConfirmation in saml1

Subject: OpenSAML user discussion

List archive

KeyInfo in SubjecConfirmation in saml1


Chronological Thread 
  • From: Pedro Navarro Pérez <>
  • To:
  • Subject: KeyInfo in SubjecConfirmation in saml1
  • Date: Fri, 06 Jul 2007 11:43:42 +0200

Hi,

I'm trying to get a KeyInfo element in a saml1 SubjectConfirmation, with I always obtain a null. I've checked the SubjectConfirmationUnMarshaller code and I've seen that the KeyInfo element isn't setted correctly:

/*
* Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opensaml.saml1.core.impl;

import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml1.core.ConfirmationMethod;
import org.opensaml.saml1.core.SubjectConfirmation;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.UnmarshallingException;

/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml1.core.SubjectConfirmation} objects.
*/
public class SubjectConfirmationUnmarshaller extends AbstractSAMLObjectUnmarshaller {

/**
* Constructor
*/
public SubjectConfirmationUnmarshaller() {
super(SAMLConstants.SAML1_NS, SubjectConfirmation.DEFAULT_ELEMENT_LOCAL_NAME);
}

/**
{@inheritDoc}
*/
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {

SubjectConfirmation subjectConfirmation = (SubjectConfirmation) parentSAMLObject;

if (childSAMLObject instanceof ConfirmationMethod) {
subjectConfirmation.getConfirmationMethods().add((ConfirmationMethod) childSAMLObject);
} else {
subjectConfirmation.setSubjectConfirmationData(childSAMLObject);
}
}
}

I think the right code would be:

/*
* Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.opensaml.saml1.core.impl;

import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml1.core.ConfirmationMethod;
import org.opensaml.saml1.core.SubjectConfirmation;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.UnmarshallingException;
import org.opensaml.xml.signature.KeyInfo;

/**
* A thread-safe Unmarshaller for {@link org.opensaml.saml1.core.SubjectConfirmation} objects.
*/
public class SubjectConfirmationUnmarshaller extends AbstractSAMLObjectUnmarshaller {

/**
* Constructor
*/
public SubjectConfirmationUnmarshaller() {
super(SAMLConstants.SAML1_NS, SubjectConfirmation.DEFAULT_ELEMENT_LOCAL_NAME);
}

/**
{@inheritDoc}
*/
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {

SubjectConfirmation subjectConfirmation = (SubjectConfirmation) parentSAMLObject;

if (childSAMLObject instanceof ConfirmationMethod) {
subjectConfirmation.getConfirmationMethods().add((ConfirmationMethod) childSAMLObject);
} else if (childSAMLObject instanceof KeyInfo){
subjectConfirmation.setKeyInfo((KeyInfo) childSAMLObject);
}else {
subjectConfirmation.setSubjectConfirmationData(childSAMLObject);
}
}

What do you think?

Thanks

begin:vcard
note;quoted-printable:____________________________________________________________=0D=0A=
	Pedro Navarro P=C3=A9rez             =0D=0A=
	EVIDIAN S.A.                    www.evidian.com=0D=0A=
	Rue Jean Jaur=C3=A8s - BP 68=0D=0A=
	78340 Les Clayes-sous-Bois      T=C3=A9l : +33 1 30 80 73 26=0D=0A=
	____________________________________________________________ 
version:2.1
end:vcard



  • KeyInfo in SubjecConfirmation in saml1, Pedro Navarro Pérez, 07/06/2007

Archive powered by MHonArc 2.6.16.

Top of Page