@scaleway/sdk-key-manager 2.10.0 → 2.12.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.
@@ -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
  }
@@ -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,19 @@
1
+ import type { DataKeyAlgorithmSymmetricEncryption, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, 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 KeyAlgorithmSymmetricEncryption}. */
9
+ export declare const KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS: KeyAlgorithmSymmetricEncryption[];
10
+ /** Lists all values of the enum {@link KeyOrigin}. */
11
+ export declare const KEY_ORIGINS: KeyOrigin[];
12
+ /** Lists all values of the enum {@link KeyState}. */
13
+ export declare const KEY_STATES: KeyState[];
14
+ /** Lists all values of the enum {@link ListAlgorithmsRequestUsage}. */
15
+ export declare const LIST_ALGORITHMS_REQUEST_USAGES: ListAlgorithmsRequestUsage[];
16
+ /** Lists all values of the enum {@link ListKeysRequestOrderBy}. */
17
+ export declare const LIST_KEYS_REQUEST_ORDER_BIES: ListKeysRequestOrderBy[];
18
+ /** Lists all values of the enum {@link ListKeysRequestUsage}. */
19
+ export declare const LIST_KEYS_REQUEST_USAGES: ListKeysRequestUsage[];
@@ -0,0 +1,68 @@
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
+ "ml_kem_768",
11
+ "ml_kem_1024"
12
+ ];
13
+ /** Lists all values of the enum {@link KeyAlgorithmAsymmetricSigning}. */
14
+ const KEY_ALGORITHM_ASYMMETRIC_SIGNINGS = [
15
+ "unknown_asymmetric_signing",
16
+ "ec_p256_sha256",
17
+ "ec_p384_sha384",
18
+ "rsa_pss_2048_sha256",
19
+ "rsa_pss_3072_sha256",
20
+ "rsa_pss_4096_sha256",
21
+ "rsa_pkcs1_2048_sha256",
22
+ "rsa_pkcs1_3072_sha256",
23
+ "rsa_pkcs1_4096_sha256",
24
+ "ml_dsa_44",
25
+ "ml_dsa_65",
26
+ "ml_dsa_87"
27
+ ];
28
+ /** Lists all values of the enum {@link KeyAlgorithmSymmetricEncryption}. */
29
+ const KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS = ["unknown_symmetric_encryption", "aes_256_gcm"];
30
+ /** Lists all values of the enum {@link KeyOrigin}. */
31
+ const KEY_ORIGINS = [
32
+ "unknown_origin",
33
+ "scaleway_kms",
34
+ "external"
35
+ ];
36
+ /** Lists all values of the enum {@link KeyState}. */
37
+ const KEY_STATES = [
38
+ "unknown_state",
39
+ "enabled",
40
+ "disabled",
41
+ "pending_key_material",
42
+ "scheduled_for_deletion"
43
+ ];
44
+ /** Lists all values of the enum {@link ListAlgorithmsRequestUsage}. */
45
+ const LIST_ALGORITHMS_REQUEST_USAGES = [
46
+ "unknown_usage",
47
+ "symmetric_encryption",
48
+ "asymmetric_encryption",
49
+ "asymmetric_signing"
50
+ ];
51
+ /** Lists all values of the enum {@link ListKeysRequestOrderBy}. */
52
+ const LIST_KEYS_REQUEST_ORDER_BIES = [
53
+ "name_asc",
54
+ "name_desc",
55
+ "created_at_asc",
56
+ "created_at_desc",
57
+ "updated_at_asc",
58
+ "updated_at_desc"
59
+ ];
60
+ /** Lists all values of the enum {@link ListKeysRequestUsage}. */
61
+ const LIST_KEYS_REQUEST_USAGES = [
62
+ "unknown_usage",
63
+ "symmetric_encryption",
64
+ "asymmetric_encryption",
65
+ "asymmetric_signing"
66
+ ];
67
+ //#endregion
68
+ export { DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, 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, 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,29 @@
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_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_SYMMETRIC_ENCRYPTIONS: () => KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS,
12
+ KEY_ORIGINS: () => KEY_ORIGINS,
13
+ KEY_STATES: () => KEY_STATES,
14
+ LIST_ALGORITHMS_REQUEST_USAGES: () => LIST_ALGORITHMS_REQUEST_USAGES,
15
+ LIST_KEYS_REQUEST_ORDER_BIES: () => LIST_KEYS_REQUEST_ORDER_BIES,
16
+ LIST_KEYS_REQUEST_USAGES: () => LIST_KEYS_REQUEST_USAGES,
7
17
  marshalCreateKeyRequest: () => marshalCreateKeyRequest,
8
18
  marshalDecryptRequest: () => marshalDecryptRequest,
9
19
  marshalEncryptRequest: () => marshalEncryptRequest,
10
20
  marshalGenerateDataKeyRequest: () => marshalGenerateDataKeyRequest,
11
21
  marshalImportKeyMaterialRequest: () => marshalImportKeyMaterialRequest,
12
22
  marshalSignRequest: () => marshalSignRequest,
23
+ marshalUnwrapKeyRequest: () => marshalUnwrapKeyRequest,
13
24
  marshalUpdateKeyRequest: () => marshalUpdateKeyRequest,
14
25
  marshalVerifyRequest: () => marshalVerifyRequest,
26
+ marshalWrapKeyRequest: () => marshalWrapKeyRequest,
15
27
  unmarshalDataKey: () => unmarshalDataKey,
16
28
  unmarshalDecryptResponse: () => unmarshalDecryptResponse,
17
29
  unmarshalEncryptResponse: () => unmarshalEncryptResponse,
@@ -20,7 +32,9 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
20
32
  unmarshalListKeysResponse: () => unmarshalListKeysResponse,
21
33
  unmarshalPublicKey: () => unmarshalPublicKey,
22
34
  unmarshalSignResponse: () => unmarshalSignResponse,
23
- unmarshalVerifyResponse: () => unmarshalVerifyResponse
35
+ unmarshalUnwrapKeyResponse: () => unmarshalUnwrapKeyResponse,
36
+ unmarshalVerifyResponse: () => unmarshalVerifyResponse,
37
+ unmarshalWrapKeyResponse: () => unmarshalWrapKeyResponse
24
38
  });
