public class Certificate
extends java.lang.Object
opaque ASN.1Cert<2^24-1>;
struct {
ASN.1Cert certificate_list<0..2^24-1>;
} Certificate;
Certificate| Modifier and Type | Class and Description |
|---|---|
static class |
Certificate.ParseOptions |
| Modifier and Type | Field and Description |
|---|---|
protected CertificateEntry[] |
certificateEntryList |
protected byte[] |
certificateRequestContext |
protected short |
certificateType |
static Certificate |
EMPTY_CHAIN |
static Certificate |
EMPTY_CHAIN_TLS13 |
| Constructor and Description |
|---|
Certificate(byte[] certificateRequestContext,
CertificateEntry[] certificateEntryList) |
Certificate(short certificateType,
byte[] certificateRequestContext,
CertificateEntry[] certificateEntryList) |
Certificate(TlsCertificate[] certificateList) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
calculateEndPointHash(TlsContext context,
TlsCertificate cert,
byte[] encoding,
java.io.OutputStream output) |
protected CertificateEntry[] |
cloneCertificateEntryList() |
protected TlsCertificate[] |
cloneCertificateList() |
void |
encode(TlsContext context,
java.io.OutputStream messageOutput,
java.io.OutputStream endPointHashOutput)
Encode this
Certificate to an OutputStream, and optionally calculate the
"end point hash" (per RFC 5929's tls-server-end-point binding). |
TlsCertificate |
getCertificateAt(int index) |
CertificateEntry |
getCertificateEntryAt(int index) |
CertificateEntry[] |
getCertificateEntryList() |
TlsCertificate[] |
getCertificateList() |
byte[] |
getCertificateRequestContext() |
short |
getCertificateType() |
int |
getLength() |
boolean |
isEmpty() |
static Certificate |
parse(Certificate.ParseOptions options,
TlsContext context,
java.io.InputStream messageInput,
java.io.OutputStream endPointHashOutput)
Parse a
Certificate from an InputStream. |
static Certificate |
parse(TlsContext context,
java.io.InputStream messageInput,
java.io.OutputStream endPointHashOutput)
Deprecated.
Use version taking a
Certificate.ParseOptions argument instead. |
public static final Certificate EMPTY_CHAIN
public static final Certificate EMPTY_CHAIN_TLS13
protected final byte[] certificateRequestContext
protected final CertificateEntry[] certificateEntryList
protected final short certificateType
public Certificate(TlsCertificate[] certificateList)
public Certificate(byte[] certificateRequestContext,
CertificateEntry[] certificateEntryList)
public Certificate(short certificateType,
byte[] certificateRequestContext,
CertificateEntry[] certificateEntryList)
public byte[] getCertificateRequestContext()
public TlsCertificate[] getCertificateList()
Certificate representing a certificate
chain.public TlsCertificate getCertificateAt(int index)
public CertificateEntry getCertificateEntryAt(int index)
public CertificateEntry[] getCertificateEntryList()
public short getCertificateType()
public int getLength()
public boolean isEmpty()
true if this certificate chain contains no certificates, or
false otherwise.public void encode(TlsContext context, java.io.OutputStream messageOutput, java.io.OutputStream endPointHashOutput) throws java.io.IOException
Certificate to an OutputStream, and optionally calculate the
"end point hash" (per RFC 5929's tls-server-end-point binding).messageOutput - the OutputStream to encode to.endPointHashOutput - the OutputStream to write the "end point hash" (or null).java.io.IOExceptionpublic static Certificate parse(TlsContext context, java.io.InputStream messageInput, java.io.OutputStream endPointHashOutput) throws java.io.IOException
Certificate.ParseOptions argument instead.Certificate from an InputStream.context - the TlsContext of the current connection.messageInput - the InputStream to parse from.endPointHashOutput - the OutputStream to write the "end point hash" (or null).Certificate object.java.io.IOExceptionpublic static Certificate parse(Certificate.ParseOptions options, TlsContext context, java.io.InputStream messageInput, java.io.OutputStream endPointHashOutput) throws java.io.IOException
Certificate from an InputStream.options - the Certificate.ParseOptions to apply during parsing.context - the TlsContext of the current connection.messageInput - the InputStream to parse from.endPointHashOutput - the OutputStream to write the "end point hash" (or null).Certificate object.java.io.IOExceptionprotected static void calculateEndPointHash(TlsContext context, TlsCertificate cert, byte[] encoding, java.io.OutputStream output) throws java.io.IOException
java.io.IOExceptionprotected TlsCertificate[] cloneCertificateList()
protected CertificateEntry[] cloneCertificateEntryList()