Examples of AlgorithmParameterSpec


Examples of java.security.spec.AlgorithmParameterSpec

        if (!WSConstants.C14N_EXCL_OMIT_COMMENTS.equals(c14nMethod)) {
            throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "badC14nAlgo");
        }

        // Not allowed HMAC OutputLength
        AlgorithmParameterSpec parameterSpec =
            xmlSignature.getSignedInfo().getSignatureMethod().getParameterSpec();
        if (parameterSpec instanceof HMACParameterSpec) {
            throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "R5401");
        }
       
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

                if (random == null) {
                    random = SecureRandom.getInstance("SHA1PRNG");
                }
                iv = new byte[12];
                random.nextBytes(iv);
                AlgorithmParameterSpec paramSpec = constructBlockCipherParameters(algorithm, iv);
                c.init(cipherMode, key, paramSpec);
            } else {
                c.init(cipherMode, key);
            }
        } catch (InvalidKeyException 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

        {
            engineInit(opMode, key, random);
            return;
        }

        AlgorithmParameterSpec paramSpec = null;
        // XXX getting AlgorithmParameterSpec from AlgorithmParameters

        engineInit(opMode, key, paramSpec, random);
    }
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

    {
        kpg = KeyPairGenerator.getInstance("Rainbow");

        KeyFactory kf = KeyFactory.getInstance("Rainbow");

        AlgorithmParameterSpec specs = new RainbowParameterSpec();
        try
        {
            kpg.initialize(specs);
        }
        catch (InvalidAlgorithmParameterException e)
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

     */
    public void testEnDecryption_SHA256_11_50()
        throws Exception
    {
        // initialize key pair generator
        AlgorithmParameterSpec kpgParams = new ECCKeyGenParameterSpec(11, 50);
        kpg.initialize(kpgParams);

        // perform test
        performEnDecryptionTest(1, 10, 32, null);
    }
View Full Code Here

Examples of java.security.spec.AlgorithmParameterSpec

     */
    public void testEnDecryption_SHA256_11_50()
        throws Exception
    {
        // initialize key pair generator
        AlgorithmParameterSpec kpgParams = new ECCKeyGenParameterSpec(11, 50);
        kpg.initialize(kpgParams);

        performEnDecryptionTest(1, 10, 32, null);
    }
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)
        {
            for (int i = 0; i != availableSpecs.length; i++)
            {
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.