Package io.kubernetes.client.util
Class SSLUtils
java.lang.Object
io.kubernetes.client.util.SSLUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyStore
createKeyStore
(byte[] clientCertData, byte[] clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String keyStoreFile, String keyStorePassphrase) static KeyStore
createKeyStore
(InputStream certInputStream, InputStream keyInputStream, String clientKeyAlgo, char[] clientKeyPassphrase, String keyStoreFile, char[] keyStorePassphrase) static byte[]
dumpKey
(PrivateKey privateKey) static boolean
isNotNullOrEmpty
(String val) static KeyManager[]
keyManagers
(byte[] certData, byte[] keyData, String algo, String passphrase, String keyStoreFile, String keyStorePassphrase) static PrivateKey
loadKey
(byte[] privateKeyBytes) static PrivateKey
static PrivateKey
loadKey
(InputStream keyInputStream, String clientKeyAlgo) static String
recognizePrivateKeyAlgo
(byte[] privateKeyBytes)
-
Constructor Details
-
SSLUtils
public SSLUtils()
-
-
Method Details
-
isNotNullOrEmpty
-
keyManagers
public static KeyManager[] keyManagers(byte[] certData, byte[] keyData, String algo, String passphrase, String keyStoreFile, String keyStorePassphrase) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, CertificateException, InvalidKeySpecException, IOException -
createKeyStore
public static KeyStore createKeyStore(byte[] clientCertData, byte[] clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String keyStoreFile, String keyStorePassphrase) throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException -
dumpKey
- Throws:
IOException
-
recognizePrivateKeyAlgo
-
loadKey
public static PrivateKey loadKey(byte[] privateKeyBytes) throws IOException, InvalidKeySpecException - Throws:
IOException
InvalidKeySpecException
-
loadKey
public static PrivateKey loadKey(byte[] pemPrivateKeyBytes, String algo) throws IOException, InvalidKeySpecException - Throws:
IOException
InvalidKeySpecException
-
loadKey
public static PrivateKey loadKey(InputStream keyInputStream, String clientKeyAlgo) throws IOException, InvalidKeySpecException - Throws:
IOException
InvalidKeySpecException
-
createKeyStore
public static KeyStore createKeyStore(InputStream certInputStream, InputStream keyInputStream, String clientKeyAlgo, char[] clientKeyPassphrase, String keyStoreFile, char[] keyStorePassphrase) throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException
-