aries / net.globalid.aries.features.issuecredential / CredentialService

CredentialService

interface CredentialService

Credential service manages credentials and protocol state according to the issue credential protocol as defined in Aries RFC 0036.

From the above protocol, only (partial) HOLDER functionality is supported:

Notes:

Functions

createCredentialRequest

Creates a credential request from a CredentialRecord with the given ID. The record can be in the "sent request" (recreate the request) or "received offer" state (create the request and transition to "sent request" state).

abstract fun createCredentialRequest(agent: Agent, recordId: String): Single<Pair<SentRequest, CredentialRequestMessage>>

deleteCredential

Deletes the credential record with the given identifier from the agent's wallet. If the credential protocol is past the "issued" state, the credential stored with Indy is also deleted.

abstract fun deleteCredential(agent: Agent, recordId: String): Completable

getCredential

Gets the credential record with the given identifier from the agent's wallet.

abstract fun getCredential(agent: Agent, credentialId: String): Single<CredentialRecord>

getCredentials

Retrieves a list of CredentialRecord items for the given search criteria from the agent's wallet.

abstract fun getCredentials(agent: Agent, query: SearchQuery, count: Int): Single<List<CredentialRecord>>

Retrieves a list of CredentialRecord items without any query conditions with max size 100 from the agent's wallet.

abstract fun getCredentials(agent: Agent): Single<List<CredentialRecord>>

processCredentialIssue

Processes the given issue message and stores the issued credential in the wallet.

abstract fun processCredentialIssue(agent: Agent, credentialIssue: CredentialIssueMessage): Single<ReceivedIssue>

processCredentialOffer

Processes the given offer message and stores the offer in the wallet.

abstract fun processCredentialOffer(agent: Agent, credentialOffer: CredentialOfferMessage, connectionContext: ConnectionContext): Single<ReceivedOffer>

rejectCredentialOffer

Rejects a credential offer. This is a local state only.

abstract fun rejectCredentialOffer(agent: Agent, credentialId: String): Completable

sendAck

Sends an ACK if the record is in the CredentialRecord.ReceivedIssue state and the ACK has not yet been sent. If the record is in the wrong state, an error is returned. If ACK has already been sent, completes normally.

abstract fun sendAck(agent: Agent, recordId: String): Completable

Inheritors

DefaultCredentialService

Default implementation of CredentialService.

class DefaultCredentialService : CredentialService