Class Publish.BuildMessage
- java.lang.Object
-
- org.magmacollective.darkcrystal.keybackup.messageschemas.Publish.BuildMessage
-
- Enclosing class:
- Publish
public static class Publish.BuildMessage extends java.lang.Object
Build Dark Crystal Key Backup messages using Protobuf
-
-
Constructor Summary
Constructors Constructor Description BuildMessage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
buildForward(byte[] recipient, byte[] rootId, byte[] shardData, byte[] branch)
Build a forward messagebyte[]
buildReply(byte[] recipient, byte[] rootId, byte[] shardData, byte[] branch)
Build a reply messagebyte[]
buildRequest(byte[] recipient, byte[] rootId)
Build a request message, without giving an ephemeral public keybyte[]
buildRequest(byte[] recipient, byte[] rootId, byte[] ephemeralPublicKey)
Build a request messagebyte[]
buildRoot(int quorum, int shards, java.lang.String name, byte[] tag)
Build a root messagebyte[]
buildShard(byte[] rootId, byte[] recipient, byte[] shardData)
Build a shard message
-
-
-
Method Detail
-
buildRoot
public byte[] buildRoot(int quorum, int shards, java.lang.String name, byte[] tag)
Build a root message- Parameters:
quorum
- the thresholdshards
- the number of shardsname
- a name for the secret (not visible to custodians)tag
- a random tag to make the hash unique- Returns:
- a root message as a byte array
-
buildShard
public byte[] buildShard(byte[] rootId, byte[] recipient, byte[] shardData)
Build a shard message- Parameters:
rootId
-recipient
-shardData
-- Returns:
- a shard message as a byte array
-
buildRequest
public byte[] buildRequest(byte[] recipient, byte[] rootId, byte[] ephemeralPublicKey)
Build a request message- Parameters:
recipient
-rootId
-ephemeralPublicKey
-- Returns:
-
buildRequest
public byte[] buildRequest(byte[] recipient, byte[] rootId)
Build a request message, without giving an ephemeral public key- Parameters:
recipient
-rootId
-- Returns:
- a request message as a byte array
-
buildReply
public byte[] buildReply(byte[] recipient, byte[] rootId, byte[] shardData, byte[] branch)
Build a reply message- Parameters:
recipient
-rootId
-shardData
-branch
-- Returns:
- a reply message as a byte array
-
buildForward
public byte[] buildForward(byte[] recipient, byte[] rootId, byte[] shardData, byte[] branch)
Build a forward message- Parameters:
recipient
-rootId
-shardData
-branch
-- Returns:
- a forward message as a byte array
-
-