Issuer

interface Issuer

Summarizes operations for a Issuer in the sense of the W3C VC Data Model.

It can issue Verifiable Credentials, revoke credentials and build a revocation list.

Types

Link copied to clipboard
data class Attachment(val name: String, val mediaType: String, val data: ByteArray)
Link copied to clipboard
data class FailedAttribute(val attributeName: String, val reason: Throwable)
Link copied to clipboard
data class IssuedCredential(val vcJws: String, val attachments: List<Issuer.Attachment>? = null)
Link copied to clipboard
data class IssuedCredentialResult(val successful: List<Issuer.IssuedCredential> = listOf(), val failed: List<Issuer.FailedAttribute> = listOf())

Functions

Link copied to clipboard
abstract fun buildRevocationList(timePeriod: Int): String?

Returns a Base64-encoded, zlib-compressed bitstring of revoked credentials, where the entry at "revocationListIndex" (of the credential) is true iff it is revoked

Link copied to clipboard
Link copied to clipboard

Wraps credential in a single VerifiableCredential, returns a JWS representation of that VC.

abstract suspend fun issueCredential(subjectId: String, attributeType: String): Issuer.IssuedCredentialResult

Issues credential for attributeType to subjectId

Link copied to clipboard
abstract suspend fun issueCredentials(subjectId: String, attributeNames: List<String>): Issuer.IssuedCredentialResult

Issues credentials for all attributeNames to subjectId

Link copied to clipboard
abstract suspend fun issueRevocationListCredential(timePeriod: Int): String?

Wraps the revocation information into a VC, returns a JWS representation of that.

Link copied to clipboard
abstract fun revokeCredentials(credentialsToRevoke: List<String>): Boolean

Revokes all verifiable credentials from credentialsToRevoke list that parse and validate. It returns true if all revocations was successful. Note: only the issuer can revoke.

Inheritors

Link copied to clipboard