Class MTCCosignedMessage
java.lang.Object
org.bouncycastle.cert.plants.MTCCosignedMessage
Wire encoder for the CosignedMessage struct defined by Section 5.3.1 of
draft-ietf-plants-merkle-tree-certs:
struct {
uint8 label[12] = "subtree/v1\n\0";
opaque cosigner_name<1..2^8-1>;
uint64 timestamp;
opaque log_origin<1..2^8-1>;
uint64 start;
uint64 end;
HashValue subtree_hash;
} CosignedMessage;
cosigner_name and log_origin are the ASCII strings
"oid/1.3.6.1.4.1." + <dotted-decimal trust anchor ID>, constructed
from the binary trust anchor IDs supplied by the caller.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]encode(byte[] logId, long start, long end, byte[] subtreeHash, byte[] cosignerId) Equivalent toencode(byte[], long, long, long, byte[], byte[])withtimestamp == 0, which is the only value permitted inside an MTCProof cosigner signature per Section 6.1 of the draft.static byte[]encode(byte[] logId, long timestamp, long start, long end, byte[] subtreeHash, byte[] cosignerId) Encodes a CosignedMessage in the wire format defined by Section 5.3.1.static byte[]Equivalent toencode(byte[], long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog.static byte[]Equivalent toencode(byte[], long, long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog.
-
Method Details
-
encode
public static byte[] encode(byte[] logId, long start, long end, byte[] subtreeHash, byte[] cosignerId) throws IOException Equivalent toencode(byte[], long, long, long, byte[], byte[])withtimestamp == 0, which is the only value permitted inside an MTCProof cosigner signature per Section 6.1 of the draft.- Throws:
IOException
-
encode
Equivalent toencode(byte[], long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog. Convenient for issuer-side code that already carries an MTCLog object.- Throws:
IOException
-
encode
public static byte[] encode(MTCLog log, long timestamp, byte[] subtreeHash, byte[] cosignerId) throws IOException Equivalent toencode(byte[], long, long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog. Use the non-MTCProof case where a non-zero timestamp is required.- Throws:
IOException
-
encode
public static byte[] encode(byte[] logId, long timestamp, long start, long end, byte[] subtreeHash, byte[] cosignerId) throws IOException Encodes a CosignedMessage in the wire format defined by Section 5.3.1.- Parameters:
logId- binary trust anchor ID of the logtimestamp- POSIX timestamp (zero inside an MTCProof; non-zero elsewhere)start- subtree start indexend- subtree end indexsubtreeHash- hash of the subtreecosignerId- binary trust anchor ID of the cosigner- Returns:
- the encoded CosignedMessage bytes
- Throws:
IOException
-