public class SSLCertificateHelper
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static java.nio.charset.Charset |
US_ASCII |
| 构造器和说明 |
|---|
SSLCertificateHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.security.PrivateKey |
exportDecryptedKey(java.security.KeyStore ks,
java.lang.String alias,
char[] password) |
static java.security.cert.X509Certificate[] |
exportRootCertificates(java.security.KeyStore ks,
java.lang.String alias) |
static java.security.cert.X509Certificate[] |
exportServerCertChain(java.security.KeyStore ks,
java.lang.String alias) |
static java.security.cert.X509Certificate |
generateCertificateFromDER(byte[] certBytes) |
protected static java.security.spec.PKCS8EncodedKeySpec |
generateKeySpec(char[] password,
byte[] key)
Generates a key specification for an (encrypted) private key.
|
public static java.security.cert.X509Certificate generateCertificateFromDER(byte[] certBytes)
throws java.security.cert.CertificateException
java.security.cert.CertificateExceptionprotected static java.security.spec.PKCS8EncodedKeySpec generateKeySpec(char[] password,
byte[] key)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.spec.InvalidKeySpecException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException
password - characters, if null an unencrypted key is assumedkey - bytes of the DER encoded private keyjava.io.IOException - if parsing key failsjava.security.NoSuchAlgorithmException - if the algorithm used to encrypt key is unknownjavax.crypto.NoSuchPaddingException - if the padding scheme specified in the decryption algorithm is unknownjava.security.spec.InvalidKeySpecException - if the decryption key based on password cannot be generatedjava.security.InvalidKeyException - if the decryption key based on password cannot be used to decrypt
keyjava.security.InvalidAlgorithmParameterException - if decryption algorithm parameters are somehow faultypublic static java.security.cert.X509Certificate[] exportRootCertificates(java.security.KeyStore ks,
java.lang.String alias)
throws java.security.KeyStoreException
java.security.KeyStoreExceptionpublic static java.security.cert.X509Certificate[] exportServerCertChain(java.security.KeyStore ks,
java.lang.String alias)
throws java.security.KeyStoreException
java.security.KeyStoreExceptionpublic static java.security.PrivateKey exportDecryptedKey(java.security.KeyStore ks,
java.lang.String alias,
char[] password)
throws java.security.KeyStoreException,
java.security.UnrecoverableKeyException,
java.security.NoSuchAlgorithmException
java.security.KeyStoreExceptionjava.security.UnrecoverableKeyExceptionjava.security.NoSuchAlgorithmException