public class CertificateHandlerFactory
extends java.lang.Object
The only type of certificate handler supported is X509.
Modifier | Constructor and Description |
---|---|
protected |
CertificateHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
CertificateHandler |
generateHandler(byte[] bytes)
Create a CertificateHandler instance from the specified bytes.
|
CertificateHandler |
generateHandler(java.security.cert.Certificate c)
Create a CertificateHandler instance from a pre-existing Certificate.
|
CertificateHandler |
generateHandler(java.io.InputStream i)
Create a CertificateHandler instance from the supplied inputstream.
|
static CertificateHandlerFactory |
getInstance()
Get a factory for handling X509 certificates.
|
public static CertificateHandlerFactory getInstance()
public CertificateHandler generateHandler(byte[] bytes) throws java.security.cert.CertificateException, java.io.IOException
The byte array is expected to contain the certificate in either DER format or PEM format. The contents of the byte array is expected to only contain a single certificate.
bytes
- the bytes representing the certificatejava.security.cert.CertificateException
- if the certificate could not be parsedjava.io.IOException
- if there was an IO errorCertificateHandler
public CertificateHandler generateHandler(java.security.cert.Certificate c) throws java.security.cert.CertificateException, java.io.IOException
c
- the Certificatejava.security.cert.CertificateException
- if the certificate could not be parsedjava.io.IOException
- if there was an IO errorCertificateHandler
public final CertificateHandler generateHandler(java.io.InputStream i) throws java.security.cert.CertificateException, java.io.IOException
The inputstream is expected to contain the certificate in either DER format or PEM format. The contents of the inputstream is expected to only contain a single certificate.
i
- the inputstream containing the certificatejava.security.cert.CertificateException
- if the certificate could not be parsedjava.io.IOException
- if there was an IO errorCertificateHandler