Package org.stellar.sdk.xdr
Class SignerKey
java.lang.Object
org.stellar.sdk.xdr.SignerKey
- All Implemented Interfaces:
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;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classSignerKeyEd25519SignedPayload's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionSignerKey(SignerKeyType discriminant, Uint256 ed25519, Uint256 preAuthTx, Uint256 hashX, SignerKey.SignerKeyEd25519SignedPayload ed25519SignedPayload) Creates a newSignerKeyinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic SignerKey.SignerKeyBuilderbuilder()static SignerKeydecode(XdrDataInputStream stream) static SignerKeydecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic SignerKeystatic SignerKeyfromXdrBase64(String xdr) static SignerKeyfromXdrByteArray(byte[] xdr) Value of thediscriminantfield.Value of theed25519field.Value of theed25519SignedPayloadfield.getHashX()Value of thehashXfield.Value of thepreAuthTxfield.inthashCode()voidsetDiscriminant(SignerKeyType discriminant) Value of thediscriminantfield.voidsetEd25519(Uint256 ed25519) Value of theed25519field.voidsetEd25519SignedPayload(SignerKey.SignerKeyEd25519SignedPayload ed25519SignedPayload) Value of theed25519SignedPayloadfield.voidValue of thehashXfield.voidsetPreAuthTx(Uint256 preAuthTx) Value of thepreAuthTxfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
SignerKey
public SignerKey() -
SignerKey
public SignerKey(SignerKeyType discriminant, Uint256 ed25519, Uint256 preAuthTx, Uint256 hashX, SignerKey.SignerKeyEd25519SignedPayload ed25519SignedPayload) Creates a newSignerKeyinstance.- Parameters:
discriminant- thediscriminantfield valueed25519- theed25519field valuepreAuthTx- thepreAuthTxfield valuehashX- thehashXfield valueed25519SignedPayload- theed25519SignedPayloadfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getEd25519
Value of theed25519field.- Returns:
- the
ed25519field value
-
getPreAuthTx
Value of thepreAuthTxfield.- Returns:
- the
preAuthTxfield value
-
getHashX
Value of thehashXfield.- Returns:
- the
hashXfield value
-
getEd25519SignedPayload
Value of theed25519SignedPayloadfield.- Returns:
- the
ed25519SignedPayloadfield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setEd25519
Value of theed25519field.- Parameters:
ed25519- theed25519field value
-
setPreAuthTx
Value of thepreAuthTxfield.- Parameters:
preAuthTx- thepreAuthTxfield value
-
setHashX
Value of thehashXfield.- Parameters:
hashX- thehashXfield value
-
setEd25519SignedPayload
Value of theed25519SignedPayloadfield.- Parameters:
ed25519SignedPayload- theed25519SignedPayloadfield value
-
equals
-
hashCode
public int hashCode() -
toString
-