Skip to main content

@bloock/sdk / Credential

Class: Credential

Represents a verifiable credential with its associated information. Verifiable Credentials Data Model v2.0.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Credential(context, id, type, issuanceDate, expiration, credentialSubject, credentialStatus, issuer, credentialSchema, proof): Credential

Creates a new Credential instance with the provided details.

Parameters

NameType
contextstring[]
idstring
typestring[]
issuanceDatestring
expirationstring
credentialSubjectany
credentialStatusCredentialStatus
issuerstring
credentialSchemaCredentialSchema
proofCredentialProof

Returns

Credential

Defined in

entity/identity/credential.ts:40

Properties

context

context: string[]

Defined in

entity/identity/credential.ts:16


credentialSchema

credentialSchema: CredentialSchema

Defined in

entity/identity/credential.ts:24


credentialStatus

credentialStatus: CredentialStatus

Defined in

entity/identity/credential.ts:22


credentialSubject

credentialSubject: any

Defined in

entity/identity/credential.ts:21


expiration

expiration: string

Defined in

entity/identity/credential.ts:20


id

id: string

Defined in

entity/identity/credential.ts:17


issuanceDate

issuanceDate: string

Defined in

entity/identity/credential.ts:19


issuer

issuer: string

Defined in

entity/identity/credential.ts:23


proof

proof: CredentialProof

Defined in

entity/identity/credential.ts:25


type

type: string[]

Defined in

entity/identity/credential.ts:18

Methods

toJson

toJson(): Promise<string>

Converts the Credential instance to its JSON string representation.

Returns

Promise<string>

Defined in

entity/identity/credential.ts:98


toProto

toProto(): Credential

Returns

Credential

Defined in

entity/identity/credential.ts:64


fromJson

fromJson(json): Promise<Credential>

Creates a Credential instance from a JSON string representation.

Parameters

NameType
jsonstring

Returns

Promise<Credential>

Defined in

entity/identity/credential.ts:122


fromProto

fromProto(r): Credential

Parameters

NameType
rCredential

Returns

Credential

Defined in

entity/identity/credential.ts:79