Class SignerKey

java.lang.Object
org.stellar.sdk.xdr.SignerKey
All Implemented Interfaces:
XdrElement

public class SignerKey extends Object implements XdrElement
SignerKey's original definition in the XDR file is:
 union SignerKey switch (SignerKeyType type)
 {
 case SIGNER_KEY_TYPE_ED25519:
     uint256 ed25519;
 case SIGNER_KEY_TYPE_PRE_AUTH_TX:
     /* SHA-256 Hash of TransactionSignaturePayload structure */
     uint256 preAuthTx;
 case SIGNER_KEY_TYPE_HASH_X:
     /* Hash of random 256 bit preimage X */
     uint256 hashX;
 case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD:
     struct
     {
         /* Public key that must sign the payload. */
         uint256 ed25519;
         /* Payload to be raw signed by ed25519. */
         opaque payload<64>;
     } ed25519SignedPayload;
 };
 
  • Constructor Details

    • SignerKey

      public SignerKey()
    • SignerKey

      public SignerKey(SignerKeyType discriminant, Uint256 ed25519, Uint256 preAuthTx, Uint256 hashX, SignerKey.SignerKeyEd25519SignedPayload ed25519SignedPayload)
      Creates a new SignerKey instance.
      Parameters:
      discriminant - the discriminant field value
      ed25519 - the ed25519 field value
      preAuthTx - the preAuthTx field value
      hashX - the hashX field value
      ed25519SignedPayload - the ed25519SignedPayload field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static SignerKey decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static SignerKey decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static SignerKey fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static SignerKey fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static SignerKey fromJson(String json)
    • builder

      public static SignerKey.SignerKeyBuilder builder()
    • toBuilder

      public SignerKey.SignerKeyBuilder toBuilder()
    • getDiscriminant

      public SignerKeyType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getEd25519

      public Uint256 getEd25519()
      Value of the ed25519 field.
      Returns:
      the ed25519 field value
    • getPreAuthTx

      public Uint256 getPreAuthTx()
      Value of the preAuthTx field.
      Returns:
      the preAuthTx field value
    • getHashX

      public Uint256 getHashX()
      Value of the hashX field.
      Returns:
      the hashX field value
    • getEd25519SignedPayload

      public SignerKey.SignerKeyEd25519SignedPayload getEd25519SignedPayload()
      Value of the ed25519SignedPayload field.
      Returns:
      the ed25519SignedPayload field value
    • setDiscriminant

      public void setDiscriminant(SignerKeyType discriminant)
      Value of the discriminant field.
      Parameters:
      discriminant - the discriminant field value
    • setEd25519

      public void setEd25519(Uint256 ed25519)
      Value of the ed25519 field.
      Parameters:
      ed25519 - the ed25519 field value
    • setPreAuthTx

      public void setPreAuthTx(Uint256 preAuthTx)
      Value of the preAuthTx field.
      Parameters:
      preAuthTx - the preAuthTx field value
    • setHashX

      public void setHashX(Uint256 hashX)
      Value of the hashX field.
      Parameters:
      hashX - the hashX field value
    • setEd25519SignedPayload

      public void setEd25519SignedPayload(SignerKey.SignerKeyEd25519SignedPayload ed25519SignedPayload)
      Value of the ed25519SignedPayload field.
      Parameters:
      ed25519SignedPayload - the ed25519SignedPayload field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object