Skip to main content

@bloock/sdk / KeyClient

Class: KeyClient

Provides functionality to interact with the Bloock Keys service.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new KeyClient(configData?): KeyClient

Creates a new KeyClient with default configuration.

Parameters

NameType
configData?ConfigData

Returns

KeyClient

Defined in

client/key.ts:41

Properties

bridge

Private bridge: BloockBridge

Defined in

client/key.ts:34


configData

Private configData: ConfigData

Defined in

client/key.ts:35

Methods

importManagedCertificate

importManagedCertificate(type, certificate, params): Promise<ManagedCertificate>

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

Parameters

NameType
typeCertificateType
certificateUint8Array
paramsImportCertificateParams

Returns

Promise<ManagedCertificate>

Defined in

client/key.ts:238


loadLocalCertificate

loadLocalCertificate(pkcs12, password): Promise<LocalCertificate>

Loads a local certificate from a PKCS12 file.

Parameters

NameType
pkcs12Uint8Array
passwordstring

Returns

Promise<LocalCertificate>

Defined in

client/key.ts:164


loadLocalKey

loadLocalKey(keyType, key): Promise<LocalKey>

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

Parameters

NameType
keyTypeKeyType
keystring

Returns

Promise<LocalKey>

Defined in

client/key.ts:73


loadManagedCertificate

loadManagedCertificate(id): Promise<ManagedCertificate>

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

Parameters

NameType
idstring

Returns

Promise<ManagedCertificate>

Defined in

client/key.ts:214


loadManagedKey

loadManagedKey(id): Promise<ManagedKey>

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

Parameters

NameType
idstring

Returns

Promise<ManagedKey>

Defined in

client/key.ts:117


newLocalCertificate

newLocalCertificate(params): Promise<LocalCertificate>

Generates a new local certificate with the specified parameters.

Parameters

NameType
paramsLocalCertificateParams

Returns

Promise<LocalCertificate>

Defined in

client/key.ts:139


newLocalKey

newLocalKey(keyType): Promise<LocalKey>

Generates a new local key of the specified type.

Parameters

NameType
keyTypeKeyType

Returns

Promise<LocalKey>

Defined in

client/key.ts:51


newManagedCertificate

newManagedCertificate(params): Promise<ManagedCertificate>

Generates a new managed certificate with the specified parameters.

Parameters

NameType
paramsManagedCertificateParams

Returns

Promise<ManagedCertificate>

Defined in

client/key.ts:190


newManagedKey

newManagedKey(params): Promise<ManagedKey>

Generates a new managed key with the specified parameters.

Parameters

NameType
paramsManagedKeyParams

Returns

Promise<ManagedKey>

Defined in

client/key.ts:95


recoverTotpAccessControl

recoverTotpAccessControl(key, code): Promise<TotpAccessControlReceipt>

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

Parameters

NameType
keyManaged
codestring

Returns

Promise<TotpAccessControlReceipt>

Defined in

client/key.ts:294


setupSecretAccessControl

setupSecretAccessControl(key, secret, email): Promise<void>

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

Parameters

NameType
keyManaged
secretstring
emailstring

Returns

Promise<void>

Defined in

client/key.ts:327


setupTotpAccessControl

setupTotpAccessControl(key): Promise<TotpAccessControlReceipt>

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

Parameters

NameType
keyManaged

Returns

Promise<TotpAccessControlReceipt>

Defined in

client/key.ts:266