public class SignedCertificateTimestamp
extends java.lang.Object
SignedCertificateTimestampList.
enum { v1(0), (255) } Version;
struct {
opaque key_id[32];
} LogID;
opaque CtExtensions<0..2^16-1>;
struct {
Version sct_version;
LogID id;
uint64 timestamp;
CtExtensions extensions;
digitally-signed struct {
Version sct_version;
SignatureType signature_type = certificate_timestamp;
uint64 timestamp;
LogEntryType entry_type;
select(entry_type) {
case x509_entry: ASN.1Cert;
case precert_entry: PreCert;
} signed_entry;
CtExtensions extensions;
};
} SignedCertificateTimestamp;
The digitally-signed value is the TLS 1.2 sec. 4.7 form: a one-byte
HashAlgorithm and a one-byte SignatureAlgorithm followed by a
two-byte-length-prefixed opaque signature. This class exposes the
algorithm pair and the raw signature bytes; computing the signed leaf
structure and verifying it against a log's public key is a higher-level
concern handled outside this decode-only API.
For RFC 9162 (CT v2), see SignedCertificateTimestampDataV2.
| Modifier and Type | Field and Description |
|---|---|
static int |
LOG_ID_LENGTH |
static int |
VERSION_V1 |
| Constructor and Description |
|---|
SignedCertificateTimestamp(int sctVersion,
byte[] logID,
long timestamp,
byte[] extensions,
int hashAlgorithm,
int signatureAlgorithm,
byte[] signature) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getEncoded()
Serialize this SCT to its TLS wire form (the bytes that would be
carried as one
SerializedSCT entry in a list). |
byte[] |
getExtensions()
The
extensions opaque blob carried in the SCT. |
int |
getHashAlgorithm()
TLS HashAlgorithm byte (sha256 = 4, etc.).
|
static SignedCertificateTimestamp |
getInstance(byte[] encoded)
Decode an SCT from its serialized TLS form (the bytes that appear as
one
SerializedSCT entry inside a
SignedCertificateTimestampList). |
byte[] |
getLogID()
32-byte log identifier (SHA-256 of the log's DER-encoded public key).
|
int |
getSctVersion()
SCT version byte.
|
byte[] |
getSignature()
Raw signature bytes (the opaque signature field from the digitally-signed struct).
|
int |
getSignatureAlgorithm()
TLS SignatureAlgorithm byte (rsa = 1, dsa = 2, ecdsa = 3).
|
long |
getTimestamp()
Issuance timestamp in milliseconds since the Unix epoch (Java
convention; the same value the wire form uses).
|
public static final int LOG_ID_LENGTH
public static final int VERSION_V1
public SignedCertificateTimestamp(int sctVersion,
byte[] logID,
long timestamp,
byte[] extensions,
int hashAlgorithm,
int signatureAlgorithm,
byte[] signature)
public static SignedCertificateTimestamp getInstance(byte[] encoded)
SerializedSCT entry inside a
SignedCertificateTimestampList).public int getSctVersion()
public byte[] getLogID()
public long getTimestamp()
public byte[] getExtensions()
extensions opaque blob carried in the SCT. RFC 6962 leaves
the contents unspecified; logs in the wild emit it empty.public int getHashAlgorithm()
public int getSignatureAlgorithm()
public byte[] getSignature()
public byte[] getEncoded()
SerializedSCT entry in a list).