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:
Parameter | Type | Description |
---|---|---|
$issuer | \Bloock\Entity\Identity\Issuer | |
$schemaId | string | |
$holderDid | string | |
$expiration | int | |
$version | int | |
$configData | \Bloock\ConfigData |
withStringAttribute
Adds a string attribute to the CredentialCoreBuilder.
public withStringAttribute(string $key, string $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | string |
withIntegerAttribute
Adds an integer attribute to the CredentialCoreBuilder.
public withIntegerAttribute(string $key, int $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | int |
withDecimalAttribute
Adds a decimal attribute to the CredentialCoreBuilder.
public withDecimalAttribute(string $key, float $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | float |
withBooleanAttribute
Adds a boolean attribute to the CredentialCoreBuilder.
public withBooleanAttribute(string $key, bool $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | bool |
withDateAttribute
Adds a date attribute to the CredentialCoreBuilder.
public withDateAttribute(string $key, \DateTime $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | \DateTime |
withDatetimeAttribute
Adds a datetime attribute to the CredentialCoreBuilder.
public withDatetimeAttribute(string $key, \DateTime $value): $this
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$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