Examples of WSSSAMLKeyInfoProcessor


Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

                (SamlAssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
            STRParserUtil.checkSamlTokenBSPCompliance(secRef, samlAssertion, data.getBSPEnforcer());
         
            SAMLKeyInfo keyInfo =
                SAMLUtil.getCredentialFromSubject(samlAssertion,
                        new WSSSAMLKeyInfoProcessor(data, wsDocInfo),
                        data.getSigVerCrypto(), data.getCallbackHandler());
            certs = keyInfo.getCerts();
        } else {
            throw new WSSecurityException(
                WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

            samlAssertion.verifySignature(samlKeyInfo);
        }
        // Parse the HOK subject if it exists
        samlAssertion.parseHOKSubject(
            new WSSSAMLKeyInfoProcessor(data, docInfo), data.getSigVerCrypto(),
            data.getCallbackHandler()
        );
           
        // Now delegate the rest of the verification to the Validator
        Credential credential = new Credential();
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

                                WSSecurityEngineResult.TAG_SAML_ASSERTION
                            );
                    } else {
                        samlAssertion = new SamlAssertionWrapper(processedToken);
                        samlAssertion.parseHOKSubject(
                            new WSSSAMLKeyInfoProcessor(data, wsDocInfo),
                            data.getSigVerCrypto(), data.getCallbackHandler()
                        );
                    }
                    STRParserUtil.checkSamlTokenBSPCompliance(secRef, samlAssertion, data.getBSPEnforcer());
                   
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

                );
            STRParserUtil.checkSamlTokenBSPCompliance(secRef, samlAssertion, data.getBSPEnforcer());
           
            SAMLKeyInfo samlKi =
                SAMLUtil.getCredentialFromSubject(samlAssertion,
                        new WSSSAMLKeyInfoProcessor(data, wsDocInfo),
                        data.getSigVerCrypto(), data.getCallbackHandler());
            X509Certificate[] foundCerts = samlKi.getCerts();
            if (foundCerts != null && foundCerts.length > 0) {
                certs = new X509Certificate[]{foundCerts[0]};
            }
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

        WSDocInfo wsDocInfo
    ) throws WSSecurityException {
        STRParserUtil.checkSamlTokenBSPCompliance(secRef, samlAssertion, data.getBSPEnforcer());
        SAMLKeyInfo samlKi =
            SAMLUtil.getCredentialFromSubject(samlAssertion,
                    new WSSSAMLKeyInfoProcessor(data, wsDocInfo),
                    data.getSigVerCrypto(), data.getCallbackHandler());
        if (samlKi == null) {
            throw new WSSecurityException(
                WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLToken", "No Secret Key");
        }
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

                (SamlAssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
            STRParserUtil.checkSamlTokenBSPCompliance(secRef, samlAssertion, data.getBSPEnforcer());
          
            SAMLKeyInfo keyInfo =
                SAMLUtil.getCredentialFromSubject(samlAssertion,
                        new WSSSAMLKeyInfoProcessor(data, wsDocInfo),
                        data.getSigVerCrypto(), data.getCallbackHandler());
            // TODO Handle malformed SAML tokens where they don't have the
            // secret in them
            secretKey = keyInfo.getSecret();
        } else {
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

            requestData.setCallbackHandler(callbackHandler);
            // Parse the HOK subject if it exists
           
            WSDocInfo docInfo = new WSDocInfo(((Element)tokenToRenew.getToken()).getOwnerDocument());
            assertion.parseHOKSubject(
                new WSSSAMLKeyInfoProcessor(requestData, docInfo), sigCrypto, callbackHandler
            );
           
            SAMLKeyInfo keyInfo = assertion.getSubjectKeyInfo();
            if (keyInfo == null) {
                keyInfo = new SAMLKeyInfo((byte[])null);
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

        data.setDecCrypto(CryptoFactory.getInstance(properties));
        data.setCallbackHandler(new PasswordCallbackHandler());
        data.setWssConfig(WSSConfig.getNewInstance());
       
        assertionWrapper.parseHOKSubject(
            new WSSSAMLKeyInfoProcessor(data, new WSDocInfo(assertion.getOwnerDocument())),
                                        data.getSigVerCrypto(), data.getCallbackHandler()
        );
       
        SAMLKeyInfo samlKeyInfo = assertionWrapper.getSubjectKeyInfo();
        assertTrue(Arrays.equals(secret, samlKeyInfo.getSecret()));
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

                        keyInfo.getDOM(), data.getSigVerCrypto()
                    );
               
                assertion.verifySignature(samlKeyInfo);
                assertion.parseHOKSubject(
                    new WSSSAMLKeyInfoProcessor(data, null), data.getSigVerCrypto(),
                    data.getCallbackHandler()
                );
            } else if (getTLSCertificates(message) == null) {
                throwFault("Assertion must be signed", null);
            }
View Full Code Here

Examples of org.apache.wss4j.dom.saml.WSSSAMLKeyInfoProcessor

        KeyInfo keyInfo = signature.getKeyInfo();
        SAMLKeyInfo samlKeyInfo = null;
        try {
            samlKeyInfo =
                SAMLUtil.getCredentialFromKeyInfo(
                    keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData, new WSDocInfo(doc)), sigCrypto
                );
        } catch (WSSecurityException ex) {
            LOG.log(Level.FINE, "Error in getting KeyInfo from SAML Response: " + ex.getMessage(), ex);
            throw ex;
        }
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.