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 | Field and Description |
|---|---|
protected TlsCertificate[] |
certificateList |
protected byte[] |
certificateRequestContext |
static Certificate |
EMPTY_CHAIN |
| Constructor and Description |
|---|
Certificate(TlsCertificate[] certificateList) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
calculateEndPointHash(TlsContext context,
TlsCertificate cert,
byte[] encoding,
java.io.OutputStream output) |
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) |
TlsCertificate[] |
getCertificateList() |
byte[] |
getCertificateRequestContext() |
int |
getLength() |
boolean |
isEmpty() |
static Certificate |
parse(TlsContext context,
java.io.InputStream messageInput,
java.io.OutputStream endPointHashOutput)
Parse a
Certificate from an InputStream. |
public static final Certificate EMPTY_CHAIN
protected final byte[] certificateRequestContext
protected final TlsCertificate[] certificateList
public Certificate(TlsCertificate[] certificateList)
public byte[] getCertificateRequestContext()
public TlsCertificate[] getCertificateList()
Certificate representing a certificate
chain.public TlsCertificate getCertificateAt(int index)
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 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.IOExceptionprotected static void calculateEndPointHash(TlsContext context, TlsCertificate cert, byte[] encoding, java.io.OutputStream output) throws java.io.IOException
java.io.IOExceptionprotected TlsCertificate[] cloneCertificateList()