public class Document extends Object
| Constructor and Description |
|---|
Document(byte[] dataEncrypted,
byte[] keyMaterial,
byte[] dataPublic,
Darc readers)
Initialises a document.
|
Document(byte[] dataEncrypted,
byte[] keyMaterial,
byte[] dataPublic,
Darc readers,
WriteRequestId writeRequestId)
Initialises a document.
|
Document(byte[] data,
int keylen,
Darc readers)
Convenience method without the public data.
|
Document(byte[] data,
int keylen,
Darc readers,
byte[] dataPublic)
Creates a new document from data, creates a new Darc, a symmetric
symmetricKey and encrypts the data using CBC-RSA.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Compares this document with another document.
|
byte[] |
getDataEncrypted() |
byte[] |
getDataPublic() |
byte[] |
getKeyMaterial() |
Darc |
getReaders() |
WriteRequest |
getWriteRequest() |
WriteRequestId |
getWriteRequestId() |
String |
toString() |
public Document(byte[] dataEncrypted,
byte[] keyMaterial,
byte[] dataPublic,
Darc readers,
WriteRequestId writeRequestId)
dataEncrypted - the encrypted data of the documentkeyMaterial - key-material necessary for the unencryption of the document.
This will be encrypted before the transmission to the skipchain.dataPublic - any public data that will be stored unencrypted on the skipchain.readers - the readers allowed to create a read-request on this document.writeRequestId - the writeRequest, if this represents a document already on
the skipchain.public Document(byte[] dataEncrypted,
byte[] keyMaterial,
byte[] dataPublic,
Darc readers)
dataEncrypted - the encrypted data of the documentkeyMaterial - key-material necessary for the unencryption of the document.
This will be encrypted before the transmission to the skipchain.dataPublic - any public data that will be stored unencrypted on the skipchain.readers - the readers allowed to create a read-request on this document.public Document(byte[] data,
int keylen,
Darc readers,
byte[] dataPublic)
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.dataPublic - any public data that will not be encryptedCothorityCryptoException - in the case the encryption doesn't workpublic Document(byte[] data,
int keylen,
Darc readers)
throws CothorityCryptoException
data - keylen - readers - CothorityCryptoExceptionpublic boolean equals(Object other)
public WriteRequest getWriteRequest()
public byte[] getDataEncrypted()
public byte[] getKeyMaterial()
public byte[] getDataPublic()
public WriteRequestId getWriteRequestId()
public Darc getReaders()
Copyright © 2018. All rights reserved.