Package org.bouncycastle.cert.plants
Class MTCCosignedMessage
- java.lang.Object
-
- org.bouncycastle.cert.plants.MTCCosignedMessage
-
public final class MTCCosignedMessage extends java.lang.ObjectWire 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_nameandlog_originare 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:
MTCSignatureVerifier,MTCCosignerVerifier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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[]encode(MTCLog log, byte[] subtreeHash, byte[] cosignerId)Equivalent toencode(byte[], long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog.static byte[]encode(MTCLog log, long timestamp, byte[] subtreeHash, byte[] cosignerId)Equivalent toencode(byte[], long, long, long, byte[], byte[])taking the log ID and subtree window from anMTCLog.
-
-
-
Method Detail
-
encode
public static byte[] encode(byte[] logId, long start, long end, byte[] subtreeHash, byte[] cosignerId) throws java.io.IOExceptionEquivalent 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:
java.io.IOException
-
encode
public static byte[] encode(MTCLog log, byte[] subtreeHash, byte[] cosignerId) throws java.io.IOException
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:
java.io.IOException
-
encode
public static byte[] encode(MTCLog log, long timestamp, byte[] subtreeHash, byte[] cosignerId) throws java.io.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:
java.io.IOException
-
encode
public static byte[] encode(byte[] logId, long timestamp, long start, long end, byte[] subtreeHash, byte[] cosignerId) throws java.io.IOExceptionEncodes 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:
java.io.IOException
-
-