Skip to main content

CredentialCoreBuilder

Helps construct credentials by specifying various attributes.

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

Properties​

schemaId​

private string $schemaId

issuerDid​

private string $issuerDid

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 CredentialCoreBuilder 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 CredentialCoreBuilder.

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

Parameters:

ParameterTypeDescription
$keystring
$valuestring

withIntegerAttribute​

Adds an integer attribute to the CredentialCoreBuilder.

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

Parameters:

ParameterTypeDescription
$keystring
$valueint

withDecimalAttribute​

Adds a decimal attribute to the CredentialCoreBuilder.

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

Parameters:

ParameterTypeDescription
$keystring
$valuefloat

withBooleanAttribute​

Adds a boolean attribute to the CredentialCoreBuilder.

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

Parameters:

ParameterTypeDescription
$keystring
$valuebool

withDateAttribute​

Adds a date attribute to the CredentialCoreBuilder.

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

Parameters:

ParameterTypeDescription
$keystring
$value\DateTime

withDatetimeAttribute​

Adds a datetime attribute to the CredentialCoreBuilder.

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-17