@bloock/sdk / KeyClient
Class: KeyClient
Provides functionality to interact with the Bloock Keys service.
Table of contents
Constructors
Properties
Methods
- importManagedCertificate
- loadLocalCertificate
- loadLocalKey
- loadManagedCertificate
- loadManagedKey
- newLocalCertificate
- newLocalKey
- newManagedCertificate
- newManagedKey
- recoverTotpAccessControl
- setupSecretAccessControl
- setupTotpAccessControl
Constructors
constructor
• new KeyClient(configData?): KeyClient
Creates a new KeyClient with default configuration.
Parameters
| Name | Type |
|---|---|
configData? | ConfigData |
Returns
Defined in
Properties
bridge
• Private bridge: BloockBridge
Defined in
configData
• Private configData: ConfigData
Defined in
Methods
importManagedCertificate
▸ importManagedCertificate(type, certificate, params): Promise<ManagedCertificate>
Imports a managed certificate with the specified parameters, supported types: .pem, .pfx.
Parameters
| Name | Type |
|---|---|
type | CertificateType |
certificate | Uint8Array |
params | ImportCertificateParams |
Returns
Promise<ManagedCertificate>
Defined in
loadLocalCertificate
▸ loadLocalCertificate(pkcs12, password): Promise<LocalCertificate>
Loads a local certificate from a PKCS12 file.
Parameters
| Name | Type |
|---|---|
pkcs12 | Uint8Array |
password | string |
Returns
Promise<LocalCertificate>
Defined in
loadLocalKey
▸ loadLocalKey(keyType, key): Promise<LocalKey>
Loads a local key of the specified type from a public key string.
Parameters
| Name | Type |
|---|---|
keyType | KeyType |
key | string |
Returns
Promise<LocalKey>
Defined in
loadManagedCertificate
▸ loadManagedCertificate(id): Promise<ManagedCertificate>
Loads a managed certificate by its ID (ex: ceef5b02-af17-43d8-ae7b-31d9bdf8027f).
Parameters
| Name | Type |
|---|---|
id | string |
Returns
Promise<ManagedCertificate>
Defined in
loadManagedKey
▸ loadManagedKey(id): Promise<ManagedKey>
Loads a managed key by its ID (ex: 51d22546-68f1-4340-b94b-2a80e60b8933).
Parameters
| Name | Type |
|---|---|
id | string |
Returns
Promise<ManagedKey>
Defined in
newLocalCertificate
▸ newLocalCertificate(params): Promise<LocalCertificate>
Generates a new local certificate with the specified parameters.
Parameters
| Name | Type |
|---|---|
params | LocalCertificateParams |
Returns
Promise<LocalCertificate>
Defined in
newLocalKey
▸ newLocalKey(keyType): Promise<LocalKey>
Generates a new local key of the specified type.
Parameters
| Name | Type |
|---|---|
keyType | KeyType |
Returns
Promise<LocalKey>
Defined in
newManagedCertificate
▸ newManagedCertificate(params): Promise<ManagedCertificate>
Generates a new managed certificate with the specified parameters.
Parameters
| Name | Type |
|---|---|
params | ManagedCertificateParams |
Returns
Promise<ManagedCertificate>
Defined in
newManagedKey
▸ newManagedKey(params): Promise<ManagedKey>
Generates a new managed key with the specified parameters.
Parameters
| Name | Type |
|---|---|
params | ManagedKeyParams |
Returns
Promise<ManagedKey>
Defined in
recoverTotpAccessControl
▸ recoverTotpAccessControl(key, code): Promise<TotpAccessControlReceipt>
Recovers TOTP-based access control for the given managed key or managed certificate using a recovery code.
Parameters
| Name | Type |
|---|---|
key | Managed |
code | string |
Returns
Promise<TotpAccessControlReceipt>
Defined in
setupSecretAccessControl
▸ setupSecretAccessControl(key, secret, email): Promise<void>
Sets up secret-based access control for the given managed key or managed certificate.
Parameters
| Name | Type |
|---|---|
key | Managed |
secret | string |
email | string |
Returns
Promise<void>
Defined in
setupTotpAccessControl
▸ setupTotpAccessControl(key): Promise<TotpAccessControlReceipt>
Sets up TOTP-based access control for the given managed key or managed certificate.
Parameters
| Name | Type |
|---|---|
key | Managed |
Returns
Promise<TotpAccessControlReceipt>