public class LedgerValidationRequest extends AbstractRequest
Constructor and Description |
---|
LedgerValidationRequest(java.lang.String assetId,
int startAge,
int endAge,
java.lang.String entityId,
int keyVersion,
byte[] signature)
Constructs a
LedgerValidationRequest with the specified asset id, entity ID, key
version, signature of the request, and client-side proof. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this object.
|
java.lang.String |
getAssetId()
Returns the id of the asset.
|
int |
getEndAge()
Returns the age of the asset to be validated to.
|
byte[] |
getSignature()
Returns the signature of the request.
|
int |
getStartAge()
Returns the age of the asset to be validated from.
|
int |
hashCode()
Returns a hash code value for the object.
|
static byte[] |
serialize(java.lang.String assetId,
int startAge,
int endAge,
java.lang.String entityId,
int keyVersion) |
void |
validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
Validates if the request is not tampered.
|
getEntityId, getKeyVersion
public LedgerValidationRequest(java.lang.String assetId, int startAge, int endAge, java.lang.String entityId, int keyVersion, byte[] signature)
LedgerValidationRequest
with the specified asset id, entity ID, key
version, signature of the request, and client-side proof.assetId
- an id of an assetstartAge
- an age to be validated fromendAge
- an age to be validated toentityId
- an entity IDkeyVersion
- the version of a digital signature certificate or a HMAC secret key.signature
- a signature of the requestpublic java.lang.String getAssetId()
public int getStartAge()
public int getEndAge()
public byte[] getSignature()
public int hashCode()
hashCode
in class AbstractRequest
public boolean equals(java.lang.Object o)
LedgerValidationRequest
and
equals
in class AbstractRequest
o
- an object to be tested for equalitytrue
if the other object is "equal to" this object otherwise false
public void validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
validateWith
in class AbstractRequest
validator
- a SignatureValidator
com.scalar.dl.ledger.exception.SignatureException
- if the request is invalid.public static byte[] serialize(java.lang.String assetId, int startAge, int endAge, java.lang.String entityId, int keyVersion)