Package java.security

Examples of java.security.KeyStore.deleteEntry()


        if (!((RSAPrivateKey)key).getModulus().equals(mod))
        {
            fail("Modulus doesn't match.");
        }

        store.deleteEntry(pName);

        if (store.getKey(pName, null) != null)
        {
            fail("Failed deletion test.");
        }
View Full Code Here


            FileInputStream fsIn = new FileInputStream(pathToKeystore);
            KeyStore certStore = KeyStore.getInstance("JKS");
            certStore.load(fsIn, keystorePassword.toCharArray());

            if (certStore.containsAlias(accessKey[0])) {
                certStore.deleteEntry(accessKey[0]);
                FileOutputStream fsOut = new FileOutputStream(pathToKeystore);
                certStore.store(fsOut, keystorePassword.toCharArray());

                // -> dis-associate the cert's uniqueId with the Cloud API keys
                /*                  UserCredentialsDao credentialDao = new UserCredentialsDao();
View Full Code Here

        X509Certificate[] newChain = CertChainVerifier.buildFullCertPath(param,
                newCert);

        // changing the certificate chain //
        // remove the entry with old certificate chain
        keyStore.deleteEntry(alias);

        // set the new certificate chain
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(), newChain);
        param.setNeedSaveKS(true);
        System.out
View Full Code Here

        // replacing old certificate chain with the new one
        char[] keyPassword = param.getKeyPass();
        PrivateKey privateKey = (PrivateKey) keyStore
                .getKey(alias, keyPassword);
        keyStore.deleteEntry(alias);
        keyStore.setKeyEntry(alias, privateKey, keyPassword, orderedChain);
        param.setNeedSaveKS(true);
        System.out.println("The certificate reply is " + "successfully "
                + "installed into the keystore.");
    }
View Full Code Here

        X509Certificate[] newChain = CertChainVerifier.buildFullCertPath(param,
                newCert);

        // changing the certificate chain //
        // remove the entry with old certificate chain
        keyStore.deleteEntry(alias);

        // set the new certificate chain
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(), newChain);
        param.setNeedSaveKS(true);
        System.out
View Full Code Here

        // replacing old certificate chain with the new one
        char[] keyPassword = param.getKeyPass();
        PrivateKey privateKey = (PrivateKey) keyStore
                .getKey(alias, keyPassword);
        keyStore.deleteEntry(alias);
        keyStore.setKeyEntry(alias, privateKey, keyPassword, orderedChain);
        param.setNeedSaveKS(true);
        System.out.println("The certificate reply is " + "successfully "
                + "installed into the keystore.");
    }
View Full Code Here

          FileInputStream fsIn = new FileInputStream( pathToKeystore );
          KeyStore certStore = KeyStore.getInstance( "JKS" );
          certStore.load( fsIn, keystorePassword.toCharArray());

          if ( certStore.containsAlias( accessKey[0] )) {
                certStore.deleteEntry( accessKey[0] );
                FileOutputStream fsOut = new FileOutputStream( pathToKeystore );
               certStore.store( fsOut, keystorePassword.toCharArray());
              
              // -> dis-associate the cert's uniqueId with the Cloud API keys
              UserCredentialsDao credentialDao = new UserCredentialsDao();
View Full Code Here

         {
            String sAlias = (String)e.nextElement();

            if (sAlias.startsWith(SysUtil.NAMESPACE + "-"))
            {
               keyStore.deleteEntry(sAlias);
            }
         }

         // Add the nexj elements.
         for (Iterator itr = m_metadata.getChannelIterator(); itr.hasNext();)
View Full Code Here

        X509Certificate[] newChain = CertChainVerifier.buildFullCertPath(param,
                newCert);

        // changing the certificate chain //
        // remove the entry with old certificate chain
        keyStore.deleteEntry(alias);

        // set the new certificate chain
        keyStore.setKeyEntry(alias, privateKey, param.getKeyPass(), newChain);
        param.setNeedSaveKS(true);
        System.out
View Full Code Here

        // replacing old certificate chain with the new one
        char[] keyPassword = param.getKeyPass();
        PrivateKey privateKey = (PrivateKey) keyStore
                .getKey(alias, keyPassword);
        keyStore.deleteEntry(alias);
        keyStore.setKeyEntry(alias, privateKey, keyPassword, orderedChain);
        param.setNeedSaveKS(true);
        System.out.println("The certificate reply is " + "successfully "
                + "installed into the keystore.");
    }
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.