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 |
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(java.io.OutputStream output)
Deprecated.
|
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() |
int |
getLength() |
boolean |
isEmpty() |
static Certificate |
parse(TlsContext context,
java.io.InputStream input)
Deprecated.
|
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 TlsCertificate[] certificateList
public Certificate(TlsCertificate[] certificateList)
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(java.io.OutputStream output) throws java.io.IOException
Certificate
to an OutputStream
.output
- the OutputStream
to encode to.java.io.IOException
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.IOException
public static Certificate parse(TlsContext context, java.io.InputStream input) throws java.io.IOException
Certificate
from an InputStream
.context
- the TlsContext
of the current connection.input
- the InputStream
to parse from.Certificate
object.java.io.IOException
public 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.IOException
protected static void calculateEndPointHash(TlsContext context, TlsCertificate cert, byte[] encoding, java.io.OutputStream output) throws java.io.IOException
java.io.IOException
protected TlsCertificate[] cloneCertificateList()