public class WriteRequest extends Object
| Modifier and Type | Field and Description |
|---|---|
byte[] |
dataEnc |
byte[] |
extraData |
WriteRequestId |
id |
byte[] |
keyMaterial |
Darc |
owner |
| Constructor and Description |
|---|
WriteRequest(byte[] dataEnc,
byte[] keyMaterial,
Darc owner,
byte[] extraData)
Create a new document by giving all possible parameters.
|
WriteRequest(byte[] data,
int keylen,
Darc owner)
Creates a new document from data, creates a new Darc, a symmetric
symmetricKey and encrypts the data using CBC-RSA.
|
WriteRequest(String data,
int keylen,
Darc owner)
Overloaded constructor for WriteRequest, but taking a string rather than
an array of bytes.
|
WriteRequest(WriteRequest wr)
Creates a new document - copies from an existing.
|
| Modifier and Type | Method and Description |
|---|---|
DarcSignature |
getSignature(OnchainSecretsRPC ocs,
Signer publisher)
Creates a correct signature-path starting from the admin darc and
signs that path to get a correct write-request.
|
OCSProto.Write |
toProto(Point X,
SkipblockId scid)
Returns a protobuf-formatted block that can be sent to the cothority
for storage on the skipchain.
|
public byte[] dataEnc
public byte[] keyMaterial
public Darc owner
public byte[] extraData
public WriteRequestId id
public WriteRequest(WriteRequest wr)
wr - - an existing document.public WriteRequest(byte[] data,
int keylen,
Darc owner)
throws CothorityCryptoException
data - - any data that will be stored encrypted on the skipchain.
There is a 10MB-limit on how much data can be stored. If you
need more, this must be a pointer to an off-chain storage.keylen - - how long the symmetric symmetricKey should be, in bytes. 16 bytes
should be a safe guess for the moment.CothorityCryptoException - in the case the encryption doesn't workpublic WriteRequest(String data, int keylen, Darc owner) throws CothorityCryptoException
data - - data for the document, will be encryptedkeylen - - keylength - 16 is a good start.CothorityCryptoExceptionpublic WriteRequest(byte[] dataEnc,
byte[] keyMaterial,
Darc owner,
byte[] extraData)
dataEnc - the already encrypted datakeyMaterial - the symmetric symmetricKey plus eventually an IV. This
will be encrypted under the shared symmetricKey of the
cothorityowner - the owner is allowed to give access to the documentextraData - data that will _not be encrypted_ but will be
visible in cleartext on the skipchainpublic OCSProto.Write toProto(Point X, SkipblockId scid) throws CothorityCommunicationException
X - - the public symmetricKey of the ocs-shardscid - - the id of the skipchainCothorityCommunicationExceptionpublic DarcSignature getSignature(OnchainSecretsRPC ocs, Signer publisher) throws CothorityCryptoException, CothorityCommunicationException
ocs - OnchainSecretsRPC class to request the pathpublisher - allowed to sign for write requestsCothorityCryptoExceptionCothorityCommunicationExceptionCopyright © 2018. All rights reserved.