Skip to main content

Managed keys

Managed keys outsources the creation, storage, and management of cryptographic keys to a trusted third-party service provider. This approach is also known as key management as a service (KMaaS).

Managed keys are commonly used in situations where an organization requires a high level of security for their cryptographic keys, but does not have the expertise, resources, or infrastructure to manage the keys internally. In this case, the service provider is responsible for generating, storing, and managing the cryptographic keys on behalf of the organization. The keys are stored in a secure data center or cloud environment that is designed to meet strict security requirements and industry standards.

All the operations involved with this keys such as encrypt/decrypt or sign/verify are executed directly on the provider to ensure that the keys are not exposed at any moment.

Overall, managed key management can provide a secure and convenient way for organizations to manage their cryptographic keys, while offloading the burden of key management to a trusted third-party service provider.

Generating a managed key

import {
KeyClient,
KeyProtectionLevel,
KeyType,
ManagedKeyParams,
} from '@bloock/sdk';

const keyClient = new KeyClient();
const keyProtection = KeyProtectionLevel.SOFTWARE;

// Generate a EcP256k key
let keyType = KeyType.EcP256k;
let _key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Rsa2048 key
keyType = KeyType.Rsa2048;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Rsa3072 key
keyType = KeyType.Rsa3072;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Rsa4096 key
keyType = KeyType.Rsa4096;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Aes128 key
keyType = KeyType.Aes128;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Aes256 key
keyType = KeyType.Aes256;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

// Generate a Bjj key
keyType = KeyType.Bjj;
_key = await keyClient.newManagedKey(
new ManagedKeyParams(keyProtection, keyType)
);

Loading an existing managed key

All created managed keys can be viewed in your BLOOCK account (Dashboard). Each key is identified internally by an ID of type UUID. So when you want to load a key, you will need to know its id.

import { KeyClient } from '@bloock/sdk';

const keyClient = new KeyClient();

// Load a managed key
const _key = await keyClient.loadManagedKey('key id');