public class SslUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String[] |
DEFAULT_CIPHER_SUITES |
static String[] |
DEFAULT_TLSV13_CIPHER_SUITES |
static String[] |
TLSV13_CIPHER_SUITES |
| 限定符和类型 | 方法和说明 |
|---|---|
static KeyManagerFactory |
buildKeyManagerFactory(KeyStore keyStore,
char[] passwordChars,
KeyManagerFactory kmf) |
static TrustManagerFactory |
buildTrustManagerFactory(KeyStore keyStore,
TrustManagerFactory tmf) |
static void |
loadKeyStore(KeyStore keyStore,
InputStream jksInputStream,
char[] passwordChars)
Generates a new
KeyStore. |
static void |
loadKeyStore(KeyStore keyStore,
X509Certificate[] certChain,
PrivateKey key,
char[] passwordChars)
Generates a new
KeyStore. |
static PrivateKey |
toPrivateKey(InputStream pemInputStream,
String keyPassword)
Convert the private key defined in PEM file to
PrivateKey |
static X509Certificate[] |
toX509Certificates(InputStream cerInputStream)
Read the certificate chain in a CER file
|
public static final String[] DEFAULT_CIPHER_SUITES
public static final String[] DEFAULT_TLSV13_CIPHER_SUITES
public static final String[] TLSV13_CIPHER_SUITES
public static KeyManagerFactory buildKeyManagerFactory(KeyStore keyStore, char[] passwordChars, KeyManagerFactory kmf) throws GeneralSecurityException, IOException
public static TrustManagerFactory buildTrustManagerFactory(KeyStore keyStore, TrustManagerFactory tmf) throws GeneralSecurityException, IOException
public static void loadKeyStore(KeyStore keyStore, X509Certificate[] certChain, PrivateKey key, char[] passwordChars) throws GeneralSecurityException, IOException
KeyStore.certChain - a X.509 certificate chainkey - a PKCS#8 private keypasswordChars - the password of the keyFile. null if it's not password-protected.GeneralSecurityExceptionIOExceptionpublic static void loadKeyStore(KeyStore keyStore, InputStream jksInputStream, char[] passwordChars) throws GeneralSecurityException, IOException
KeyStore.jksInputStream - a JKS file InputStreampasswordChars - the password of the keyFile. null if it's not password-protected.GeneralSecurityExceptionIOExceptionpublic static X509Certificate[] toX509Certificates(InputStream cerInputStream) throws CertificateException
public static PrivateKey toPrivateKey(InputStream pemInputStream, String keyPassword) throws GeneralSecurityException, IOException
PrivateKeyCopyright © 2022–2024. All rights reserved.