@bloock/sdk / Credential
Class: Credential
Represents a verifiable credential with its associated information. Verifiable Credentials Data Model v2.0.
Table of contents
Constructors
Properties
- context
- credentialSchema
- credentialStatus
- credentialSubject
- expiration
- id
- issuanceDate
- issuer
- proof
- type
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
Name | Type |
---|---|
context | string [] |
id | string |
type | string [] |
issuanceDate | string |
expiration | string |
credentialSubject | any |
credentialStatus | CredentialStatus |
issuer | string |
credentialSchema | CredentialSchema |
proof | CredentialProof |
Returns
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
Name | Type |
---|---|
json | string |
Returns
Promise
<Credential
>
Defined in
entity/identity/credential.ts:122
fromProto
▸ fromProto(r
): Credential
Parameters
Name | Type |
---|---|
r | Credential |