IssuerAgent

class IssuerAgent(validator: Validator, issuerCredentialStore: IssuerCredentialStore = InMemoryIssuerCredentialStore(), revocationListBaseUrl: String = "https://wallet.a-sit.at/backend/credentials/status", dataProvider: IssuerCredentialDataProvider = EmptyCredentialDataProvider, zlibService: ZlibService = DefaultZlibService(), revocationListLifetime: Duration = 48.hours, jwsService: JwsService, coseService: CoseService, clock: Clock = Clock.System, val keyPair: KeyPairAdapter, val cryptoAlgorithms: Set<X509SignatureAlgorithm>, timePeriodProvider: TimePeriodProvider = FixedTimePeriodProvider) : Issuer

An agent that only implements Issuer, i.e. it issues credentials for other agents.

Constructors

Link copied to clipboard
constructor(keyPairAdapter: KeyPairAdapter = RandomKeyPairAdapter(), dataProvider: IssuerCredentialDataProvider = EmptyCredentialDataProvider)
constructor(keyPairAdapter: KeyPairAdapter = RandomKeyPairAdapter(), issuerCredentialStore: IssuerCredentialStore = InMemoryIssuerCredentialStore(), dataProvider: IssuerCredentialDataProvider = EmptyCredentialDataProvider)
constructor(validator: Validator, issuerCredentialStore: IssuerCredentialStore = InMemoryIssuerCredentialStore(), revocationListBaseUrl: String = "https://wallet.a-sit.at/backend/credentials/status", dataProvider: IssuerCredentialDataProvider = EmptyCredentialDataProvider, zlibService: ZlibService = DefaultZlibService(), revocationListLifetime: Duration = 48.hours, jwsService: JwsService, coseService: CoseService, clock: Clock = Clock.System, keyPair: KeyPairAdapter, cryptoAlgorithms: Set<X509SignatureAlgorithm>, timePeriodProvider: TimePeriodProvider = FixedTimePeriodProvider)

Properties

Link copied to clipboard
open override val cryptoAlgorithms: Set<X509SignatureAlgorithm>

The cryptographic algorithms supported by this issuer, i.e. the ones from its cryptographic service, used to sign credentials.

Link copied to clipboard
open override val keyPair: KeyPairAdapter

The public key for this agent, i.e. the public part of the key that signs issued credentials.

Functions

Link copied to clipboard
open override 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
suspend fun issueCredential(credential: CredentialToBeIssued, subjectPublicKey: CryptoPublicKey, scheme: ConstantIndex.CredentialScheme): KmmResult<Issuer.IssuedCredential>

Wraps the credential-to-be-issued in credential into a single instance of CredentialToBeIssued, according to the representation, i.e. it essentially signs the credential with the issuer key.

open suspend override fun issueCredential(subjectPublicKey: CryptoPublicKey, credentialScheme: ConstantIndex.CredentialScheme, representation: ConstantIndex.CredentialRepresentation, claimNames: Collection<String>?, dataProviderOverride: IssuerCredentialDataProvider?): KmmResult<Issuer.IssuedCredential>

Issues credentials for some credentialScheme to the subject specified with its public key in subjectPublicKey in the format specified by representation. Callers may optionally define some attribute names from ConstantIndex.CredentialScheme.claimNames in claimNames to request only some claims (if supported by the representation).

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

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

Link copied to clipboard
open override 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.

Link copied to clipboard
open override fun revokeCredentialsWithId(credentialIdsToRevoke: Map<String, Instant>): Boolean

Revokes all verifiable credentials with ids from credentialIdsToRevoke It returns true if all revocations was successful.