public class CertificateReader extends Object
CertificateReader is a utility class for reading certificates.| Modifier and Type | Field and Description |
|---|---|
static String |
BEGIN_CERTIFICATE_PREFIX
The Constant BEGIN_CERTIFICATE_PREFIX.
|
static String |
END_CERTIFICATE_SUFFIX
The Constant END_CERTIFICATE_SUFFIX.
|
| Constructor and Description |
|---|
CertificateReader() |
| Modifier and Type | Method and Description |
|---|---|
static X509Certificate |
readCertificate(byte[] decoded)
Reads the given byte array and tries to create a
X509Certificate object. |
static X509Certificate |
readCertificate(File file)
Reads the given file in *.der format and tries to create a
X509Certificate object. |
static X509Certificate |
readPemCertificate(File file)
Read pem certificate.
|
static String |
readPemFileAsBase64(File file)
Read the certificate from a pem file as base64 encoded
String value. |
public static final String BEGIN_CERTIFICATE_PREFIX
public static final String END_CERTIFICATE_SUFFIX
public static X509Certificate readPemCertificate(File file) throws Exception
file - the fileException - is thrown if if a security error occurpublic static String readPemFileAsBase64(File file) throws IOException
String value.file - the file in pem format that contains the public key.String value.IOException - Signals that an I/O exception has occurred.public static X509Certificate readCertificate(File file) throws CertificateException, IOException
X509Certificate object.file - the fileX509Certificate object from the given byte array.CertificateException - is thrown if no Provider supports a CertificateFactorySpi implementation for the
specified type.IOException - Signals that an I/O exception has occurred.public static X509Certificate readCertificate(byte[] decoded) throws CertificateException
X509Certificate object.decoded - the decodedX509Certificate object from the given byte array.CertificateException - is thrown if no Provider supports a CertificateFactorySpi implementation for the
specified type.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.