Skip to main content

KeyClient

Provides functionality to interact with the Bloock Keys service.

  • Full name: \Bloock\Client\KeyClient

Properties

bridge

private $bridge

config

private $config

Methods

__construct

Creates a new KeyClient with the given configuration.

public __construct(\Bloock\ConfigData|null $config = null): mixed

Parameters:

ParameterTypeDescription
$config\Bloock\ConfigData|null

newLocalKey

Generates a new local key of the specified type.

public newLocalKey(string $keyType): \Bloock\Entity\Key\LocalKey

Parameters:

ParameterTypeDescription
$keyTypestring

Throws:


loadLocalKey

Loads a local key of the specified type from a public key string.

public loadLocalKey(string $keyType, string $key): \Bloock\Entity\Key\LocalKey

Parameters:

ParameterTypeDescription
$keyTypestring
$keystring

Throws:


newManagedKey

Generates a new managed key with the specified parameters.

public newManagedKey(\Bloock\Entity\Key\ManagedKeyParams $params): \Bloock\Entity\Key\ManagedKey

Parameters:

ParameterTypeDescription
$params\Bloock\Entity\Key\ManagedKeyParams

Throws:


loadManagedKey

Loads a managed key by its ID (ex: 51d22546-68f1-4340-b94b-2a80e60b8933).

public loadManagedKey(string $id): \Bloock\Entity\Key\ManagedKey

Parameters:

ParameterTypeDescription
$idstring

Throws:


newLocalCertificate

Generates a new local certificate with the specified parameters.

public newLocalCertificate(\Bloock\Entity\Key\LocalCertificateArgs $params): \Bloock\Entity\Key\LocalCertificate

Parameters:

ParameterTypeDescription
$params\Bloock\Entity\Key\LocalCertificateArgs

Throws:


loadLocalCertificate

Loads a local certificate from a PKCS12 file.

public loadLocalCertificate(array $pkcs12, string $password): \Bloock\Entity\Key\LocalCertificate

Parameters:

ParameterTypeDescription
$pkcs12array
$passwordstring

Throws:


newManagedCertificate

Generates a new managed certificate with the specified parameters.

public newManagedCertificate(\Bloock\Entity\Key\ManagedCertificateParams $params): \Bloock\Entity\Key\ManagedCertificate

Parameters:

ParameterTypeDescription
$params\Bloock\Entity\Key\ManagedCertificateParams

Throws:


loadManagedCertificate

Loads a managed certificate by its ID (ex: ceef5b02-af17-43d8-ae7b-31d9bdf8027f).

public loadManagedCertificate(string $id): \Bloock\Entity\Key\ManagedCertificate

Parameters:

ParameterTypeDescription
$idstring

Throws:


importManagedCertificate

Imports a managed certificate with the specified parameters, supported types: .pem, .pfx.

public importManagedCertificate(string $certificateType, array $certificate, \Bloock\Entity\Key\ImportCertificateParams $params): \Bloock\Entity\Key\ManagedCertificate

Parameters:

ParameterTypeDescription
$certificateTypestring
$certificatearray
$params\Bloock\Entity\Key\ImportCertificateParams

Throws:


setupTotpAccessControl

Sets up TOTP-based access control for the given managed key or managed certificate.

public setupTotpAccessControl(\Bloock\Entity\Key\Managed $key): \Bloock\Entity\Key\TotpAccessControlReceipt

Parameters:

ParameterTypeDescription
$key\Bloock\Entity\Key\Managed

Throws:


recoverTotpAccessControl

Recovers TOTP-based access control for the given managed key or managed certificate using a recovery code.

public recoverTotpAccessControl(\Bloock\Entity\Key\Managed $key, string $code): \Bloock\Entity\Key\TotpAccessControlReceipt

Parameters:

ParameterTypeDescription
$key\Bloock\Entity\Key\Managed
$codestring

Throws:


setupSecretAccessControl

Sets up secret-based access control for the given managed key or managed certificate.

public setupSecretAccessControl(\Bloock\Entity\Key\Managed $key, string $secret, string $email): void

Parameters:

ParameterTypeDescription
$key\Bloock\Entity\Key\Managed
$secretstring
$emailstring

Throws:



Automatically generated on 2024-04-02