Class 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 message
      byte[] buildReply​(byte[] recipient, byte[] rootId, byte[] shardData, byte[] branch)
      Build a reply message
      byte[] buildRequest​(byte[] recipient, byte[] rootId)
      Build a request message, without giving an ephemeral public key
      byte[] buildRequest​(byte[] recipient, byte[] rootId, byte[] ephemeralPublicKey)
      Build a request message
      byte[] buildRoot​(int quorum, int shards, java.lang.String name, byte[] tag)
      Build a root message
      byte[] buildShard​(byte[] rootId, byte[] recipient, byte[] shardData)
      Build a shard message
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BuildMessage

        public BuildMessage()
    • Method Detail

      • buildRoot

        public byte[] buildRoot​(int quorum,
                                int shards,
                                java.lang.String name,
                                byte[] tag)
        Build a root message
        Parameters:
        quorum - the threshold
        shards - the number of shards
        name - 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