Skip to content

Commit

Permalink
Fix WrapTYype
Browse files Browse the repository at this point in the history
  • Loading branch information
ccorsin committed Sep 20, 2023
1 parent ea5859b commit 5f4c408
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/kms/kms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export class KmsClient {
const attributes = wrappedObject.value.keyBlock.keyValue?.attributes
const objectType = wrappedObject.type
const object = wrappedObject
const keyWrapType = KeyWrapType.Not_Wrapped
const keyWrapType = KeyWrapType.NotWrapped
const objectId = await this.importObject(
uniqueIdentifier,
attributes,
Expand Down
4 changes: 2 additions & 2 deletions src/kms/structs/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum KeyWrapType {
Not_Wrapped = 0x0000_0001,
As_Registered = 0x0000_0002,
NotWrapped = 0x0000_0001,
AsRegistered = 0x0000_0002,
}

export enum RevocationReasonEnumeration {
Expand Down
17 changes: 12 additions & 5 deletions tests/KMS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,16 +992,23 @@ test(
const [privateKeyUniqueIdentifier, publicKeyUniqueIdentifier] =
await client.createCoverCryptMasterKeyPair(policy)

const symKeyId = await client.createSymmetricKey(
undefined,
undefined,
undefined,
)

const wrappedPrivateKey = await client.getWrappedKey(
privateKeyUniqueIdentifier,
importedCertificateUniqueIdentifier,
symKeyId,
)

// const unwrappedKeyIdentifier = await client.importUnwrappedKey(
// uuidv4(),
// wrappedPrivateKey,
// )
const unwrappedKeyIdentifier = await client.importUnwrappedKey(
uuidv4(),
wrappedPrivateKey,
)

debugger
// const initialKey = await client.getObject(privateKeyUniqueIdentifier)
// const unwrappedKey = await client.getObject(unwrappedKeyIdentifier)

Expand Down

0 comments on commit 5f4c408

Please sign in to comment.