public class MerkleTreeCertEntry
extends java.lang.Object
struct {
MerkleTreeCertEntryExtension extensions<0..2^16-1>;
MerkleTreeCertEntryType type;
select (type) {
case null_entry: Empty;
case tbs_cert_entry: opaque tbs_cert_entry_data[N];
}
} MerkleTreeCertEntry;
For tbs_cert_entry, the body is the DER contents octets
of a TBSCertificateLogEntry — that is, the SEQUENCE tag and length
octets are stripped. getTbsCertEntry() reattaches a DER SEQUENCE
wrapper and decodes it for callers who want the structured form.
MerkleTreeCertEntry is parsed in a length-framed context (the
caller knows how many bytes belong to it); the byte-array constructor
therefore consumes its full input.
| Constructor and Description |
|---|
MerkleTreeCertEntry(byte[] data)
Parses a
MerkleTreeCertEntry from its TLS wire encoding. |
MerkleTreeCertEntry(java.util.List<MerkleTreeCertEntryExtension> extensions,
int type,
byte[] body)
Constructs an entry from its component parts.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encode() |
byte[] |
getBody() |
java.util.List<MerkleTreeCertEntryExtension> |
getExtensions() |
org.bouncycastle.asn1.x509.TBSCertificateLogEntry |
getTbsCertEntry()
Reattaches a DER SEQUENCE wrapper to
getBody() and decodes the
result as a TBSCertificateLogEntry. |
int |
getType() |
public MerkleTreeCertEntry(java.util.List<MerkleTreeCertEntryExtension> extensions, int type, byte[] body)
extensions - ordered (ascending extension_type, no duplicates)type - a MerkleTreeCertEntryType value (uint16)body - the type-specific body bytes (empty for null_entry,
the tbs_cert_entry_data contents for tbs_cert_entry)public MerkleTreeCertEntry(byte[] data)
throws java.io.IOException
MerkleTreeCertEntry from its TLS wire encoding. The
input MUST contain exactly one entry; trailing bytes are rejected.java.io.IOExceptionpublic java.util.List<MerkleTreeCertEntryExtension> getExtensions()
public int getType()
public byte[] getBody()
null_entry,
the tbs_cert_entry_data contents (DER body of a
TBSCertificateLogEntry without its SEQUENCE wrapper) for
tbs_cert_entry, or the raw bytes for any future typepublic org.bouncycastle.asn1.x509.TBSCertificateLogEntry getTbsCertEntry()
throws java.io.IOException
getBody() and decodes the
result as a TBSCertificateLogEntry.java.lang.IllegalStateException - if getType() is not tbs_cert_entryjava.io.IOException - if the wrapped bytes do not decode as a TBSCertificateLogEntrypublic byte[] encode()
throws java.io.IOException
java.io.IOException - if a length constraint is violated