Examples of KeyInfoConfirmationDataType


Examples of org.jboss.identity.federation.saml.v2.assertion.KeyInfoConfirmationDataType

         restriction = SAMLAssertionFactory.createAudienceRestriction(WSTrustUtil.parseAppliesTo(appliesTo));
      ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
            restriction);

      String confirmationMethod = null;
      KeyInfoConfirmationDataType keyInfoDataType = null;
      // if there is a proof-of-possession token in the context, we have the holder of key confirmation method.
      if (context.getProofTokenInfo() != null)
      {
         confirmationMethod = SAMLUtil.SAML2_HOLDER_OF_KEY_URI;
         keyInfoDataType = SAMLAssertionFactory.createKeyInfoConfirmation(context.getProofTokenInfo());
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.assertion.KeyInfoConfirmationDataType

    * @param keyInfo the {@code KeyInfoType} object that wraps the proof-of-possession token.
    * @return the constructed {@code KeyInfoConfirmationDataType} instance.
    */
   public static KeyInfoConfirmationDataType createKeyInfoConfirmation(KeyInfoType keyInfo)
   {
      KeyInfoConfirmationDataType type = getObjectFactory().createKeyInfoConfirmationDataType();
      type.getContent().add(new org.jboss.identity.xmlsec.w3.xmldsig.ObjectFactory().createKeyInfo(keyInfo));
      return type;
   }
View Full Code Here

Examples of org.opensaml.saml2.core.KeyInfoConfirmationDataType

        Subject subject = (new SubjectBuilder()).buildObject();
        subject.setNameID(nameID);
        SubjectConfirmation confirmation = (new SubjectConfirmationBuilder())
                .buildObject();
        confirmation.setMethod(SubjectConfirmation.METHOD_HOLDER_OF_KEY);
        KeyInfoConfirmationDataType keyInfoDataType = new KeyInfoConfirmationDataTypeBuilder()
                .buildObject();
        BasicX509Credential keyInfoCredential = new BasicX509Credential();
        keyInfoCredential.setEntityCertificate(certificate);
        keyInfoCredential.setPublicKey(certificate.getPublicKey());
        BasicKeyInfoGeneratorFactory kiFactory = new BasicKeyInfoGeneratorFactory();
        kiFactory.setEmitPublicKeyValue(true);
        KeyInfo keyInfo = kiFactory.newInstance().generate(keyInfoCredential);
        keyInfoDataType.getKeyInfos().add(keyInfo);
        subject.getSubjectConfirmations().add(confirmation);
        subject.getSubjectConfirmations().get(0)
                .setSubjectConfirmationData(keyInfoDataType);
        return subject;
    }
View Full Code Here

Examples of org.opensaml.saml2.core.KeyInfoConfirmationDataType

                    throw new WSSecurityException(WSSecurityException.FAILURE,
                            "invalidSAML2Token", new Object[]{"for Signature (no Subject Confirmation)"});
                }

                // Get the subject confirmation data, KeyInfoConfirmationDataType extends SubjectConfirmationData.
                KeyInfoConfirmationDataType scData = (KeyInfoConfirmationDataType) subjectConf.getSubjectConfirmationData();
                if (scData == null) {
                    throw new WSSecurityException(WSSecurityException.FAILURE,
                            "invalidSAML2Token", new Object[]{"for Signature (no Subject Confirmation Data)"});
                }

                // Get the SAML specific XML representation of the keyInfo object
                XMLObject KIElem = scData.getKeyInfos() != null ? (XMLObject) scData.getKeyInfos().get(0) : null;

                Element keyInfoElement;

                // Generate a DOM element from the XMLObject.
                if (KIElem != null) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.KeyInfoConfirmationDataType

     *
     * @param keyInfo the {@code KeyInfoType} object that wraps the proof-of-possession token.
     * @return the constructed {@code KeyInfoConfirmationDataType} instance.
     */
    public static KeyInfoConfirmationDataType createKeyInfoConfirmation(KeyInfoType keyInfo) {
        KeyInfoConfirmationDataType type = new KeyInfoConfirmationDataType();
        type.setAnyType(keyInfo);
        return type;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.KeyInfoConfirmationDataType

        // the assertion principal (default is caller principal)
        Principal principal = context.getCallerPrincipal();

        String confirmationMethod = null;
        KeyInfoConfirmationDataType keyInfoDataType = null;
        // if there is a on-behalf-of principal, we have the sender vouches confirmation method.
        if (context.getOnBehalfOfPrincipal() != null) {
            principal = context.getOnBehalfOfPrincipal();
            confirmationMethod = SAMLUtil.SAML2_SENDER_VOUCHES_URI;
        }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.KeyInfoConfirmationDataType

        if (StringUtil.isNotNull(address)) {
            StaxUtil.writeAttribute(writer, JBossSAMLConstants.ADDRESS.get(), address);
        }

        if (subjectConfirmationData instanceof KeyInfoConfirmationDataType) {
            KeyInfoConfirmationDataType kicd = (KeyInfoConfirmationDataType) subjectConfirmationData;
            KeyInfoType keyInfo = (KeyInfoType) kicd.getAnyType();
            StaxUtil.writeKeyInfo(writer, keyInfo);
            /*
             * if (keyInfo.getContent() == null || keyInfo.getContent().size() == 0) throw new
             * ProcessingException(ErrorCodes.WRITER_INVALID_KEYINFO_NULL_CONTENT); StaxUtil.writeStartElement(this.writer,
             * WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.XMLDSig.KEYINFO, WSTrustConstants.XMLDSig.DSIG_NS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.