/** {@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); } } }
/** * Creates opensaml SubjectConfirmation representation. The relevant XML would looks as follows, * <pre> <saml:SubjectConfirmation> * <saml:ConfirmationMethod> * urn:oasis:names:tc:SAML:1.0:cm:sender-vouches * </saml:ConfirmationMethod> * </saml:SubjectConfirmation></pre> * @param confirmationMethod The subject confirmation method. Bearer, Sender-Vouches or Holder-Of-Key. * @param keyInfoContent The KeyInfo content. According to SPEC (SAML 1.1) this could be null. * @return OpenSAML representation of SubjectConfirmation. * @throws TrustException If unable to find any of the XML builders. */ public static SubjectConfirmation createSubjectConfirmation(final String confirmationMethod, KeyInfo keyInfoContent) throws TrustException { SubjectConfirmation subjectConfirmation = (SubjectConfirmation)CommonUtil.buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME); ConfirmationMethod method = SAMLUtils.createSubjectConfirmationMethod(confirmationMethod); subjectConfirmation.getConfirmationMethods().add(method); if (keyInfoContent != null) { subjectConfirmation.setKeyInfo(keyInfoContent); } return subjectConfirmation; }
if (subjectBean.getKeyInfo() != null) { KeyInfo keyInfo = createKeyInfo(subjectBean.getKeyInfo()); subjectConfirmation.setKeyInfo(keyInfo);
if (subjectBean.getKeyInfo() != null) { KeyInfo keyInfo = createKeyInfo(subjectBean.getKeyInfo()); subjectConfirmation.setKeyInfo(keyInfo);