Interface TransactionMessage
-
public interface TransactionMessage
An Exonum transaction message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TransactionMessage.Builder
Builder for the binary transaction message.
-
Field Summary
Fields Modifier and Type Field Description static int
AUTHOR_PUBLIC_KEY_OFFSET
static int
AUTHOR_PUBLIC_KEY_SIZE
static int
CLS_OFFSET
static int
MIN_MESSAGE_SIZE
static int
PAYLOAD_OFFSET
static int
SERVICE_ID_OFFSET
static int
SIGNATURE_SIZE
static int
TAG_OFFSET
static int
TRANSACTION_ID_OFFSET
-
Method Summary
Modifier and Type Method Description static TransactionMessage.Builder
builder()
Creates a new builder for the transaction message.static TransactionMessage
fromBuffer(ByteBuffer buffer)
Creates the transaction message from the given bytes buffer.static TransactionMessage
fromBytes(byte[] bytes)
Creates the transaction message from the given bytes array.PublicKey
getAuthor()
Returns a public key of the author of the transaction message.byte[]
getPayload()
Returns the payload containing the serialized transaction parameters.short
getServiceId()
Returns the identifier of the service this message belongs to.byte[]
getSignature()
Returns the Ed25519 signature over this binary message.short
getTransactionId()
Returns the transaction type identifier which is unique within the service.HashCode
hash()
Returns the SHA-256 hash of the binary message representation.int
size()
Returns the transaction message size in bytes.byte[]
toBytes()
Returns the transaction message in binary format.
-
-
-
Field Detail
-
AUTHOR_PUBLIC_KEY_OFFSET
static final int AUTHOR_PUBLIC_KEY_OFFSET
- See Also:
- Constant Field Values
-
CLS_OFFSET
static final int CLS_OFFSET
- See Also:
- Constant Field Values
-
TAG_OFFSET
static final int TAG_OFFSET
- See Also:
- Constant Field Values
-
SERVICE_ID_OFFSET
static final int SERVICE_ID_OFFSET
- See Also:
- Constant Field Values
-
TRANSACTION_ID_OFFSET
static final int TRANSACTION_ID_OFFSET
- See Also:
- Constant Field Values
-
PAYLOAD_OFFSET
static final int PAYLOAD_OFFSET
- See Also:
- Constant Field Values
-
AUTHOR_PUBLIC_KEY_SIZE
static final int AUTHOR_PUBLIC_KEY_SIZE
- See Also:
- Constant Field Values
-
SIGNATURE_SIZE
static final int SIGNATURE_SIZE
- See Also:
- Constant Field Values
-
MIN_MESSAGE_SIZE
static final int MIN_MESSAGE_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAuthor
PublicKey getAuthor()
Returns a public key of the author of the transaction message.
-
getServiceId
short getServiceId()
Returns the identifier of the service this message belongs to.
-
getTransactionId
short getTransactionId()
Returns the transaction type identifier which is unique within the service.
-
getPayload
byte[] getPayload()
Returns the payload containing the serialized transaction parameters.
-
hash
HashCode hash()
Returns the SHA-256 hash of the binary message representation.
-
getSignature
byte[] getSignature()
Returns the Ed25519 signature over this binary message.The signature is not guaranteed to be valid and must be verified against the signer’s public key.
- See Also:
CryptoFunctions.ed25519()
-
toBytes
byte[] toBytes()
Returns the transaction message in binary format.
-
size
int size()
Returns the transaction message size in bytes.
-
builder
static TransactionMessage.Builder builder()
Creates a new builder for the transaction message.
-
fromBytes
static TransactionMessage fromBytes(byte[] bytes)
Creates the transaction message from the given bytes array.
-
fromBuffer
static TransactionMessage fromBuffer(ByteBuffer buffer)
Creates the transaction message from the given bytes buffer.
-
-