toip.tools

function · Browser and Node

issueCredential

Creates and signs a VC-shaped credential with a fresh UUID and the issuer's DID.

@toip-tools/trust-coreView source
TypeScriptImport
import { issueCredential } from "@toip-tools/trust-core";

Declaration

TypeScriptSignature
issueCredential(issuer: Identity, clock: Clock, body: CredentialBody): Credential;

Parameters

issuerrequired
Identity

Identity that issues and signs the credential.

clockrequired
Clock

Supplies validFrom and the proof creation time.

bodyrequired
CredentialBody

Credential types, subject claims, optional expiry, and optional status-list reference.

Returns

Credential

A credential with the W3C VC v2 context and a Data Integrity proof.