25
39
  //#endregion
26
- export { API, index_gen_exports, marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
40
+ export { API, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, 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>;
@@ -92,6 +92,13 @@ const unmarshalSignResponse = (data) => {
92
92
  signature: data.signature
93
93
  };
94
94
  };
95
+ const unmarshalUnwrapKeyResponse = (data) => {
96
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UnwrapKeyResponse' failed as data isn't a dictionary.`);
97
+ return {
98
+ keyId: data.key_id,
99
+ plaintext: data.plaintext
100
+ };
101
+ };
95
102
  const unmarshalVerifyResponse = (data) => {
96
103
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary.`);
97
104
  return {
@@ -99,6 +106,13 @@ const unmarshalVerifyResponse = (data) => {
99
106
  valid: data.valid
100
107
  };
101
108
  };
109
+ const unmarshalWrapKeyResponse = (data) => {
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'WrapKeyResponse' failed as data isn't a dictionary.`);
111
+ return {
112
+ ciphertext: data.ciphertext,
113
+ keyId: data.key_id
114
+ };
115
+ };
102
116
  const marshalKeyRotationPolicy = (request, defaults) => ({
103
117
  next_rotation_at: request.nextRotationAt,
104
118
  rotation_period: request.rotationPeriod
@@ -144,6 +158,10 @@ const marshalImportKeyMaterialRequest = (request, defaults) => ({
144
158
  salt: request.salt
145
159
  });
146
160
  const marshalSignRequest = (request, defaults) => ({ digest: request.digest });
161
+ const marshalUnwrapKeyRequest = (request, defaults) => ({
162
+ associated_data: request.associatedData,
163
+ ciphertext: request.ciphertext
164
+ });
147
165
  const marshalUpdateKeyRequest = (request, defaults) => ({
148
166
  description: request.description,
149
167
  name: request.name,
@@ -154,5 +172,9 @@ const marshalVerifyRequest = (request, defaults) => ({
154
172
  digest: request.digest,
155
173
  signature: request.signature
156
174
  });
175
+ const marshalWrapKeyRequest = (request, defaults) => ({
176
+ associated_data: request.associatedData,
177
+ plaintext: request.plaintext
178
+ });
157
179
  //#endregion
158
- export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
180
+ export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
@@ -9,6 +9,7 @@ export declare const queriesMetadata: {
9
9
  readonly protoName: 'GetKey';
10
10
  readonly paramsType: 'GetKeyRequest';
11
11
  readonly returnType: 'Key';
12
+ readonly returnTypeNamespace: '@scaleway-internal/sdk-key-manager/v1alpha1';
12
13
  readonly isList: false;
13
14
  readonly paginationType: 'none';
14
15
  readonly isPrivate: false;
@@ -18,6 +19,7 @@ export declare const queriesMetadata: {
18
19
  readonly protoName: 'GetPublicKey';
19
20
  readonly paramsType: 'GetPublicKeyRequest';
20
21
  readonly returnType: 'PublicKey';
22
+ readonly returnTypeNamespace: '@scaleway-internal/sdk-key-manager/v1alpha1';
21
23
  readonly isList: false;
22
24
  readonly paginationType: 'none';
23
25
  readonly isPrivate: false;
@@ -27,10 +29,12 @@ export declare const queriesMetadata: {
27
29
  readonly protoName: 'ListKeys';
28
30
  readonly paramsType: 'ListKeysRequest';
29
31
  readonly returnType: 'ListKeysResponse';
32
+ readonly returnTypeNamespace: '@scaleway-internal/sdk-key-manager/v1alpha1';
30
33
  readonly isList: true;
31
34
  readonly paginationType: 'offset';
32
35
  readonly pageParamKey: 'page';
33
36
  readonly listItemType: 'Key';
37
+ readonly listItemTypeNamespace: '@scaleway-internal/sdk-key-manager/v1alpha1';
34
38
  readonly isPrivate: false;
35
39
  readonly description: '"';
36
40
  }, {
@@ -38,6 +42,7 @@ export declare const queriesMetadata: {
38
42
  readonly protoName: 'ListAlgorithms';
39
43
  readonly paramsType: 'ListAlgorithmsRequest';
40
44
  readonly returnType: 'ListAlgorithmsResponse';
45
+ readonly returnTypeNamespace: '@scaleway-internal/sdk-key-manager/v1alpha1';
41
46
  readonly isList: false;
42
47
  readonly paginationType: 'none';
43
48
  readonly isPrivate: false;
@@ -11,6 +11,7 @@ const queriesMetadata = {
11
11
  protoName: "GetKey",
12
12
  paramsType: "GetKeyRequest",
13
13
  returnType: "Key",
14
+ returnTypeNamespace: "@scaleway-internal/sdk-key-manager/v1alpha1",
14
15
  isList: false,
15
16
  paginationType: "none",
16
17
  isPrivate: false,
@@ -21,6 +22,7 @@ const queriesMetadata = {
21
22
  protoName: "GetPublicKey",
22
23
  paramsType: "GetPublicKeyRequest",
23
24
  returnType: "PublicKey",
25
+ returnTypeNamespace: "@scaleway-internal/sdk-key-manager/v1alpha1",
24
26
  isList: false,
25
27
  paginationType: "none",
26
28
  isPrivate: false,
@@ -31,10 +33,12 @@ const queriesMetadata = {
31
33
  protoName: "ListKeys",
32
34
  paramsType: "ListKeysRequest",
33
35
  returnType: "ListKeysResponse",
36
+ returnTypeNamespace: "@scaleway-internal/sdk-key-manager/v1alpha1",
34
37
  isList: true,
35
38
  paginationType: "offset",
36
39
  pageParamKey: "page",
37
40
  listItemType: "Key",
41
+ listItemTypeNamespace: "@scaleway-internal/sdk-key-manager/v1alpha1",
38
42
  isPrivate: false,
39
43
  description: "\""
40
44
  },
@@ -43,6 +47,7 @@ const queriesMetadata = {
43
47
  protoName: "ListAlgorithms",
44
48
  paramsType: "ListAlgorithmsRequest",
45
49
  returnType: "ListAlgorithmsResponse",
50
+ returnTypeNamespace: "@scaleway-internal/sdk-key-manager/v1alpha1",
46
51
  isList: false,
47
52
  paginationType: "none",
48
53
  isPrivate: false,
@@ -1,6 +1,6 @@
1
1
  import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
2
  export type DataKeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
3
- export type KeyAlgorithmAsymmetricEncryption = 'unknown_asymmetric_encryption' | 'rsa_oaep_2048_sha256' | 'rsa_oaep_3072_sha256' | 'rsa_oaep_4096_sha256';
3
+ export type KeyAlgorithmAsymmetricEncryption = 'unknown_asymmetric_encryption' | 'rsa_oaep_2048_sha256' | 'rsa_oaep_3072_sha256' | 'rsa_oaep_4096_sha256' | 'ml_kem_768' | 'ml_kem_1024';
4
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';
5
5
  export type KeyAlgorithmSymmetricEncryption = 'unknown_symmetric_encryption' | 'aes_256_gcm';
6
6
  export type KeyOrigin = 'unknown_origin' | 'scaleway_kms' | 'external';
@@ -453,6 +453,19 @@ export type UnprotectKeyRequest = {
453
453
  */
454
454
  keyId: string;
455
455
  };
456
+ export type UnwrapKeyRequest = {
457
+ /**
458
+ * Region to target. If none is passed will use default region from the config.
459
+ */
460
+ region?: ScwRegion;
461
+ keyId: string;
462
+ ciphertext: string;
463
+ associatedData?: string;
464
+ };
465
+ export interface UnwrapKeyResponse {
466
+ keyId: string;
467
+ plaintext: string;
468
+ }
456
469
  export type UpdateKeyRequest = {
457
470
  /**
458
471
  * Region to target. If none is passed will use default region from the config.
@@ -507,3 +520,16 @@ export interface VerifyResponse {
507
520
  */
508
521
  valid: boolean;
509
522
  }
523
+ export type WrapKeyRequest = {
524
+ /**
525
+ * Region to target. If none is passed will use default region from the config.
526
+ */
527
+ region?: ScwRegion;
528
+ keyId: string;
529
+ plaintext: string;
530
+ associatedData?: string;
531
+ };
532
+ export interface WrapKeyResponse {
533
+ keyId: string;
534
+ ciphertext: string;
535
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-key-manager",
3
- "version": "2.10.0",
3
+ "version": "2.12.0",
4
4
  "description": "Scaleway SDK key-manager",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@scaleway/random-name": "6.0.2",
36
- "@scaleway/sdk-std": "2.6.0"
36
+ "@scaleway/sdk-std": "2.7.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@repo/configs": "^0.1.1",