public class Request extends Object
| Constructor and Description |
|---|
Request(DarcId baseId,
String action,
byte[] msg,
List<Identity> identities,
List<byte[]> signatures)
Constructor for the darc request.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
hash()
Computes the sha256 digest of the request, the message that it hashes does not include the signature part of the
request.
|
void |
setSignatures(List<byte[]> signatures)
The setter for signatures.
|
DarcProto.Request |
toProto()
Converts this object to the protobuf representation.
|
public Request(DarcId baseId, String action, byte[] msg, List<Identity> identities, List<byte[]> signatures)
baseId - The base ID of the darc, the service will verify using the latest darc for this base ID.action - The action of the request, it is typically one of the rules in the darc.msg - The message that the service will check, typically a hash of some payload that is not contained in
the request itself.identities - The identities of the signers.signatures - The signature of the signers. It is not essential to set these in the constructor, they can
always be set using the setter.public void setSignatures(List<byte[]> signatures)
signatures - These signatures must be on the digest of the request, i.e. output of the hash method.public DarcProto.Request toProto()
public byte[] hash()
Copyright © 2019. All rights reserved.