Package org.bouncycastle.cert.ct
Class TransItem
- java.lang.Object
-
- org.bouncycastle.cert.ct.TransItem
-
public class TransItem extends java.lang.ObjectOne TLS-encoded item from an RFC 9162 (CT v2)TransItemList. The structure is a 2-byteVersionedTransTypefollowed by the type-specificdatapayload; this class retains the payload as opaque bytes and provides a typed decoder for the only payload kind the certificate-side decoder needs to interpret in practice:getSignedCertificateTimestampDataV2(). Other payload kinds (log entries, signed tree heads, consistency / inclusion proofs) are still recoverable throughgetRawData(); layering structured decoders on top is intentionally left to consumers that need them.enum { x509_entry_v2(0x0100), precert_entry_v2(0x0101), x509_sct_v2(0x0102), precert_sct_v2(0x0103), signed_tree_head_v2(0x0104), consistency_proof_v2(0x0105), inclusion_proof_v2(0x0106), reserved_rfc6962(0x0000..0x00FF), reserved_experimentaluse(0xE000..0xEFFF), reserved_privateuse(0xF000..0xFFFF), (0xFFFF) } VersionedTransType; struct { VersionedTransType versioned_type; select (versioned_type) { case x509_sct_v2: SignedCertificateTimestampDataV2; case precert_sct_v2: SignedCertificateTimestampDataV2; ... } data; } TransItem;
-
-
Field Summary
Fields Modifier and Type Field Description static intconsistency_proof_v2static intinclusion_proof_v2static intprecert_entry_v2static intprecert_sct_v2static intsigned_tree_head_v2static intx509_entry_v2static intx509_sct_v2
-
Constructor Summary
Constructors Constructor Description TransItem(int versionedType, byte[] data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getEncoded()Serialize this TransItem to its TLS wire form.static TransItemgetInstance(byte[] encoded)Decode a TransItem from its serialized form (the bytes that appear as oneSerializedTransItementry inside aTransItemList).byte[]getRawData()The rawdatapayload bytes — i.e. the SerializedTransItem minus the 2-byte versioned_type prefix.SignedCertificateTimestampDataV2getSignedCertificateTimestampDataV2()When this item is a v2 SCT (x509_sct_v2orprecert_sct_v2), return the decoded payload; otherwise returnnull.intgetVersionedType()
-
-
-
Field Detail
-
x509_entry_v2
public static final int x509_entry_v2
- See Also:
- Constant Field Values
-
precert_entry_v2
public static final int precert_entry_v2
- See Also:
- Constant Field Values
-
x509_sct_v2
public static final int x509_sct_v2
- See Also:
- Constant Field Values
-
precert_sct_v2
public static final int precert_sct_v2
- See Also:
- Constant Field Values
-
signed_tree_head_v2
public static final int signed_tree_head_v2
- See Also:
- Constant Field Values
-
consistency_proof_v2
public static final int consistency_proof_v2
- See Also:
- Constant Field Values
-
inclusion_proof_v2
public static final int inclusion_proof_v2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static TransItem getInstance(byte[] encoded)
Decode a TransItem from its serialized form (the bytes that appear as oneSerializedTransItementry inside aTransItemList).
-
getVersionedType
public int getVersionedType()
-
getRawData
public byte[] getRawData()
The rawdatapayload bytes — i.e. the SerializedTransItem minus the 2-byte versioned_type prefix. The caller is responsible for parsing them according togetVersionedType().
-
getSignedCertificateTimestampDataV2
public SignedCertificateTimestampDataV2 getSignedCertificateTimestampDataV2()
When this item is a v2 SCT (x509_sct_v2orprecert_sct_v2), return the decoded payload; otherwise returnnull.
-
getEncoded
public byte[] getEncoded()
Serialize this TransItem to its TLS wire form.
-
-