Skip to main content

CredentialBuilder

Helps construct credentials by specifying various attributes.

  • Full name: \Bloock\Entity\Identity\CredentialBuilder

Properties

schemaId

private string $schemaId

holderDid

private string $holderDid

expiration

private int $expiration

version

private int $version

key

private \Bloock\Key $key

configData

private \Bloock\ConfigData $configData

stringAttributes

private array $stringAttributes

integerAttributes

private array $integerAttributes

decimalAttributes

private array $decimalAttributes

booleanAttributes

private array $booleanAttributes

dateAttributes

private array $dateAttributes

datetimeAttributes

private array $datetimeAttributes

Methods

__construct

Creates a new CredentialBuilder instance with the specified parameters.

public __construct(\Bloock\Entity\Identity\Issuer $issuer, string $schemaId, string $holderDid, int $expiration, int $version, \Bloock\ConfigData $configData): mixed

Parameters:

ParameterTypeDescription
$issuer\Bloock\Entity\Identity\Issuer
$schemaIdstring
$holderDidstring
$expirationint
$versionint
$configData\Bloock\ConfigData

withStringAttribute

Adds a string attribute to the CredentialBuilder.

public withStringAttribute(string $key, string $value): $this

Parameters:

ParameterTypeDescription
$keystring
$valuestring

withIntegerAttribute

Adds an integer attribute to the CredentialBuilder.

public withIntegerAttribute(string $key, int $value): $this

Parameters:

ParameterTypeDescription
$keystring
$valueint

withDecimalAttribute

Adds a decimal attribute to the CredentialBuilder.

public withDecimalAttribute(string $key, float $value): $this

Parameters:

ParameterTypeDescription
$keystring
$valuefloat

withBooleanAttribute

Adds a boolean attribute to the CredentialBuilder.

public withBooleanAttribute(string $key, bool $value): $this

Parameters:

ParameterTypeDescription
$keystring
$valuebool

withDateAttribute

Adds a date attribute to the CredentialBuilder.

public withDateAttribute(string $key, \DateTime $value): $this

Parameters:

ParameterTypeDescription
$keystring
$value\DateTime

withDatetimeAttribute

Adds a datetime attribute to the CredentialBuilder.

public withDatetimeAttribute(string $key, \DateTime $value): $this

Parameters:

ParameterTypeDescription
$keystring
$value\DateTime

build

Creates and returns a Credential using the specified attributes.

public build(): \Bloock\Entity\Identity\CredentialReceipt

Throws:



Automatically generated on 2024-04-02