Java Key Create getKeyKeyManagerFactory(InputStream keyStore, String password, String algorithm, String keyStoreType)

Here you can find the source of getKeyKeyManagerFactory(InputStream keyStore, String password, String algorithm, String keyStoreType)

Description

get Key Key Manager Factory

License

Apache License

Declaration

public static KeyManagerFactory getKeyKeyManagerFactory(InputStream keyStore, String password, String algorithm,
            String keyStoreType) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.InputStream;
import java.security.KeyStore;

import javax.net.ssl.KeyManagerFactory;

public class Main {
    public static KeyManagerFactory getKeyKeyManagerFactory(InputStream keyStore, String password, String algorithm,
            String keyStoreType) throws Exception {
        KeyStore ks = KeyStore.getInstance(keyStoreType);
        ks.load(keyStore, password.toCharArray());
        keyStore.close();/*from  w w w. j  a  va2 s .c o m*/
        KeyManagerFactory k = KeyManagerFactory.getInstance(algorithm);
        k.init(ks, password.toCharArray());
        return k;
    }
}

Related

  1. getKeyFactory(final String algorithm)
  2. getKeyFactory(String keyType)
  3. getKeyFromFile(String _sFilename, String _sPassword)
  4. getKeyFromFile(String keyFile)
  5. getKeyGenerator(String algorithm)
  6. getKeyKeyManagerFactoryByPfx(InputStream keyStore, String password)
  7. getKeyManager(KeyStore keyStore, char[] keyStorePassword)
  8. getKeyManagerFactory(InputStream key, String keyPassword)
  9. getKeyManagerFactory(KeyStore keystore, String password)