Class SignedCertificateTimestamp
java.lang.Object
org.bouncycastle.cert.ct.SignedCertificateTimestamp
A single Signed Certificate Timestamp (SCT) in the RFC 6962 (CT v1) wire
format. Decoded from the TLS-encoded payload of a
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSignedCertificateTimestamp(int sctVersion, byte[] logID, long timestamp, byte[] extensions, int hashAlgorithm, int signatureAlgorithm, byte[] signature) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Serialize this SCT to its TLS wire form (the bytes that would be carried as oneSerializedSCTentry in a list).byte[]Theextensionsopaque blob carried in the SCT.intTLS HashAlgorithm byte (sha256 = 4, etc.).static SignedCertificateTimestampgetInstance(byte[] encoded) Decode an SCT from its serialized TLS form (the bytes that appear as oneSerializedSCTentry inside aSignedCertificateTimestampList).byte[]getLogID()32-byte log identifier (SHA-256 of the log's DER-encoded public key).intSCT version byte.byte[]Raw signature bytes (the opaque signature field from the digitally-signed struct).intTLS SignatureAlgorithm byte (rsa = 1, dsa = 2, ecdsa = 3).longIssuance timestamp in milliseconds since the Unix epoch (Java convention; the same value the wire form uses).
-
Field Details
-
LOG_ID_LENGTH
public static final int LOG_ID_LENGTH- See Also:
-
VERSION_V1
public static final int VERSION_V1- See Also:
-
-
Constructor Details
-
SignedCertificateTimestamp
public SignedCertificateTimestamp(int sctVersion, byte[] logID, long timestamp, byte[] extensions, int hashAlgorithm, int signatureAlgorithm, byte[] signature)
-
-
Method Details
-
getInstance
Decode an SCT from its serialized TLS form (the bytes that appear as oneSerializedSCTentry inside aSignedCertificateTimestampList). -
getSctVersion
public int getSctVersion()SCT version byte. RFC 6962 defines only v1 (0). -
getLogID
public byte[] getLogID()32-byte log identifier (SHA-256 of the log's DER-encoded public key). -
getTimestamp
public long getTimestamp()Issuance timestamp in milliseconds since the Unix epoch (Java convention; the same value the wire form uses). -
getExtensions
public byte[] getExtensions()Theextensionsopaque blob carried in the SCT. RFC 6962 leaves the contents unspecified; logs in the wild emit it empty. -
getHashAlgorithm
public int getHashAlgorithm()TLS HashAlgorithm byte (sha256 = 4, etc.). -
getSignatureAlgorithm
public int getSignatureAlgorithm()TLS SignatureAlgorithm byte (rsa = 1, dsa = 2, ecdsa = 3). -
getSignature
public byte[] getSignature()Raw signature bytes (the opaque signature field from the digitally-signed struct). -
getEncoded
public byte[] getEncoded()Serialize this SCT to its TLS wire form (the bytes that would be carried as oneSerializedSCTentry in a list).
-