Package java.security.spec

Examples of java.security.spec.AlgorithmParameterSpec


        }
        int[] keys =  { -10000, -1024, -1, 0, 10000 };
        KeyPairGenerator[] kpg = createKPGen();
        assertNotNull("KeyPairGenerator objects were not created", kpg);
        SecureRandom random = new SecureRandom();
        AlgorithmParameterSpec aps = null;

        for (int i = 0; i < kpg.length; i++) {
                       
            for (int j = 0; j < keys.length; j++) {               
                try {
View Full Code Here


     * KeyPair Additional class MyKeyPairGenerator1 is used
     */
    public void testKeyPairGenerator12() {
        int[] keys = { -1, -250, 1, 64, 512, 1024 };
        SecureRandom random = new SecureRandom();
        AlgorithmParameterSpec aps;
        KeyPairGenerator mKPG = new MyKeyPairGenerator1("");
        assertEquals("Incorrect algorithm", mKPG.getAlgorithm(),
                MyKeyPairGenerator1.getResAlgorithm());

        mKPG.generateKeyPair();
View Full Code Here

      if (algo.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) ||
    algo.equals(CanonicalizationMethod.EXCLUSIVE)) {
    cm = factory.newCanonicalizationMethod
        (CanonicalizationMethod.EXCLUSIVE,
         new ExcC14NParameterSpec());
    AlgorithmParameterSpec aps = cm.getParameterSpec();
    assertNotNull(aps);
    assertTrue(aps instanceof ExcC14NParameterSpec)
      }
  }
View Full Code Here

      if (algo.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) ||
    algo.equals(CanonicalizationMethod.EXCLUSIVE)) {
    cm = factory.newCanonicalizationMethod
        (CanonicalizationMethod.EXCLUSIVE,
         new ExcC14NParameterSpec());
    AlgorithmParameterSpec aps = cm.getParameterSpec();
    assertNotNull(aps);
    assertTrue(aps instanceof ExcC14NParameterSpec)
      }
  }
View Full Code Here

        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

        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

        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

        if (ObjectHelper.isNotEmpty(keyRef)) {
            Key key = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), keyRef, Key.class);
            setProperty(cryptoFormat, "key", key);
        }
        if (ObjectHelper.isNotEmpty(algorithmParameterRef)) {
            AlgorithmParameterSpec spec = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(),
                    algorithmParameterRef, AlgorithmParameterSpec.class);
            setProperty(cryptoFormat, "AlgorithmParameterSpec", spec);
        }
        if (ObjectHelper.isNotEmpty(initVectorRef)) {
            byte[] iv = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), initVectorRef, byte[].class);
View Full Code Here

          KeySpec keySpec = new PBEKeySpec(passPhrase, mSalt, iterationCount);
          key = SecretKeyFactory.getInstance(mAlgorithm).generateSecret(keySpec);
        }
        ecipher = Cipher.getInstance(mAlgorithm);
        dcipher = Cipher.getInstance(mAlgorithm);
        final AlgorithmParameterSpec paramSpec = new PBEParameterSpec(mSalt, iterationCount);
        ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
        dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
      }
      catch (final java.security.InvalidAlgorithmParameterException e) {
        LogUtils.severe(e);
View Full Code Here

        char[]  password,
        String  dekAlgName,
        byte[]  iv)
        throws IOException
    {
        AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
        String                 alg;
        String                 blockMode = "CBC";
        String                 padding = "PKCS5Padding";
        Key                    sKey;
View Full Code Here

TOP

Related Classes of java.security.spec.AlgorithmParameterSpec

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.