public class SSLUtils extends Object
Constructor and Description |
---|
SSLUtils() |
Modifier and Type | Method and Description |
---|---|
static 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 RSAPrivateCrtKeySpec |
decodePKCS1(byte[] keyBytes) |
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 |
loadKey(byte[] pemPrivateKeyBytes,
String algo) |
static PrivateKey |
loadKey(InputStream keyInputStream,
String clientKeyAlgo) |
static String |
recognizePrivateKeyAlgo(byte[] privateKeyBytes) |
public static boolean isNotNullOrEmpty(String val)
public static KeyManager[] keyManagers(byte[] certData, byte[] keyData, String algo, String passphrase, String keyStoreFile, String keyStorePassphrase) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, CertificateException, InvalidKeySpecException, IOException
public static KeyStore createKeyStore(byte[] clientCertData, byte[] clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String keyStoreFile, String keyStorePassphrase) throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException
public static byte[] dumpKey(PrivateKey privateKey) throws IOException
IOException
public static String recognizePrivateKeyAlgo(byte[] privateKeyBytes)
public static PrivateKey loadKey(byte[] privateKeyBytes) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
public static PrivateKey loadKey(byte[] pemPrivateKeyBytes, String algo) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
public static PrivateKey loadKey(InputStream keyInputStream, String clientKeyAlgo) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
public static KeyStore createKeyStore(InputStream certInputStream, InputStream keyInputStream, String clientKeyAlgo, char[] clientKeyPassphrase, String keyStoreFile, char[] keyStorePassphrase) throws IOException, CertificateException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException
public static RSAPrivateCrtKeySpec decodePKCS1(byte[] keyBytes) throws IOException
IOException
Copyright © 2022. All rights reserved.