public class WriteData extends Object
- EncData - the encrypted data, should be smaller than 8MB - U, Ubar, E, F, Cs - the symmetric key used to encrypt the data, itself encrypted to the Long Term Secret key - ExtraData - plain text data that is stored as-is on the ledger - LTSID - the Long Term Secret ID used to encrypt the data
| Constructor and Description |
|---|
WriteData(CreateLTSReply lts,
byte[] dataEnc,
byte[] keyMaterial,
byte[] extraData,
DarcId publisher)
Create a new document by giving all possible parameters.
|
| Modifier and Type | Method and Description |
|---|---|
static WriteData |
fromByzcoin(ByzCoinRPC bc,
InstanceId id)
Recreates a WriteData from an instanceid.
|
static WriteData |
fromInstance(Instance inst)
Recreates a WriteData from an instance.
|
static WriteData |
fromProto(byte[] buf)
Takes a byte array as an input to parse into the protobuf representation of WriteData.
|
byte[] |
getDataEnc()
Get the encrypted data.
|
byte[] |
getExtraData()
Get the extra data.
|
Calypso.Write |
toProto() |
public WriteData(CreateLTSReply lts, byte[] dataEnc, byte[] keyMaterial, byte[] extraData, DarcId publisher) throws CothorityException
lts - Long Term Secret parametersdataEnc - The ciphertext which will be stored _as is_ on ByzCoin. There is a limit on the size of the
ciphertext which depends on the block size of ByzCoin. Typically the limit is slightly below
the block size because the block also contains other metadata. You can find the block size
using ChainConfigInstance.keyMaterial - The symmetric key plus eventually an IV. This will be encrypted under the shared symmetricKey
of the cothority.extraData - data that will _not be encrypted_ but will be visible in cleartext on ByzCoin.publisher - The darc with a rule for calypsoWrite and calypsoRead.CothorityException - if something went wrongpublic static WriteData fromByzcoin(ByzCoinRPC bc, InstanceId id) throws CothorityNotFoundException, CothorityCommunicationException, CothorityCryptoException
bc - a running Byzcoin serviceid - an instanceId of a WriteInstanceCothorityNotFoundException - if the requested instance cannot be foundCothorityCommunicationException - if something went wrong with the communicationCothorityCryptoException - if there is something wrong with the proofpublic static WriteData fromInstance(Instance inst) throws CothorityNotFoundException
inst - an instance representing a WriteDataCothorityNotFoundException - if the requested instance cannot be foundpublic byte[] getDataEnc()
public byte[] getExtraData()
public Calypso.Write toProto()
public static WriteData fromProto(byte[] buf) throws com.google.protobuf.InvalidProtocolBufferException
buf - the protobuf datacom.google.protobuf.InvalidProtocolBufferException - if the protobuf data is invalid.Copyright © 2019. All rights reserved.