|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cafesoft.core.util.X509CertificateUtils
public class X509CertificateUtils
X509CertificateUtils provides various convenience utilities for
managing X509Certificate instances.
| Field Summary | |
|---|---|
static String |
PEM_BEGIN_CERTIFICATE_DELIMITER
The PEM string that indicates the beginning of a PEM-formatted certificate. |
static String |
PEM_END_CERTIFICATE_DELIMITER
The PEM string that indicates the end of a PEM-formatted certificate. |
| Constructor Summary | |
|---|---|
X509CertificateUtils()
|
|
| Method Summary | |
|---|---|
static X509Certificate[] |
decodeChainFromPEM(File pemFile)
Decode an X509Certificate chain from a PEM formatted File. |
static X509Certificate[] |
decodeChainFromPEM(InputStream is)
Decode an X509Certificate chain from a PEM formatted InputStream. |
static X509Certificate[] |
decodeChainFromPEM(String pemCert)
Decode an X509Certificate chain from a PEM formatted String. |
static X509Certificate |
decodeFromPEM(File pemFile)
Decode a single X509Certificate from a PEM formatted File. |
static X509Certificate |
decodeFromPEM(InputStream is)
Decode an X509Certificate from a PEM formatted InputStream. |
static X509Certificate |
decodeFromPEM(String pemCert)
Decode an X509Certificate from a PEM formatted String. |
static void |
encodeAsPEM(X509Certificate cert,
StringBuffer b)
Encode a single X509Certificate in PEM format and append to a StringBuffer. |
static void |
encodeChainAsPEM(X509Certificate[] certArray,
StringBuffer b)
Encode an X509Certificate chain in PEM format and append to a StringBuffer. |
static PKIXCertPathValidatorResult |
validate(X509Certificate[] chain,
X509Certificate caCert)
Validate an X509Certificate chain. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String PEM_BEGIN_CERTIFICATE_DELIMITER
public static String PEM_END_CERTIFICATE_DELIMITER
| Constructor Detail |
|---|
public X509CertificateUtils()
| Method Detail |
|---|
public static void encodeAsPEM(X509Certificate cert,
StringBuffer b)
throws CertificateEncodingException
cert - the X509Certificate instance.b - the StringBuffer.
CertificateEncodingException - if the certificate or
StringBuffer is null or and encoding error occurs.
public static X509Certificate decodeFromPEM(String pemCert)
throws CertificateException
pemCert - the PEM-formatted X509Certificate chain.
CertificateException - if unable to decode the certificate
chain.
public static X509Certificate decodeFromPEM(File pemFile)
throws CertificateException
pemFile - the File containing the PEM-formatted X509Certificate.
CertificateException - if unable to decode the certificate.
public static X509Certificate decodeFromPEM(InputStream is)
throws CertificateException
is - the PEM-formatted X509Certificate InputStream.
CertificateException - if unable to decode the certificate
from the InputStream.
public static void encodeChainAsPEM(X509Certificate[] certArray,
StringBuffer b)
throws CertificateEncodingException
certArray - the X509Certificate chain.b - the StringBuffer.
CertificateEncodingException - if the certificate or
StringBuffer is null or and encoding error occurs.
public static X509Certificate[] decodeChainFromPEM(String pemCert)
throws CertificateException
pemCert - the PEM-formatted X509Certificate chain.
CertificateException - if unable to decode the certificate
chain.
public static X509Certificate[] decodeChainFromPEM(InputStream is)
throws CertificateException
is - the InputStream containing the PEM-formatted
X509Certificate chain.
CertificateException - if unable to decode the certificate
chain.
public static X509Certificate[] decodeChainFromPEM(File pemFile)
throws CertificateException
pemFile - the File containing the PEM-formatted X509Certificate
chain.
CertificateException - if unable to decode the certificate
chain.
public static PKIXCertPathValidatorResult validate(X509Certificate[] chain,
X509Certificate caCert)
throws CertPathValidatorException,
CertificateException,
NoSuchAlgorithmException,
InvalidAlgorithmParameterException
chain - the X509Certificate chain to be validated.caCert - the trusted Certificate Authority X509 certificate.
CertificatePathValidatorException - if the X509Certificate chain
is invalid.
CertificateException - if a CertificateFactory is not available
for X509 certificates in the default cryptography package.
NoSuchAlgorithmException - if the PKIX certificate path
algorithm is not available in the default cryptography provider package
or any of the other provider packages that were searched
InvalidAlgorithmException - if the X509 certificate chain is
not compatible with the PKIX certificate path validator.
CertPathValidatorException
InvalidAlgorithmParameterExceptionX509Certificate,
CertPathValidator,
PKIXCertPathValidatorResult
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||