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:
Parameter | Type | Description |
---|---|---|
$config | \Bloock\ConfigData|null |
newLocalKey
Generates a new local key of the specified type.
public newLocalKey(string $keyType): \Bloock\Entity\Key\LocalKey
Parameters:
Parameter | Type | Description |
---|---|---|
$keyType | string |
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:
Parameter | Type | Description |
---|---|---|
$keyType | string | |
$key | string |
Throws:
newManagedKey
Generates a new managed key with the specified parameters.
public newManagedKey(\Bloock\Entity\Key\ManagedKeyParams $params): \Bloock\Entity\Key\ManagedKey
Parameters:
Parameter | Type | Description |
---|---|---|
$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:
Parameter | Type | Description |
---|---|---|
$id | string |
Throws:
newLocalCertificate
Generates a new local certificate with the specified parameters.
public newLocalCertificate(\Bloock\Entity\Key\LocalCertificateArgs $params): \Bloock\Entity\Key\LocalCertificate
Parameters:
Parameter | Type | Description |
---|---|---|
$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:
Parameter | Type | Description |
---|---|---|
$pkcs12 | array | |
$password | string |
Throws:
newManagedCertificate
Generates a new managed certificate with the specified parameters.
public newManagedCertificate(\Bloock\Entity\Key\ManagedCertificateParams $params): \Bloock\Entity\Key\ManagedCertificate
Parameters:
Parameter | Type | Description |
---|---|---|
$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:
Parameter | Type | Description |
---|---|---|
$id | string |
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:
Parameter | Type | Description |
---|---|---|
$certificateType | string | |
$certificate | array | |
$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:
Parameter | Type | Description |
---|---|---|
$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:
Parameter | Type | Description |
---|---|---|
$key | \Bloock\Entity\Key\Managed | |
$code | string |
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:
Parameter | Type | Description |
---|---|---|
$key | \Bloock\Entity\Key\Managed | |
$secret | string | |
$email | string |
Throws:
Automatically generated on 2024-04-02