Examples of AlgorithmParameterSpec


Examples of java.security.spec.AlgorithmParameterSpec

        byte[]  shared_secret = sts_engine.getSharedSecret();
               
          SecretKeySpec  secret_key_spec1 = new SecretKeySpec(shared_secret, 0, 16, "AES" );
          SecretKeySpec  secret_key_spec2 = new SecretKeySpec(shared_secret, 8, 16, "AES" );
           
          AlgorithmParameterSpec  param_spec1 =   new IvParameterSpec( AES_IV1);
          AlgorithmParameterSpec  param_spec2 =   new IvParameterSpec( AES_IV2);     
             
          Cipher cipher1 = Cipher.getInstance( "AES/CBC/PKCS5Padding" );
          Cipher cipher2 = Cipher.getInstance( "AES/CBC/PKCS5Padding" );
           
          if ( connection.isIncoming()){
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        Key                 key,
        AlgorithmParameters params,
        SecureRandom        random)
    throws InvalidKeyException, InvalidAlgorithmParameterException
    {
        AlgorithmParameterSpec  paramSpec = null;

        if (params != null)
        {
            for (int i = 0; i != availableSpecs.length; i++)
            {
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

                        }

                        try {
                            Cipher cipher = Cipher.getInstance(jceid);

                            AlgorithmParameterSpec algorithmParameterSpec = null;
                            if (XMLSecurityConstants.NS_XENC11_RSAOAEP.equals(encryptionKeyTransportAlgorithm) ||
                                    XMLSecurityConstants.NS_XENC_RSAOAEPMGF1P.equals(encryptionKeyTransportAlgorithm)) {

                                String jceDigestAlgorithm = "SHA-1";
                                if (encryptionKeyTransportDigestAlgorithm != null) {
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getAlgorithm().hashCode();
        AlgorithmParameterSpec spec = getParameterSpec();
        if (spec != null) {
            result = 31 * result + spec.hashCode();
        }

        return result;
    }
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        // Now perform the encryption

        int ivLen = JCEMapper.getIVLengthFromURI(algorithm) / 8;
        byte[] iv = XMLSecurityConstants.generateBytes(ivLen);
        try {
            AlgorithmParameterSpec paramSpec = constructBlockCipherParameters(algorithm, iv);
            c.init(cipherMode, key, paramSpec);
        } catch (InvalidKeyException ike) {
            throw new XMLEncryptionException("empty", ike);
        }
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

            try {
                // This class only added in Java 1.7. So load reflectively until Santuario starts targeting a minimum of Java 1.7.
                Class<?> gcmSpecClass = ClassLoaderUtils.loadClass("javax.crypto.spec.GCMParameterSpec", this.getClass());
               
                // XML Encryption 1.1 mandates a 128-bit Authentication Tag for AES GCM modes.
                AlgorithmParameterSpec gcmSpec = (AlgorithmParameterSpec) gcmSpecClass.getConstructor(int.class, byte[].class)
                        .newInstance(128, iv);
                log.debug("Successfully created GCMParameterSpec");
                return gcmSpec;
            } catch (Exception e) {
                // This handles the case of Java < 1.7 with a third-party security provider that
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        // and it will only take the first x bytes, but no way to be certain
        // that this will work for every JCE provider, so lets copy the
        // necessary bytes into a dedicated array.

        System.arraycopy(encryptedBytes, 0, ivBytes, 0, ivLen);
        AlgorithmParameterSpec paramSpec = constructBlockCipherParameters(algorithm, ivBytes);

        try {
            c.init(cipherMode, key, paramSpec);
        } catch (InvalidKeyException ike) {
            throw new XMLEncryptionException("empty", ike);
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        if (!WSConstants.C14N_EXCL_OMIT_COMMENTS.equals(c14nMethod)) {
            bspEnforcer.handleBSPRule(BSPRule.R5404);
        }

        // Not allowed HMAC OutputLength
        AlgorithmParameterSpec parameterSpec =
            xmlSignature.getSignedInfo().getSignatureMethod().getParameterSpec();
        if (parameterSpec instanceof HMACParameterSpec) {
            bspEnforcer.handleBSPRule(BSPRule.R5401);
        }
       
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        Key                 key,
        AlgorithmParameters params,
        SecureRandom        random)
    throws InvalidKeyException, InvalidAlgorithmParameterException
    {
        AlgorithmParameterSpec  paramSpec = null;

        if (params != null)
        {
            for (int i = 0; i != availableSpecs.length; i++)
            {
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

        Key key,
        AlgorithmParameters params,
        SecureRandom random)
    throws InvalidKeyException, InvalidAlgorithmParameterException
    {
        AlgorithmParameterSpec paramSpec = null;

        if (params != null)
        {
            try
            {
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.