Package org.apache.ws.security.components.crypto

Examples of org.apache.ws.security.components.crypto.Crypto


        }
        keyTypeTemplate = writeKeyType(writer, keyTypeTemplate);

        byte[] requestorEntropy = null;
        X509Certificate cert = null;
        Crypto crypto = null;

        if (keySize <= 0) {
            keySize = 256;
        }
        if (keyTypeTemplate != null && keyTypeTemplate.endsWith("SymmetricKey")) {
View Full Code Here


        return o;
    }

    private Crypto createCrypto(boolean decrypt) throws IOException {
        WSSConfig.getDefaultWSConfig();
        Crypto crypto = (Crypto)getProperty(SecurityConstants.STS_TOKEN_CRYPTO + (decrypt ? ".decrypt" : ""));
        if (crypto != null) {
            return crypto;
        }

        Object o = getProperty(SecurityConstants.STS_TOKEN_PROPERTIES + (decrypt ? ".decrypt" : ""));
View Full Code Here

        return super.decodeEnableSignatureConfirmation(reqData);
    }

    public Crypto loadSignatureCrypto(RequestData reqData)
        throws WSSecurityException {
        Crypto crypto = null;
        /*
         *Get crypto property file for signature. If none specified throw
         * fault, otherwise get a crypto instance.
         */
        String sigPropFile = getString(WSHandlerConstants.SIG_PROP_FILE,
View Full Code Here

        }
    }

    protected Crypto loadDecryptionCrypto(RequestData reqData)
        throws WSSecurityException {
        Crypto crypto = null;
        String decPropFile = getString(WSHandlerConstants.DEC_PROP_FILE,
                 reqData.getMsgContext());
        String refId = null;
        if (decPropFile != null) {
            crypto = cryptoTable.get(decPropFile);
View Full Code Here

        return crypto;
    }
   
    protected Crypto loadEncryptionCrypto(RequestData reqData)
        throws WSSecurityException {
        Crypto crypto = null;
        /*
        * Get encryption crypto property file. If non specified take crypto
        * instance from signature, if that fails: throw fault
        */
        String encPropFile = getString(WSHandlerConstants.ENC_PROP_FILE,
View Full Code Here

            new SecurityToken(assertionId, issuedAssertion, null);
       
        Properties cryptoProps = new Properties();
        URL url = ClassLoader.getSystemResource("META-INF/cxf/outsecurity.properties");
        cryptoProps.load(url.openStream());
        Crypto crypto = CryptoFactory.getInstance(cryptoProps);
        String alias = cryptoProps.getProperty("org.apache.ws.security.crypto.merlin.keystore.alias");
        issuedToken.setX509Certificate(crypto.getCertificates(alias)[0], crypto);
       
        msg.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID,
                issuedToken.getId());
        msg.getExchange().put(SecurityConstants.TOKEN_ID, issuedToken.getId());
       
View Full Code Here

                } else {
                    sig.setCustomTokenValueType(tokenType);
                }
                sig.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
            }
            Crypto crypto = null;
            if (secTok.getSecret() == null) {
                sig.setX509Certificate(secTok.getX509Certificate());
               
                crypto = secTok.getCrypto();
                String uname = crypto.getKeyStore().getCertificateAlias(secTok.getX509Certificate());
                String password = getPassword(uname, token, WSPasswordCallback.SIGNATURE);
                if (password == null) {
                    password = "";
                }
                sig.setUserInfo(uname, password);
View Full Code Here

                    WSSecEncrypt encr = new WSSecEncrypt();
                   
                    setKeyIdentifierType(encr, recToken, encrToken);
                   
                    encr.setDocument(saaj.getSOAPPart());
                    Crypto crypto = getEncryptionCrypto(recToken);
                    setEncryptionUser(encr, recToken, false, crypto);
                    encr.setSymmetricEncAlgorithm(algorithmSuite.getEncryption());
                    encr.setKeyEncAlgo(algorithmSuite.getAsymmetricKeyWrap());
                   
                    encr.prepare(saaj.getSOAPPart(),
View Full Code Here

        String cryptoPropertyFile,
        String cryptoPropertyRefId,
        RequestData requestData
    ) throws WSSecurityException {
        Object mc = requestData.getMsgContext();
        Crypto crypto = null;
       
        //
        // Try the Property Ref Id first
        //
        String refId = getString(cryptoPropertyRefId, mc);
View Full Code Here

     * Hook to allow subclasses to load their Signature Crypto however they see
     * fit.
     */
    public Crypto loadSignatureCrypto(RequestData reqData)
  throws WSSecurityException {
        Crypto crypto = null;
        /*
        * Get crypto property file for signature. If none specified throw
        * fault, otherwise get a crypto instance.
        */
        String sigPropFile = getString(WSHandlerConstants.SIG_PROP_FILE,
View Full Code Here

TOP

Related Classes of org.apache.ws.security.components.crypto.Crypto

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.