Java Key Create getKeyManagers(KeyStore keyStore, String keyPassword)

Here you can find the source of getKeyManagers(KeyStore keyStore, String keyPassword)

Description

get Key Managers

License

Open Source License

Declaration

private static KeyManager[] getKeyManagers(KeyStore keyStore, String keyPassword)
            throws GeneralSecurityException, IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;

public class Main {
    private static KeyManager[] getKeyManagers(KeyStore keyStore, String keyPassword)
            throws GeneralSecurityException, IOException {
        String alg = KeyManagerFactory.getDefaultAlgorithm();
        char[] keyPass = keyPassword != null ? keyPassword.toCharArray() : null;
        KeyManagerFactory fac = KeyManagerFactory.getInstance(alg);
        fac.init(keyStore, keyPass);//from   w  ww. j ava 2 s  .  c  o m
        return fac.getKeyManagers();
    }
}

Related

  1. getKeyManagerFactory(InputStream key, String keyPassword)
  2. getKeyManagerFactory(KeyStore keystore, String password)
  3. getKeyManagerFactory(KeyStore store, char[] password)
  4. getKeyManagerFactory(Map stores)
  5. getKeyManagers()
  6. getKeyManagers(KeyStore ks, String password)
  7. getKeyPair()
  8. getKeyPair()
  9. getKeyPair()