Package org.picketlink.identity.federation.saml.v2.metadata

Examples of org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType


          
           Certificate cert = keyManager.getCertificate(signingAlias);
           KeyInfoType keyInfo = KeyUtil.getKeyInfo(cert);
          
           //TODO: Assume just signing key for now
           KeyDescriptorType keyDescriptor = KeyDescriptorMetaDataBuilder.createKeyDescriptor(keyInfo,
                 null, 0, true, false);
          
           updateKeyDescriptor(metadata, keyDescriptor);
          
           //encryption
View Full Code Here


     
      if(isSigningKey == isEncryptionKey)
         throw new IllegalArgumentException("Only one of isSigningKey " +
             "and isEncryptionKey should be true");
     
      KeyDescriptorType keyDescriptor = getObjectFactory().createKeyDescriptorType();
     
      if(algorithm != null && algorithm.length() > 0)
      {
         EncryptionMethodType encryptionMethod = new EncryptionMethodType();
         encryptionMethod.setAlgorithm(algorithm);
        
         encryptionMethod.getContent().add(BigInteger.valueOf(keySize));
        
         keyDescriptor.getEncryptionMethod().add(encryptionMethod)
      }
     
      if(isSigningKey)
         keyDescriptor.setUse(KeyTypes.SIGNING);
      if(isEncryptionKey)
         keyDescriptor.setUse(KeyTypes.ENCRYPTION);
     
      keyDescriptor.setKeyInfo(keyInfo);
     
      return keyDescriptor;
   }
View Full Code Here

         Certificate cert = keyManager.getCertificate(signingAlias);
         KeyInfoType keyInfo = KeyUtil.getKeyInfo(cert);

         //TODO: Assume just signing key for now
         KeyDescriptorType keyDescriptor = KeyDescriptorMetaDataBuilder.createKeyDescriptor(keyInfo,
               null, 0, true, false);

         updateKeyDescriptor(metadata, keyDescriptor);

         //encryption
View Full Code Here

         Certificate cert = keyManager.getCertificate(signingAlias);
         KeyInfoType keyInfo = KeyUtil.getKeyInfo(cert);

         //TODO: Assume just signing key for now
         KeyDescriptorType keyDescriptor = KeyDescriptorMetaDataBuilder.createKeyDescriptor(keyInfo,
               null, 0, true, false);

         updateKeyDescriptor(metadata, keyDescriptor);

         //encryption
View Full Code Here

        X509Data.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(X509Certificate);

        KeyInfoType keyInfo = signatureFactory.createKeyInfoType();
        keyInfo.getContent().add(signatureFactory.createX509Data(X509Data));

        KeyDescriptorType keyDescriptor = metaDataFactory.createKeyDescriptorType();
        keyDescriptor.setUse(KeyTypes.SIGNING);
        keyDescriptor.setKeyInfo(keyInfo);

        ssoDescriptor.getKeyDescriptor().add(keyDescriptor);
    }
View Full Code Here

      X509Data.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(X509Certificate);

      KeyInfoType keyInfo = signatureFactory.createKeyInfoType();
      keyInfo.getContent().add(signatureFactory.createX509Data(X509Data));

      KeyDescriptorType keyDescriptor = metaDataFactory.createKeyDescriptorType();
      keyDescriptor.setUse(KeyTypes.SIGNING);
      keyDescriptor.setKeyInfo(keyInfo);

      ssoDescriptor.getKeyDescriptor().add(keyDescriptor);
   }
View Full Code Here

                event.event(EventType.LOGIN);
                event.error(Errors.INVALID_TOKEN);
                return Flows.forwardToSecurityFailurePage(session, realm, uriInfo, "Invalid Request");
            }

            SAML2Object samlObject = documentHolder.getSamlObject();

            RequestAbstractType requestAbstractType = (RequestAbstractType)samlObject;
            String issuer = requestAbstractType.getIssuer().getValue();
            ClientModel client = realm.findClient(issuer);
View Full Code Here

        Document samlDocument = DocumentUtil.getDocument(is);

        SAMLParser samlParser = new SAMLParser();
        JAXPValidationUtil.checkSchemaValidation(samlDocument);
        SAML2Object requestType = (SAML2Object) samlParser.parse(DocumentUtil.getNodeAsStream(samlDocument));

        samlDocumentHolder = new SAMLDocumentHolder(requestType, samlDocument);
        return requestType;
    }
View Full Code Here

        sp.setRequestID(requestID);
        sp.setIssuer(requestIssuer);
        responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);

        // Add information on the roles
        AssertionType assertion = responseType.getAssertions().get(0).getAssertion();

        // Create an AuthnStatementType
        if (!disableAuthnStatement) {
            String authContextRef = JBossSAMLURIConstants.AC_UNSPECIFIED.get();
            if (isNotNull(authMethod))
                authContextRef = authMethod;

            AuthnStatementType authnStatement = StatementUtil.createAuthnStatement(XMLTimeUtil.getIssueInstant(),
                    authContextRef);

            authnStatement.setSessionIndex(assertion.getID());

            assertion.addStatement(authnStatement);
        }

        if (roles != null && !roles.isEmpty()) {
            AttributeStatementType attrStatement = StatementUtil.createAttributeStatementForRoles(roles, multiValuedRoles);
            assertion.addStatement(attrStatement);
        }

        // Add in the attributes information
        if (attributes != null && attributes.size() > 0) {
            AttributeStatementType attStatement = StatementUtil.createAttributeStatement(attributes);
            assertion.addStatement(attStatement);
        }

        try {
            samlResponseDocument = saml2Response.convert(responseType);
View Full Code Here

            String assertionStr = samlCredential.getAssertionAsString();
            if (StringUtil.isNullOrEmpty(assertionStr))
                throw logger.authSAMLAssertionNullOrEmpty();

            SAMLParser parser = new SAMLParser();
            AssertionType assertion = (AssertionType) parser.parse(new ByteArrayInputStream(assertionStr.getBytes()));
            List<String> roles = AssertionUtil.getRoles(assertion, null);
            Group roleGroup = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
            for (String role : roles) {
                roleGroup.addMember(new SimplePrincipal(role));
            }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType

Copyright © 2018 www.massapicom. 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.