public class OnchainSecrets extends OnchainSecretsRPC
adminDarc, ocsID, roster, X| Constructor and Description |
|---|
OnchainSecrets(Roster roster,
Darc admin)
Creates a new OnchainSecrets class and creates a new skipchain.
|
OnchainSecrets(Roster roster,
SkipblockId ocsID)
Creates a new OnchainSecrets class that attaches to an existing skipchain.
|
| Modifier and Type | Method and Description |
|---|---|
Darc |
addIdentityToDarc(Darc darc,
Identity identity,
Signer signer,
int role)
Adds a new identity to an existing darc under the given role.
|
Darc |
addIdentityToDarc(DarcId id,
Signer identity,
Signer signer,
int role)
Instead of giving a darc, this method will search for an existing darc given its id on the
skipchain.
|
Darc |
addIdentityToDarc(Darc darc,
Signer identity,
Signer signer,
int role)
Overloaded method for convenience in case the identity is only available as a signer.
|
SignaturePath |
getDarcPath(DarcId base,
Signer identity,
int role)
Convenience method to pass a signer as identity and get the darc-path used in signatures.
|
Document |
getDocument(WriteRequestId wrId,
Signer reader)
Creates a read-request, if successful fetches the document from the skipchain and decodes the
keymaterial.
|
Document |
getDocumentEphemeral(WriteRequestId wrId,
Signer reader)
Requests the re-encryption symmetricKey from the skipchain, but uses an ephemeral key
for it.
|
WriteRequest |
publishDocument(Document doc,
Signer writer)
Publishes a document given the Document and the writer with write-authorization.
|
Darc |
removeIdentityFromDarc(Darc darc,
Identity identity,
Signer signer,
int role)
Remove identity from an existing darc under the given role.
|
createReadRequest, createSkipchains, createWriteRequest, getAdminDarc, getDarcPath, getDecryptionKey, getDecryptionKeyEphemeral, getGenesis, getID, getLatestDarc, getRead, getRoster, getSharedPublicKey, getSkipblock, getTransaction, getWrite, getX, updateDarc, verifypublic OnchainSecrets(Roster roster, SkipblockId ocsID) throws CothorityCommunicationException, CothorityCryptoException
roster - ocsID - CothorityCommunicationExceptionCothorityCryptoExceptionpublic OnchainSecrets(Roster roster, Darc admin) throws CothorityCommunicationException, CothorityCryptoException
roster - admin - CothorityCommunicationExceptionCothorityCryptoExceptionpublic SignaturePath getDarcPath(DarcId base, Signer identity, int role) throws CothorityCommunicationException, CothorityCryptoException
base - the darc that should be taken as reference to build the darc path.identity - which identity wants to sign using that darc. The search algorithm does
a breadth-first search of this identity in the darc.role - the role to search for. An identity might be stored as user AND as an owner,
so we cannot rely on the first occurrence but need to indicate which role the
identity should have.CothorityCommunicationExceptionCothorityCryptoExceptionpublic Darc addIdentityToDarc(Darc darc, Identity identity, Signer signer, int role) throws CothorityCommunicationException, CothorityCryptoException
darc - the latest version of the darc where an identity should be added to.identity - the identity to be added to the darc.signer - must be an owner of the darc.role - the role the new identity should have in the darc.CothorityCommunicationException - if the new darc could not be stored on the skipchainCothorityCryptoException - if the signer could not sign the darc.public Darc addIdentityToDarc(Darc darc, Signer identity, Signer signer, int role) throws CothorityCommunicationException, CothorityCryptoException
darc - the latest version of the darc where an identity should be added to.identity - the identity to be added to the darc.signer - must be an owner of the darc.role - the role the new identity should have in the darc.CothorityCommunicationException - if the new darc could not be stored on the skipchainCothorityCryptoException - if the signer could not sign the darc.public Darc addIdentityToDarc(DarcId id, Signer identity, Signer signer, int role) throws CothorityCommunicationException, CothorityCryptoException
id - the id of the latest version of the darc where an identity should be added to.identity - the identity to be added to the darc.signer - must be an owner of the darc.role - the role the new identity should have in the darc.CothorityCommunicationException - if the new darc could not be stored on the skipchainCothorityCryptoException - if the signer could not sign the darc.public WriteRequest publishDocument(Document doc, Signer writer) throws CothorityCryptoException, CothorityCommunicationException
doc - a prepared document to be stored on the skipchainwriter - one of the authorized writers to the skipchainCothorityCryptoException - if the writer could not sign the requestCothorityCommunicationException - if the request could not be stored on the skipchainpublic Document getDocument(WriteRequestId wrId, Signer reader) throws CothorityCryptoException, CothorityCommunicationException
wrId - the id of the writerequest on the skipchainreader - a reader with access to the documentCothorityCryptoException - if the signer could not sign the requestCothorityCommunicationException - if the request could not be stored on the skipchainpublic Document getDocumentEphemeral(WriteRequestId wrId, Signer reader) throws CothorityCommunicationException, CothorityCryptoException
wrId - the id of the write requestCothorityCommunicationException - in case of communication difficultiesCothorityCryptoExceptionpublic Darc removeIdentityFromDarc(Darc darc, Identity identity, Signer signer, int role) throws CothorityCommunicationException, CothorityCryptoException
darc - the latest version of the darc where an identity should be added to.identity - the identity to be removed from the darc.signer - must be an owner of the darc.role - the role the new identity should have in the darc.CothorityCommunicationException - if the new darc could not be stored on the skipchainCothorityCryptoException - if the signer could not sign the darc.Copyright © 2018. All rights reserved.