@scaleway/sdk-key-manager 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1alpha1/api.gen.d.ts +15 -1
- package/dist/v1alpha1/api.gen.js +13 -1
- package/dist/v1alpha1/constants.gen.d.ts +21 -0
- package/dist/v1alpha1/constants.gen.js +74 -0
- package/dist/v1alpha1/index.gen.d.ts +2 -1
- package/dist/v1alpha1/index.gen.js +18 -3
- package/dist/v1alpha1/marshalling.gen.d.ts +5 -1
- package/dist/v1alpha1/marshalling.gen.js +28 -1
- package/dist/v1alpha1/types.gen.d.ts +37 -5
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
2
|
import type { ApiLocality } from '@scaleway/sdk-client';
|
|
3
|
-
import type { CreateKeyRequest, DataKey, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, ListAlgorithmsRequest, ListAlgorithmsResponse, ListKeysRequest, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UpdateKeyRequest, VerifyRequest, VerifyResponse } from './types.gen.js';
|
|
3
|
+
import type { CreateKeyRequest, DataKey, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, ListAlgorithmsRequest, ListAlgorithmsResponse, ListKeysRequest, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Key Manager API.
|
|
6
6
|
|
|
@@ -159,4 +159,18 @@ export declare class API extends ParentAPI {
|
|
|
159
159
|
* @returns A Promise of ListAlgorithmsResponse
|
|
160
160
|
*/
|
|
161
161
|
listAlgorithms: (request?: Readonly<ListAlgorithmsRequest>) => Promise<ListAlgorithmsResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Wrap a key. Wrap (encrypt) a key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be wrapped is 2 KB of plaintext.
|
|
164
|
+
*
|
|
165
|
+
* @param request - The request {@link WrapKeyRequest}
|
|
166
|
+
* @returns A Promise of WrapKeyResponse
|
|
167
|
+
*/
|
|
168
|
+
wrapKey: (request: Readonly<WrapKeyRequest>) => Promise<WrapKeyResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Unwrap a key. Unwrap (decrypt) a wrapped key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be unwrapped is 4 KB of ciphertext.
|
|
171
|
+
*
|
|
172
|
+
* @param request - The request {@link UnwrapKeyRequest}
|
|
173
|
+
* @returns A Promise of UnwrapKeyResponse
|
|
174
|
+
*/
|
|
175
|
+
unwrapKey: (request: Readonly<UnwrapKeyRequest>) => Promise<UnwrapKeyResponse>;
|
|
162
176
|
}
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
|
|
1
|
+
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse } from "./marshalling.gen.js";
|
|
2
2
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
3
|
//#region src/v1alpha1/api.gen.ts
|
|
4
4
|
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
@@ -123,6 +123,18 @@ var API = class extends API$1 {
|
|
|
123
123
|
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
|
|
124
124
|
urlParams: urlParams(["usages", request.usages])
|
|
125
125
|
}, unmarshalListAlgorithmsResponse);
|
|
126
|
+
this.wrapKey = (request) => this.client.fetch({
|
|
127
|
+
body: JSON.stringify(marshalWrapKeyRequest(request, this.client.settings)),
|
|
128
|
+
headers: jsonContentHeaders,
|
|
129
|
+
method: "POST",
|
|
130
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/wrap`
|
|
131
|
+
}, unmarshalWrapKeyResponse);
|
|
132
|
+
this.unwrapKey = (request) => this.client.fetch({
|
|
133
|
+
body: JSON.stringify(marshalUnwrapKeyRequest(request, this.client.settings)),
|
|
134
|
+
headers: jsonContentHeaders,
|
|
135
|
+
method: "POST",
|
|
136
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/unwrap`
|
|
137
|
+
}, unmarshalUnwrapKeyResponse);
|
|
126
138
|
}
|
|
127
139
|
static {
|
|
128
140
|
this.LOCALITY = toApiLocality({ regions: [
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DataKeyAlgorithmSymmetricEncryption, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyState, ListAlgorithmsRequestUsage, ListKeysRequestOrderBy, ListKeysRequestUsage } from './types.gen.js';
|
|
2
|
+
/** Lists all values of the enum {@link DataKeyAlgorithmSymmetricEncryption}. */
|
|
3
|
+
export declare const DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS: DataKeyAlgorithmSymmetricEncryption[];
|
|
4
|
+
/** Lists all values of the enum {@link KeyAlgorithmAsymmetricEncryption}. */
|
|
5
|
+
export declare const KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS: KeyAlgorithmAsymmetricEncryption[];
|
|
6
|
+
/** Lists all values of the enum {@link KeyAlgorithmAsymmetricSigning}. */
|
|
7
|
+
export declare const KEY_ALGORITHM_ASYMMETRIC_SIGNINGS: KeyAlgorithmAsymmetricSigning[];
|
|
8
|
+
/** Lists all values of the enum {@link KeyAlgorithmKeyEncapsulation}. */
|
|
9
|
+
export declare const KEY_ALGORITHM_KEY_ENCAPSULATIONS: KeyAlgorithmKeyEncapsulation[];
|
|
10
|
+
/** Lists all values of the enum {@link KeyAlgorithmSymmetricEncryption}. */
|
|
11
|
+
export declare const KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS: KeyAlgorithmSymmetricEncryption[];
|
|
12
|
+
/** Lists all values of the enum {@link KeyOrigin}. */
|
|
13
|
+
export declare const KEY_ORIGINS: KeyOrigin[];
|
|
14
|
+
/** Lists all values of the enum {@link KeyState}. */
|
|
15
|
+
export declare const KEY_STATES: KeyState[];
|
|
16
|
+
/** Lists all values of the enum {@link ListAlgorithmsRequestUsage}. */
|
|
17
|
+
export declare const LIST_ALGORITHMS_REQUEST_USAGES: ListAlgorithmsRequestUsage[];
|
|
18
|
+
/** Lists all values of the enum {@link ListKeysRequestOrderBy}. */
|
|
19
|
+
export declare const LIST_KEYS_REQUEST_ORDER_BIES: ListKeysRequestOrderBy[];
|
|
20
|
+
/** Lists all values of the enum {@link ListKeysRequestUsage}. */
|
|
21
|
+
export declare const LIST_KEYS_REQUEST_USAGES: ListKeysRequestUsage[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//#region src/v1alpha1/constants.gen.ts
|
|
2
|
+
/** Lists all values of the enum {@link DataKeyAlgorithmSymmetricEncryption}. */
|
|
3
|
+
const DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS = ["unknown_symmetric_encryption", "aes_256_gcm"];
|
|
4
|
+
/** Lists all values of the enum {@link KeyAlgorithmAsymmetricEncryption}. */
|
|
5
|
+
const KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS = [
|
|
6
|
+
"unknown_asymmetric_encryption",
|
|
7
|
+
"rsa_oaep_2048_sha256",
|
|
8
|
+
"rsa_oaep_3072_sha256",
|
|
9
|
+
"rsa_oaep_4096_sha256"
|
|
10
|
+
];
|
|
11
|
+
/** Lists all values of the enum {@link KeyAlgorithmAsymmetricSigning}. */
|
|
12
|
+
const KEY_ALGORITHM_ASYMMETRIC_SIGNINGS = [
|
|
13
|
+
"unknown_asymmetric_signing",
|
|
14
|
+
"ec_p256_sha256",
|
|
15
|
+
"ec_p384_sha384",
|
|
16
|
+
"rsa_pss_2048_sha256",
|
|
17
|
+
"rsa_pss_3072_sha256",
|
|
18
|
+
"rsa_pss_4096_sha256",
|
|
19
|
+
"rsa_pkcs1_2048_sha256",
|
|
20
|
+
"rsa_pkcs1_3072_sha256",
|
|
21
|
+
"rsa_pkcs1_4096_sha256",
|
|
22
|
+
"ml_dsa_44",
|
|
23
|
+
"ml_dsa_65",
|
|
24
|
+
"ml_dsa_87",
|
|
25
|
+
"ec_secp256k1_sha256"
|
|
26
|
+
];
|
|
27
|
+
/** Lists all values of the enum {@link KeyAlgorithmKeyEncapsulation}. */
|
|
28
|
+
const KEY_ALGORITHM_KEY_ENCAPSULATIONS = [
|
|
29
|
+
"unknown_key_encapsulation",
|
|
30
|
+
"ml_kem_768",
|
|
31
|
+
"ml_kem_1024"
|
|
32
|
+
];
|
|
33
|
+
/** Lists all values of the enum {@link KeyAlgorithmSymmetricEncryption}. */
|
|
34
|
+
const KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS = ["unknown_symmetric_encryption", "aes_256_gcm"];
|
|
35
|
+
/** Lists all values of the enum {@link KeyOrigin}. */
|
|
36
|
+
const KEY_ORIGINS = [
|
|
37
|
+
"unknown_origin",
|
|
38
|
+
"scaleway_kms",
|
|
39
|
+
"external"
|
|
40
|
+
];
|
|
41
|
+
/** Lists all values of the enum {@link KeyState}. */
|
|
42
|
+
const KEY_STATES = [
|
|
43
|
+
"unknown_state",
|
|
44
|
+
"enabled",
|
|
45
|
+
"disabled",
|
|
46
|
+
"pending_key_material",
|
|
47
|
+
"scheduled_for_deletion"
|
|
48
|
+
];
|
|
49
|
+
/** Lists all values of the enum {@link ListAlgorithmsRequestUsage}. */
|
|
50
|
+
const LIST_ALGORITHMS_REQUEST_USAGES = [
|
|
51
|
+
"unknown_usage",
|
|
52
|
+
"symmetric_encryption",
|
|
53
|
+
"asymmetric_encryption",
|
|
54
|
+
"asymmetric_signing",
|
|
55
|
+
"key_encapsulation"
|
|
56
|
+
];
|
|
57
|
+
/** Lists all values of the enum {@link ListKeysRequestOrderBy}. */
|
|
58
|
+
const LIST_KEYS_REQUEST_ORDER_BIES = [
|
|
59
|
+
"name_asc",
|
|
60
|
+
"name_desc",
|
|
61
|
+
"created_at_asc",
|
|
62
|
+
"created_at_desc",
|
|
63
|
+
"updated_at_asc",
|
|
64
|
+
"updated_at_desc"
|
|
65
|
+
];
|
|
66
|
+
/** Lists all values of the enum {@link ListKeysRequestUsage}. */
|
|
67
|
+
const LIST_KEYS_REQUEST_USAGES = [
|
|
68
|
+
"unknown_usage",
|
|
69
|
+
"symmetric_encryption",
|
|
70
|
+
"asymmetric_encryption",
|
|
71
|
+
"asymmetric_signing"
|
|
72
|
+
];
|
|
73
|
+
//#endregion
|
|
74
|
+
export { DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_STATES, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { API, } from './api.gen.js';
|
|
2
|
+
export * from './constants.gen.js';
|
|
2
3
|
export * from './marshalling.gen.js';
|
|
3
|
-
export type { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyRotationPolicy, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UpdateKeyRequest, VerifyRequest, VerifyResponse, } from './types.gen.js';
|
|
4
|
+
export type { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyRotationPolicy, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse, } from './types.gen.js';
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse } from "./marshalling.gen.js";
|
|
3
3
|
import { API } from "./api.gen.js";
|
|
4
|
+
import { DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_STATES, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES } from "./constants.gen.js";
|
|
4
5
|
//#region src/v1alpha1/index.gen.ts
|
|
5
6
|
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
6
7
|
API: () => API,
|
|
8
|
+
DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS: () => DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS,
|
|
9
|
+
KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS: () => KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS,
|
|
10
|
+
KEY_ALGORITHM_ASYMMETRIC_SIGNINGS: () => KEY_ALGORITHM_ASYMMETRIC_SIGNINGS,
|
|
11
|
+
KEY_ALGORITHM_KEY_ENCAPSULATIONS: () => KEY_ALGORITHM_KEY_ENCAPSULATIONS,
|
|
12
|
+
KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS: () => KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS,
|
|
13
|
+
KEY_ORIGINS: () => KEY_ORIGINS,
|
|
14
|
+
KEY_STATES: () => KEY_STATES,
|
|
15
|
+
LIST_ALGORITHMS_REQUEST_USAGES: () => LIST_ALGORITHMS_REQUEST_USAGES,
|
|
16
|
+
LIST_KEYS_REQUEST_ORDER_BIES: () => LIST_KEYS_REQUEST_ORDER_BIES,
|
|
17
|
+
LIST_KEYS_REQUEST_USAGES: () => LIST_KEYS_REQUEST_USAGES,
|
|
7
18
|
marshalCreateKeyRequest: () => marshalCreateKeyRequest,
|
|
8
19
|
marshalDecryptRequest: () => marshalDecryptRequest,
|
|
9
20
|
marshalEncryptRequest: () => marshalEncryptRequest,
|
|
10
21
|
marshalGenerateDataKeyRequest: () => marshalGenerateDataKeyRequest,
|
|
11
22
|
marshalImportKeyMaterialRequest: () => marshalImportKeyMaterialRequest,
|
|
12
23
|
marshalSignRequest: () => marshalSignRequest,
|
|
24
|
+
marshalUnwrapKeyRequest: () => marshalUnwrapKeyRequest,
|
|
13
25
|
marshalUpdateKeyRequest: () => marshalUpdateKeyRequest,
|
|
14
26
|
marshalVerifyRequest: () => marshalVerifyRequest,
|
|
27
|
+
marshalWrapKeyRequest: () => marshalWrapKeyRequest,
|
|
15
28
|
unmarshalDataKey: () => unmarshalDataKey,
|
|
16
29
|
unmarshalDecryptResponse: () => unmarshalDecryptResponse,
|
|
17
30
|
unmarshalEncryptResponse: () => unmarshalEncryptResponse,
|
|
@@ -20,7 +33,9 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
20
33
|
unmarshalListKeysResponse: () => unmarshalListKeysResponse,
|
|
21
34
|
unmarshalPublicKey: () => unmarshalPublicKey,
|
|
22
35
|
unmarshalSignResponse: () => unmarshalSignResponse,
|
|
23
|
-
|
|
36
|
+
unmarshalUnwrapKeyResponse: () => unmarshalUnwrapKeyResponse,
|
|
37
|
+
unmarshalVerifyResponse: () => unmarshalVerifyResponse,
|
|
38
|
+
unmarshalWrapKeyResponse: () => unmarshalWrapKeyResponse
|
|
24
39
|
});
|
|
25
40
|
//#endregion
|
|
26
|
-
export { API, index_gen_exports, marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
|
|
41
|
+
export { API, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_STATES, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, index_gen_exports, marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { Key, DataKey, DecryptResponse, EncryptResponse, ListAlgorithmsResponse, ListKeysResponse, PublicKey, SignResponse, VerifyResponse, CreateKeyRequest, DecryptRequest, EncryptRequest, GenerateDataKeyRequest, ImportKeyMaterialRequest, SignRequest, UpdateKeyRequest, VerifyRequest } from './types.gen.js';
|
|
2
|
+
import type { Key, DataKey, DecryptResponse, EncryptResponse, ListAlgorithmsResponse, ListKeysResponse, PublicKey, SignResponse, UnwrapKeyResponse, VerifyResponse, WrapKeyResponse, CreateKeyRequest, DecryptRequest, EncryptRequest, GenerateDataKeyRequest, ImportKeyMaterialRequest, SignRequest, UnwrapKeyRequest, UpdateKeyRequest, VerifyRequest, WrapKeyRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalKey: (data: unknown) => Key;
|
|
4
4
|
export declare const unmarshalDataKey: (data: unknown) => DataKey;
|
|
5
5
|
export declare const unmarshalDecryptResponse: (data: unknown) => DecryptResponse;
|
|
@@ -8,12 +8,16 @@ export declare const unmarshalListAlgorithmsResponse: (data: unknown) => ListAlg
|
|
|
8
8
|
export declare const unmarshalListKeysResponse: (data: unknown) => ListKeysResponse;
|
|
9
9
|
export declare const unmarshalPublicKey: (data: unknown) => PublicKey;
|
|
10
10
|
export declare const unmarshalSignResponse: (data: unknown) => SignResponse;
|
|
11
|
+
export declare const unmarshalUnwrapKeyResponse: (data: unknown) => UnwrapKeyResponse;
|
|
11
12
|
export declare const unmarshalVerifyResponse: (data: unknown) => VerifyResponse;
|
|
13
|
+
export declare const unmarshalWrapKeyResponse: (data: unknown) => WrapKeyResponse;
|
|
12
14
|
export declare const marshalCreateKeyRequest: (request: CreateKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
15
|
export declare const marshalDecryptRequest: (request: DecryptRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
16
|
export declare const marshalEncryptRequest: (request: EncryptRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
17
|
export declare const marshalGenerateDataKeyRequest: (request: GenerateDataKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
18
|
export declare const marshalImportKeyMaterialRequest: (request: ImportKeyMaterialRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
19
|
export declare const marshalSignRequest: (request: SignRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
20
|
+
export declare const marshalUnwrapKeyRequest: (request: UnwrapKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
21
|
export declare const marshalUpdateKeyRequest: (request: UpdateKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
19
22
|
export declare const marshalVerifyRequest: (request: VerifyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
23
|
+
export declare const marshalWrapKeyRequest: (request: WrapKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -12,6 +12,7 @@ const unmarshalKeyUsage = (data) => {
|
|
|
12
12
|
return {
|
|
13
13
|
asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : void 0,
|
|
14
14
|
asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : void 0,
|
|
15
|
+
keyEncapsulation: data.key_encapsulation ? data.key_encapsulation : void 0,
|
|
15
16
|
symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0
|
|
16
17
|
};
|
|
17
18
|
};
|
|
@@ -92,6 +93,13 @@ const unmarshalSignResponse = (data) => {
|
|
|
92
93
|
signature: data.signature
|
|
93
94
|
};
|
|
94
95
|
};
|
|
96
|
+
const unmarshalUnwrapKeyResponse = (data) => {
|
|
97
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UnwrapKeyResponse' failed as data isn't a dictionary.`);
|
|
98
|
+
return {
|
|
99
|
+
keyId: data.key_id,
|
|
100
|
+
plaintext: data.plaintext
|
|
101
|
+
};
|
|
102
|
+
};
|
|
95
103
|
const unmarshalVerifyResponse = (data) => {
|
|
96
104
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary.`);
|
|
97
105
|
return {
|
|
@@ -99,6 +107,13 @@ const unmarshalVerifyResponse = (data) => {
|
|
|
99
107
|
valid: data.valid
|
|
100
108
|
};
|
|
101
109
|
};
|
|
110
|
+
const unmarshalWrapKeyResponse = (data) => {
|
|
111
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'WrapKeyResponse' failed as data isn't a dictionary.`);
|
|
112
|
+
return {
|
|
113
|
+
ciphertext: data.ciphertext,
|
|
114
|
+
keyId: data.key_id
|
|
115
|
+
};
|
|
116
|
+
};
|
|
102
117
|
const marshalKeyRotationPolicy = (request, defaults) => ({
|
|
103
118
|
next_rotation_at: request.nextRotationAt,
|
|
104
119
|
rotation_period: request.rotationPeriod
|
|
@@ -115,6 +130,10 @@ const marshalKeyUsage = (request, defaults) => ({ ...resolveOneOf([
|
|
|
115
130
|
{
|
|
116
131
|
param: "asymmetric_signing",
|
|
117
132
|
value: request.asymmetricSigning
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
param: "key_encapsulation",
|
|
136
|
+
value: request.keyEncapsulation
|
|
118
137
|
}
|
|
119
138
|
]) });
|
|
120
139
|
const marshalCreateKeyRequest = (request, defaults) => ({
|
|
@@ -144,6 +163,10 @@ const marshalImportKeyMaterialRequest = (request, defaults) => ({
|
|
|
144
163
|
salt: request.salt
|
|
145
164
|
});
|
|
146
165
|
const marshalSignRequest = (request, defaults) => ({ digest: request.digest });
|
|
166
|
+
const marshalUnwrapKeyRequest = (request, defaults) => ({
|
|
167
|
+
associated_data: request.associatedData,
|
|
168
|
+
ciphertext: request.ciphertext
|
|
169
|
+
});
|
|
147
170
|
const marshalUpdateKeyRequest = (request, defaults) => ({
|
|
148
171
|
description: request.description,
|
|
149
172
|
name: request.name,
|
|
@@ -154,5 +177,9 @@ const marshalVerifyRequest = (request, defaults) => ({
|
|
|
154
177
|
digest: request.digest,
|
|
155
178
|
signature: request.signature
|
|
156
179
|
});
|
|
180
|
+
const marshalWrapKeyRequest = (request, defaults) => ({
|
|
181
|
+
associated_data: request.associatedData,
|
|
182
|
+
plaintext: request.plaintext
|
|
183
|
+
});
|
|
157
184
|
//#endregion
|
|
158
|
-
export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
|
|
185
|
+
export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Region as ScwRegion } from '@scaleway/sdk-client';
|
|
2
2
|
export type DataKeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
|
|
3
3
|
export type KeyAlgorithmAsymmetricEncryption = 'unknown_asymmetric_encryption' | 'rsa_oaep_2048_sha256' | 'rsa_oaep_3072_sha256' | 'rsa_oaep_4096_sha256';
|
|
4
|
-
export type KeyAlgorithmAsymmetricSigning = 'unknown_asymmetric_signing' | 'ec_p256_sha256' | 'ec_p384_sha384' | 'rsa_pss_2048_sha256' | 'rsa_pss_3072_sha256' | 'rsa_pss_4096_sha256' | 'rsa_pkcs1_2048_sha256' | 'rsa_pkcs1_3072_sha256' | 'rsa_pkcs1_4096_sha256' | 'ml_dsa_44' | 'ml_dsa_65' | 'ml_dsa_87';
|
|
4
|
+
export type KeyAlgorithmAsymmetricSigning = 'unknown_asymmetric_signing' | 'ec_p256_sha256' | 'ec_p384_sha384' | 'rsa_pss_2048_sha256' | 'rsa_pss_3072_sha256' | 'rsa_pss_4096_sha256' | 'rsa_pkcs1_2048_sha256' | 'rsa_pkcs1_3072_sha256' | 'rsa_pkcs1_4096_sha256' | 'ml_dsa_44' | 'ml_dsa_65' | 'ml_dsa_87' | 'ec_secp256k1_sha256';
|
|
5
|
+
export type KeyAlgorithmKeyEncapsulation = 'unknown_key_encapsulation' | 'ml_kem_768' | 'ml_kem_1024';
|
|
5
6
|
export type KeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
|
|
6
7
|
export type KeyOrigin = 'unknown_origin' | 'scaleway_kms' | 'external';
|
|
7
8
|
export type KeyState = 'unknown_state' | 'enabled' | 'disabled' | 'pending_key_material' | 'scheduled_for_deletion';
|
|
8
|
-
export type ListAlgorithmsRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing';
|
|
9
|
+
export type ListAlgorithmsRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing' | 'key_encapsulation';
|
|
9
10
|
export type ListKeysRequestOrderBy = 'name_asc' | 'name_desc' | 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
|
|
10
11
|
export type ListKeysRequestUsage = 'unknown_usage' | 'symmetric_encryption' | 'asymmetric_encryption' | 'asymmetric_signing';
|
|
11
12
|
export interface KeyRotationPolicy {
|
|
@@ -22,21 +23,26 @@ export interface KeyUsage {
|
|
|
22
23
|
/**
|
|
23
24
|
* See the `Key.Algorithm.SymmetricEncryption` enum for a description of values.
|
|
24
25
|
*
|
|
25
|
-
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning' could be set.
|
|
26
|
+
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
|
|
26
27
|
*/
|
|
27
28
|
symmetricEncryption?: KeyAlgorithmSymmetricEncryption;
|
|
28
29
|
/**
|
|
29
30
|
* See the `Key.Algorithm.AsymmetricEncryption` enum for a description of values.
|
|
30
31
|
*
|
|
31
|
-
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning' could be set.
|
|
32
|
+
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
|
|
32
33
|
*/
|
|
33
34
|
asymmetricEncryption?: KeyAlgorithmAsymmetricEncryption;
|
|
34
35
|
/**
|
|
35
36
|
* See the `Key.Algorithm.AsymmetricSigning` enum for a description of values.
|
|
36
37
|
*
|
|
37
|
-
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning' could be set.
|
|
38
|
+
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
|
|
38
39
|
*/
|
|
39
40
|
asymmetricSigning?: KeyAlgorithmAsymmetricSigning;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* One-of ('usage'): at most one of 'symmetricEncryption', 'asymmetricEncryption', 'asymmetricSigning', 'keyEncapsulation' could be set.
|
|
44
|
+
*/
|
|
45
|
+
keyEncapsulation?: KeyAlgorithmKeyEncapsulation;
|
|
40
46
|
}
|
|
41
47
|
export interface ListAlgorithmsResponseAlgorithm {
|
|
42
48
|
usage: string;
|
|
@@ -453,6 +459,19 @@ export type UnprotectKeyRequest = {
|
|
|
453
459
|
*/
|
|
454
460
|
keyId: string;
|
|
455
461
|
};
|
|
462
|
+
export type UnwrapKeyRequest = {
|
|
463
|
+
/**
|
|
464
|
+
* Region to target. If none is passed will use default region from the config.
|
|
465
|
+
*/
|
|
466
|
+
region?: ScwRegion;
|
|
467
|
+
keyId: string;
|
|
468
|
+
ciphertext: string;
|
|
469
|
+
associatedData?: string;
|
|
470
|
+
};
|
|
471
|
+
export interface UnwrapKeyResponse {
|
|
472
|
+
keyId: string;
|
|
473
|
+
plaintext: string;
|
|
474
|
+
}
|
|
456
475
|
export type UpdateKeyRequest = {
|
|
457
476
|
/**
|
|
458
477
|
* Region to target. If none is passed will use default region from the config.
|
|
@@ -507,3 +526,16 @@ export interface VerifyResponse {
|
|
|
507
526
|
*/
|
|
508
527
|
valid: boolean;
|
|
509
528
|
}
|
|
529
|
+
export type WrapKeyRequest = {
|
|
530
|
+
/**
|
|
531
|
+
* Region to target. If none is passed will use default region from the config.
|
|
532
|
+
*/
|
|
533
|
+
region?: ScwRegion;
|
|
534
|
+
keyId: string;
|
|
535
|
+
plaintext: string;
|
|
536
|
+
associatedData?: string;
|
|
537
|
+
};
|
|
538
|
+
export interface WrapKeyResponse {
|
|
539
|
+
keyId: string;
|
|
540
|
+
ciphertext: string;
|
|
541
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-key-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "Scaleway SDK key-manager",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@scaleway/random-name": "6.0.2",
|
|
36
|
-
"@scaleway/sdk-std": "2.
|
|
36
|
+
"@scaleway/sdk-std": "2.7.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
39
|
+
"@repo/configs": "^0.1.1",
|
|
40
|
+
"@scaleway/sdk-client": "^2.7.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@scaleway/sdk-client": "^2.
|
|
43
|
+
"@scaleway/sdk-client": "^2.7.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=20.20.2"
|