@aws-crypto/material-management-browser
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,4 +0,2 @@ | ||
import { WebCryptoMaterialsManager, EncryptionRequest, // eslint-disable-line no-unused-vars | ||
DecryptionRequest, EncryptionContext, // eslint-disable-line no-unused-vars | ||
WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, KeyringWebCrypto, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management'; | ||
import { WebCryptoMaterialsManager, EncryptionRequest, DecryptionRequest, EncryptionContext, WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, KeyringWebCrypto, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management'; | ||
export declare type WebCryptoEncryptionRequest = EncryptionRequest<WebCryptoAlgorithmSuite>; | ||
@@ -16,4 +14,4 @@ export declare type WebCryptoDecryptionRequest = DecryptionRequest<WebCryptoAlgorithmSuite>; | ||
constructor(keyring: KeyringWebCrypto); | ||
getEncryptionMaterials({ suite, encryptionContext }: WebCryptoEncryptionRequest): Promise<WebCryptoEncryptionMaterial>; | ||
decryptMaterials({ suite, encryptedDataKeys, encryptionContext }: WebCryptoDecryptionRequest): Promise<WebCryptoDecryptionMaterial>; | ||
getEncryptionMaterials({ suite, encryptionContext, }: WebCryptoEncryptionRequest): Promise<WebCryptoEncryptionMaterial>; | ||
decryptMaterials({ suite, encryptedDataKeys, encryptionContext, }: WebCryptoDecryptionRequest): Promise<WebCryptoDecryptionMaterial>; | ||
_initializeEncryptionMaterial(suite: WebCryptoAlgorithmSuite, encryptionContext: EncryptionContext): Promise<WebCryptoEncryptionMaterial>; | ||
@@ -20,0 +18,0 @@ _initializeDecryptionMaterial(suite: WebCryptoAlgorithmSuite, encryptionContext: EncryptionContext): Promise<WebCryptoDecryptionMaterial>; |
"use strict"; | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -32,4 +20,6 @@ const material_management_1 = require("@aws-crypto/material-management"); | ||
} | ||
async getEncryptionMaterials({ suite, encryptionContext }) { | ||
suite = suite || new material_management_1.WebCryptoAlgorithmSuite(material_management_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384); | ||
async getEncryptionMaterials({ suite, encryptionContext, }) { | ||
suite = | ||
suite || | ||
new material_management_1.WebCryptoAlgorithmSuite(material_management_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384); | ||
/* Precondition: WebCryptoDefaultCryptographicMaterialsManager must reserve the ENCODED_SIGNER_KEY constant from @aws-crypto/serialize. | ||
@@ -41,6 +31,4 @@ * A CryptographicMaterialsManager can change entries to the encryptionContext | ||
*/ | ||
material_management_1.needs(!encryptionContext.hasOwnProperty(serialize_1.ENCODED_SIGNER_KEY), `Reserved encryptionContext value ${serialize_1.ENCODED_SIGNER_KEY} not allowed.`); | ||
const material = await this | ||
.keyring | ||
.onEncrypt(await this._initializeEncryptionMaterial(suite, encryptionContext)); | ||
material_management_1.needs(!Object.prototype.hasOwnProperty.call(encryptionContext, serialize_1.ENCODED_SIGNER_KEY), `Reserved encryptionContext value ${serialize_1.ENCODED_SIGNER_KEY} not allowed.`); | ||
const material = await this.keyring.onEncrypt(await this._initializeEncryptionMaterial(suite, encryptionContext)); | ||
/* Postcondition: The WebCryptoEncryptionMaterial must contain a valid dataKey. | ||
@@ -56,6 +44,4 @@ * This verifies that the data key matches the algorithm suite specification | ||
} | ||
async decryptMaterials({ suite, encryptedDataKeys, encryptionContext }) { | ||
const material = await this | ||
.keyring | ||
.onDecrypt(await this._initializeDecryptionMaterial(suite, encryptionContext), encryptedDataKeys.slice()); | ||
async decryptMaterials({ suite, encryptedDataKeys, encryptionContext, }) { | ||
const material = await this.keyring.onDecrypt(await this._initializeDecryptionMaterial(suite, encryptionContext), encryptedDataKeys.slice()); | ||
/* Postcondition: The WebCryptoDecryptionMaterial must contain a valid dataKey. | ||
@@ -85,4 +71,6 @@ * See: cryptographic_materials.ts, `getUnencryptedDataKey` also verifies | ||
const signatureKey = new material_management_1.SignatureKey(privateKey, compressPoint, suite); | ||
return new material_management_1.WebCryptoEncryptionMaterial(suite, { ...encryptionContext, [serialize_1.ENCODED_SIGNER_KEY]: util_base64_browser_1.toBase64(compressPoint) }) | ||
.setSignatureKey(signatureKey); | ||
return new material_management_1.WebCryptoEncryptionMaterial(suite, { | ||
...encryptionContext, | ||
[serialize_1.ENCODED_SIGNER_KEY]: util_base64_browser_1.toBase64(compressPoint), | ||
}).setSignatureKey(signatureKey); | ||
} | ||
@@ -108,4 +96,3 @@ async _initializeDecryptionMaterial(suite, encryptionContext) { | ||
const publicKey = await subtle.importKey(format, publicKeyBytes, webCryptoAlgorithm, extractable, usages); | ||
return new material_management_1.WebCryptoDecryptionMaterial(suite, encryptionContext) | ||
.setVerificationKey(new material_management_1.VerificationKey(publicKey, suite)); | ||
return new material_management_1.WebCryptoDecryptionMaterial(suite, encryptionContext).setVerificationKey(new material_management_1.VerificationKey(publicKey, suite)); | ||
} | ||
@@ -115,2 +102,2 @@ } | ||
material_management_1.immutableBaseClass(WebCryptoDefaultCryptographicMaterialsManager); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJvd3Nlcl9jcnlwdG9ncmFwaGljX21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FQUNkLGtCQUFrQixFQUNsQixXQUFXLEVBQ1gsTUFBTSxDQUNQLENBQUE7UUFFRCxPQUFPLElBQUksaURBQTJCLENBQ3BDLEtBQUssRUFDTCxpQkFBaUIsQ0FDbEIsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLHFDQUFlLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUE7SUFDN0QsQ0FBQztDQUNGO0FBekpELHNHQXlKQztBQUVELHdDQUFrQixDQUFDLDZDQUE2QyxDQUFDLENBQUEifQ== |
"use strict"; | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -21,9 +9,12 @@ const util_base64_browser_1 = require("@aws-sdk/util-base64-browser"); | ||
const base64 = util_base64_browser_1.toBase64(rawKeyBytes); | ||
const base64Url = base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | ||
const base64Url = base64 | ||
.replace(/\+/g, '-') | ||
.replace(/\//g, '_') | ||
.replace(/=/g, ''); | ||
return { | ||
kty: 'oct', | ||
k: base64Url | ||
k: base64Url, | ||
}; | ||
} | ||
exports.bytes2JWK = bytes2JWK; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnl0ZXMyX2p3ay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4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QUMsQ0FBQTtJQUNwQixPQUFPO1FBQ0wsR0FBRyxFQUFFLEtBQUs7UUFDVixDQUFDLEVBQUUsU0FBUztLQUNiLENBQUE7QUFDSCxDQUFDO0FBWEQsOEJBV0MifQ== |
@@ -5,3 +5,3 @@ export * from './browser_cryptographic_materials_manager'; | ||
export * from './keyring_helpers'; | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptionContext, EncryptedDataKey, KeyringWebCrypto, KeyringTrace, KeyringTraceFlag, needs, MixedBackendCryptoKey, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, WebCryptoMaterialsManager, unwrapDataKey, AwsEsdkJsCryptoKey } from '@aws-crypto/material-management'; | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptionContext, EncryptedDataKey, KeyringWebCrypto, KeyringTrace, KeyringTraceFlag, needs, MixedBackendCryptoKey, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, WebCryptoMaterialsManager, unwrapDataKey, AwsEsdkJsCryptoKey, } from '@aws-crypto/material-management'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
function __export(m) { | ||
@@ -42,2 +30,2 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
exports.unwrapDataKey = material_management_1.unwrapDataKey; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7Ozs7O0FBRUgsK0RBQXlEO0FBQ3pELHdDQUFrQztBQUNsQyxrQ0FBNEI7QUFDNUIsdUNBQWlDO0FBQ2pDLHVFQU13QztBQUx0Qyw0REFBQSwyQkFBMkIsQ0FBQTtBQUFFLDREQUFBLDJCQUEyQixDQUFBO0FBQUUsd0RBQUEsdUJBQXVCLENBQUE7QUFDakYseURBQUEsd0JBQXdCLENBQUE7QUFBcUIsaURBQUEsZ0JBQWdCLENBQUE7QUFBRSxpREFBQSxnQkFBZ0IsQ0FBQTtBQUNqRSxpREFBQSxnQkFBZ0IsQ0FBQTtBQUFFLHNDQUFBLEtBQUssQ0FBQTtBQUF5QixzREFBQSxxQkFBcUIsQ0FBQTtBQUNuRixtREFBQSxrQkFBa0IsQ0FBQTtBQUFFLCtDQUFBLGNBQWMsQ0FBQTtBQUFFLDRDQUFBLFdBQVcsQ0FBQTtBQUFFLGlEQUFBLGdCQUFnQixDQUFBO0FBQUUsb0RBQUEsbUJBQW1CLENBQUE7QUFDdEYsaURBQUEsZ0JBQWdCLENBQUE7QUFBRSw0Q0FBQSxXQUFXLENBQUE7QUFBNkIsOENBQUEsYUFBYSxDQUFBIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7Ozs7O0FBRXRDLCtEQUF5RDtBQUN6RCx3Q0FBa0M7QUFDbEMsa0NBQTRCO0FBQzVCLHVDQUFpQztBQUNqQyx1RUF1QndDO0FBdEJ0Qyw0REFBQSwyQkFBMkIsQ0FBQTtBQUMzQiw0REFBQSwyQkFBMkIsQ0FBQTtBQUMzQix3REFBQSx1QkFBdUIsQ0FBQTtBQUN2Qix5REFBQSx3QkFBd0IsQ0FBQTtBQUV4QixpREFBQSxnQkFBZ0IsQ0FBQTtBQUNoQixpREFBQSxnQkFBZ0IsQ0FBQTtBQUVoQixpREFBQSxnQkFBZ0IsQ0FBQTtBQUNoQixzQ0FBQSxLQUFLLENBQUE7QUFFTCxzREFBQSxxQkFBcUIsQ0FBQTtBQUNyQixtREFBQSxrQkFBa0IsQ0FBQTtBQUNsQiwrQ0FBQSxjQUFjLENBQUE7QUFDZCw0Q0FBQSxXQUFXLENBQUE7QUFDWCxpREFBQSxnQkFBZ0IsQ0FBQTtBQUNoQixvREFBQSxtQkFBbUIsQ0FBQTtBQUNuQixpREFBQSxnQkFBZ0IsQ0FBQTtBQUNoQiw0Q0FBQSxXQUFXLENBQUE7QUFFWCw4Q0FBQSxhQUFhLENBQUEifQ== |
@@ -1,4 +0,2 @@ | ||
import { WebCryptoEncryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoDecryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
export declare function importForWebCryptoEncryptionMaterial(material: WebCryptoEncryptionMaterial): Promise<WebCryptoEncryptionMaterial>; | ||
@@ -5,0 +3,0 @@ export declare function importForWebCryptoDecryptionMaterial(material: WebCryptoDecryptionMaterial): Promise<WebCryptoDecryptionMaterial>; |
"use strict"; | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -33,3 +21,3 @@ const material_helpers_1 = require("./material_helpers"); | ||
return material; | ||
return (await importCryptoKeyToMaterial(material)) | ||
return ((await importCryptoKeyToMaterial(material)) | ||
/* Now that a cryptoKey has been imported, the unencrypted data key can be zeroed. | ||
@@ -40,3 +28,3 @@ * this is safe, because one and only one EncryptedDataKey should be used to | ||
*/ | ||
.zeroUnencryptedDataKey(); | ||
.zeroUnencryptedDataKey()); | ||
} | ||
@@ -53,2 +41,2 @@ exports.importForWebCryptoDecryptionMaterial = importForWebCryptoDecryptionMaterial; | ||
exports.importCryptoKeyToMaterial = importCryptoKeyToMaterial; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cmluZ19oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2tleXJpbmdfaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7QUFRSCx5REFFMkI7QUFFM0IsdUVBRXVDO0FBRWhDLEtBQUssVUFBVSxvQ0FBb0MsQ0FBRSxRQUFxQztJQUMvRiwyR0FBMkc7SUFDM0csSUFBSSxRQUFRL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ENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFBO0FBQ2hELENBQUM7QUFURCw4REFTQyJ9 |
@@ -1,4 +0,2 @@ | ||
import { WebCryptoEncryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoDecryptionMaterial, AwsEsdkJsCryptoKey, // eslint-disable-line no-unused-vars | ||
WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, AwsEsdkJsCryptoKey, WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoBackend } from '@aws-crypto/web-crypto-backend'; | ||
@@ -5,0 +3,0 @@ export interface GetSubtleEncrypt { |
"use strict"; | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,3 +17,3 @@ const material_management_1 = require("@aws-crypto/material-management"); | ||
subtleSign: signatureHash ? getSubtleSign : undefined, | ||
dispose | ||
dispose, | ||
}); | ||
@@ -57,3 +45,3 @@ function getSubtleSign(data) { | ||
subtleVerify: signatureHash ? subtleVerify : undefined, | ||
dispose | ||
dispose, | ||
}); | ||
@@ -89,4 +77,7 @@ function subtleVerify(signature, data) { | ||
WebCryptoKdf(web_crypto_backend_1.getNonZeroByteBackend(backend), material, cryptoKey.nonZeroByteCryptoKey, [subtleFunction], info), | ||
WebCryptoKdf(web_crypto_backend_1.getZeroByteSubtle(backend), material, cryptoKey.zeroByteCryptoKey, [subtleFunction], info) | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ nonZeroByteCryptoKey, zeroByteCryptoKey })); | ||
WebCryptoKdf(web_crypto_backend_1.getZeroByteSubtle(backend), material, cryptoKey.zeroByteCryptoKey, [subtleFunction], info), | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ | ||
nonZeroByteCryptoKey, | ||
zeroByteCryptoKey, | ||
})); | ||
return (iv, additionalData) => { | ||
@@ -102,3 +93,4 @@ /* Precondition: The length of the IV must match the WebCryptoAlgorithmSuite specification. */ | ||
} | ||
else if (!material_management_1.isCryptoKey(deriveKey) && !web_crypto_backend_1.isFullSupportWebCryptoBackend(backend)) { | ||
else if (!material_management_1.isCryptoKey(deriveKey) && | ||
!web_crypto_backend_1.isFullSupportWebCryptoBackend(backend)) { | ||
const { nonZeroByteSubtle, zeroByteSubtle } = backend; | ||
@@ -111,3 +103,5 @@ const { nonZeroByteCryptoKey, zeroByteCryptoKey } = deriveKey; | ||
*/ | ||
const dataByteLength = subtleFunction === 'decrypt' ? data.byteLength - tagLength / 8 : data.byteLength; | ||
const dataByteLength = subtleFunction === 'decrypt' | ||
? data.byteLength - tagLength / 8 | ||
: data.byteLength; | ||
material_management_1.needs(dataByteLength >= 0, 'Invalid data length.'); | ||
@@ -134,12 +128,13 @@ if (dataByteLength === 0) { | ||
/* Precondition: Valid HKDF values must exist for browsers. */ | ||
material_management_1.needs(kdf === 'HKDF' && | ||
kdfHash && | ||
info instanceof Uint8Array && | ||
info.byteLength, 'Invalid HKDF values.'); | ||
material_management_1.needs(kdf === 'HKDF' && kdfHash && info instanceof Uint8Array && info.byteLength, 'Invalid HKDF values.'); | ||
// https://developer.mozilla.org/en-US/docs/Web/API/HkdfParams | ||
const kdfAlgorithm = { name: kdf, hash: { name: kdfHash }, info, salt: new Uint8Array() }; | ||
const kdfAlgorithm = { | ||
name: kdf, | ||
hash: { name: kdfHash }, | ||
info, | ||
salt: new Uint8Array(), | ||
}; | ||
const derivedKeyAlgorithm = { name: encryption, length: keyLength }; | ||
const extractable = false; | ||
const deriveKey = await subtle | ||
.deriveKey( | ||
const deriveKey = await subtle.deriveKey( | ||
// @ts-ignore types need to be updated see: https://developer.mozilla.org/en-US/docs/Web/API/HkdfParams | ||
@@ -159,4 +154,7 @@ kdfAlgorithm, cryptoKey, derivedKeyAlgorithm, extractable, keyUsages); | ||
_importCryptoKey(web_crypto_backend_1.getNonZeroByteBackend(backend), material, keyUsages), | ||
_importCryptoKey(web_crypto_backend_1.getZeroByteSubtle(backend), material, keyUsages) | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ nonZeroByteCryptoKey, zeroByteCryptoKey })); | ||
_importCryptoKey(web_crypto_backend_1.getZeroByteSubtle(backend), material, keyUsages), | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ | ||
nonZeroByteCryptoKey, | ||
zeroByteCryptoKey, | ||
})); | ||
} | ||
@@ -186,2 +184,2 @@ } | ||
exports._importCryptoKey = _importCryptoKey; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0ZXJpYWxfaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tYXRlcmlhbF9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7OztHQWFHOztBQUVILHlFQVl3QztBQUV4Qyx1RUFNdUM7QUFFdkMsNkNBQXdDO0FBd0IzQixRQUFBLGdCQUFnQixHQUFxQixLQUFLLEVBQUUsUUFBcUMsRUFBRSxFQUFFO0lBQ2hHLE1BQU0sT0FBTyxHQUFHLE1BQU0sd0NBQW1CLEVBQUUsQ0FBQTtJQUUzQywyRUFBMkU7SUFDM0UsMkJBQUssQ0FBQyxRQUFRLENBQUM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QUFNLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLFdBQVcsRUFBRSxTQUFTLENBQUMsQ0FBQTtLQUN4RTtTQUFNO1FBQ0wsTUFBTSxNQUFNLEdBQUcsS0FBSyxDQUFBO1FBQ3BCLE1BQU0sU0FBUyxHQUFHLEVBQUUsSUFBSSxFQUFFLEtBQUssQ0FBQyxVQUFVLEVBQUUsTUFBTSxFQUFFLEtBQUssQ0FBQyxTQUFTLEVBQUUsQ0FBQTtRQUNyRSxNQUFNLEdBQUcsR0FBRyxzQkFBUyxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQzFCLE9BQU8sTUFBTSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsU0FBUyxDQUFDLENBQUE7S0FDeEU7QUFDSCxDQUFDO0FBdkJELDRDQXVCQyJ9 |
@@ -1,4 +0,2 @@ | ||
import { WebCryptoMaterialsManager, EncryptionRequest, // eslint-disable-line no-unused-vars | ||
DecryptionRequest, EncryptionContext, // eslint-disable-line no-unused-vars | ||
WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, KeyringWebCrypto, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management'; | ||
import { WebCryptoMaterialsManager, EncryptionRequest, DecryptionRequest, EncryptionContext, WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, KeyringWebCrypto, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management'; | ||
export declare type WebCryptoEncryptionRequest = EncryptionRequest<WebCryptoAlgorithmSuite>; | ||
@@ -16,4 +14,4 @@ export declare type WebCryptoDecryptionRequest = DecryptionRequest<WebCryptoAlgorithmSuite>; | ||
constructor(keyring: KeyringWebCrypto); | ||
getEncryptionMaterials({ suite, encryptionContext }: WebCryptoEncryptionRequest): Promise<WebCryptoEncryptionMaterial>; | ||
decryptMaterials({ suite, encryptedDataKeys, encryptionContext }: WebCryptoDecryptionRequest): Promise<WebCryptoDecryptionMaterial>; | ||
getEncryptionMaterials({ suite, encryptionContext, }: WebCryptoEncryptionRequest): Promise<WebCryptoEncryptionMaterial>; | ||
decryptMaterials({ suite, encryptedDataKeys, encryptionContext, }: WebCryptoDecryptionRequest): Promise<WebCryptoDecryptionMaterial>; | ||
_initializeEncryptionMaterial(suite: WebCryptoAlgorithmSuite, encryptionContext: EncryptionContext): Promise<WebCryptoEncryptionMaterial>; | ||
@@ -20,0 +18,0 @@ _initializeDecryptionMaterial(suite: WebCryptoAlgorithmSuite, encryptionContext: EncryptionContext): Promise<WebCryptoDecryptionMaterial>; |
@@ -1,19 +0,6 @@ | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { // eslint-disable-line no-unused-vars | ||
WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, SignatureKey, needs, readOnlyProperty, VerificationKey, AlgorithmSuiteIdentifier, immutableBaseClass, KeyringWebCrypto } from '@aws-crypto/material-management'; | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { WebCryptoAlgorithmSuite, WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, SignatureKey, needs, readOnlyProperty, VerificationKey, AlgorithmSuiteIdentifier, immutableBaseClass, KeyringWebCrypto, } from '@aws-crypto/material-management'; | ||
import { ENCODED_SIGNER_KEY } from '@aws-crypto/serialize'; | ||
import { getWebCryptoBackend, getNonZeroByteBackend } from '@aws-crypto/web-crypto-backend'; | ||
import { getWebCryptoBackend, getNonZeroByteBackend, } from '@aws-crypto/web-crypto-backend'; | ||
import { fromBase64, toBase64 } from '@aws-sdk/util-base64-browser'; | ||
@@ -31,4 +18,6 @@ /** | ||
} | ||
async getEncryptionMaterials({ suite, encryptionContext }) { | ||
suite = suite || new WebCryptoAlgorithmSuite(AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384); | ||
async getEncryptionMaterials({ suite, encryptionContext, }) { | ||
suite = | ||
suite || | ||
new WebCryptoAlgorithmSuite(AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384); | ||
/* Precondition: WebCryptoDefaultCryptographicMaterialsManager must reserve the ENCODED_SIGNER_KEY constant from @aws-crypto/serialize. | ||
@@ -40,6 +29,4 @@ * A CryptographicMaterialsManager can change entries to the encryptionContext | ||
*/ | ||
needs(!encryptionContext.hasOwnProperty(ENCODED_SIGNER_KEY), `Reserved encryptionContext value ${ENCODED_SIGNER_KEY} not allowed.`); | ||
const material = await this | ||
.keyring | ||
.onEncrypt(await this._initializeEncryptionMaterial(suite, encryptionContext)); | ||
needs(!Object.prototype.hasOwnProperty.call(encryptionContext, ENCODED_SIGNER_KEY), `Reserved encryptionContext value ${ENCODED_SIGNER_KEY} not allowed.`); | ||
const material = await this.keyring.onEncrypt(await this._initializeEncryptionMaterial(suite, encryptionContext)); | ||
/* Postcondition: The WebCryptoEncryptionMaterial must contain a valid dataKey. | ||
@@ -55,6 +42,4 @@ * This verifies that the data key matches the algorithm suite specification | ||
} | ||
async decryptMaterials({ suite, encryptedDataKeys, encryptionContext }) { | ||
const material = await this | ||
.keyring | ||
.onDecrypt(await this._initializeDecryptionMaterial(suite, encryptionContext), encryptedDataKeys.slice()); | ||
async decryptMaterials({ suite, encryptedDataKeys, encryptionContext, }) { | ||
const material = await this.keyring.onDecrypt(await this._initializeDecryptionMaterial(suite, encryptionContext), encryptedDataKeys.slice()); | ||
/* Postcondition: The WebCryptoDecryptionMaterial must contain a valid dataKey. | ||
@@ -84,4 +69,6 @@ * See: cryptographic_materials.ts, `getUnencryptedDataKey` also verifies | ||
const signatureKey = new SignatureKey(privateKey, compressPoint, suite); | ||
return new WebCryptoEncryptionMaterial(suite, { ...encryptionContext, [ENCODED_SIGNER_KEY]: toBase64(compressPoint) }) | ||
.setSignatureKey(signatureKey); | ||
return new WebCryptoEncryptionMaterial(suite, { | ||
...encryptionContext, | ||
[ENCODED_SIGNER_KEY]: toBase64(compressPoint), | ||
}).setSignatureKey(signatureKey); | ||
} | ||
@@ -107,7 +94,6 @@ async _initializeDecryptionMaterial(suite, encryptionContext) { | ||
const publicKey = await subtle.importKey(format, publicKeyBytes, webCryptoAlgorithm, extractable, usages); | ||
return new WebCryptoDecryptionMaterial(suite, encryptionContext) | ||
.setVerificationKey(new VerificationKey(publicKey, suite)); | ||
return new WebCryptoDecryptionMaterial(suite, encryptionContext).setVerificationKey(new VerificationKey(publicKey, suite)); | ||
} | ||
} | ||
immutableBaseClass(WebCryptoDefaultCryptographicMaterialsManager); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJvd3Nlcl9jcnlwdG9ncmFwaGljX21hdGVyaWFsc19tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Jyb3dzZXJfY3J5cHRvZ3JhcGhpY19tYXRlcmlhbHNfbWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztHQWFHO0FBRUgsT0FBTyxFQUVpQyxxQ0FBcUM7QUFDM0UsdUJBQXVCLEVBQUUsMkJBQTJCLEVBQ3BELDJCQUEyQixFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUU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TSxXQUFXLEdBQUcsS0FBSyxDQUFBO1FBQ3pCLE1BQU0sTUFBTSxHQUFHLENBQUMsUUFBUSxDQUFDLENBQUE7UUFDekIsTUFBTSxNQUFNLEdBQUcsS0FBSyxDQUFBO1FBRXBCLE1BQU0sY0FBYyxHQUFHLGVBQWUsQ0FBQyxtQkFBbUIsQ0FDeEQsVUFBVSxDQUFDLGFBQWEsQ0FBQyxFQUN6QixLQUFLLENBQ04sQ0FBQTtRQUNELE1BQU0sU0FBUyxHQUFHLE1BQU0sTUFBTSxDQUFDLFNBQVMsQ0FDdEMsTUFBTSxFQUNOLGNBQWMsRUFDZCxrQkFBa0IsRUFDbEIsV0FBVyxFQUNYLE1BQU0sQ0FDUCxDQUFBO1FBRUQsT0FBTyxJQUFJLDJCQUEyQixDQUNwQyxLQUFLLEVBQ0wsaUJBQWlCLENBQ2xCLENBQUMsa0JBQWtCLENBQUMsSUFBSSxlQUFlLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUE7SUFDN0QsQ0FBQztDQUNGO0FBRUQsa0JBQWtCLENBQUMsNkNBQTZDLENBQUMsQ0FBQSJ9 |
@@ -1,15 +0,3 @@ | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { toBase64 } from '@aws-sdk/util-base64-browser'; | ||
@@ -19,8 +7,11 @@ export function bytes2JWK(rawKeyBytes) { | ||
const base64 = toBase64(rawKeyBytes); | ||
const base64Url = base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | ||
const base64Url = base64 | ||
.replace(/\+/g, '-') | ||
.replace(/\//g, '_') | ||
.replace(/=/g, ''); | ||
return { | ||
kty: 'oct', | ||
k: base64Url | ||
k: base64Url, | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnl0ZXMyX2p3ay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ieXRlczJfandrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFFSCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sOEJBQThCLENBQUE7QUFFdkQsTUFBTSxVQUFVLFNBQVMsQ0FBRSxXQUF1QjtJQUNoRCx3RUFBd0U7SUFDeEUsTUFBTSxNQUFNLEdBQUcsUUFBUSxDQUFDLFdBQVcsQ0FBQyxDQUFBO0lBQ3BDLE1BQU0sU0FBUyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxFQUFFLENBQUMsQ0FBQTtJQUNsRixPQUFPO1FBQ0wsR0FBRyxFQUFFLEtBQUs7UUFDVixDQUFDLEVBQUUsU0FBUztLQUNiLENBQUE7QUFDSCxDQUFDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnl0ZXMyX2p3ay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ieXRlczJfandrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7QUFFdEMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLDhCQUE4QixDQUFBO0FBRXZELE1BQU0sVUFBVSxTQUFTLENBQUMsV0FBdUI7SUFDL0Msd0VBQXdFO0lBQ3hFLE1BQU0sTUFBTSxHQUFHLFFBQVEsQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUNwQyxNQUFNLFNBQVMsR0FBRyxNQUFNO1NBQ3JCLE9BQU8sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDO1NBQ25CLE9BQU8sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDO1NBQ25CLE9BQU8sQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUE7SUFDcEIsT0FBTztRQUNMLEdBQUcsRUFBRSxLQUFLO1FBQ1YsQ0FBQyxFQUFFLFNBQVM7S0FDYixDQUFBO0FBQ0gsQ0FBQyJ9 |
@@ -5,3 +5,3 @@ export * from './browser_cryptographic_materials_manager'; | ||
export * from './keyring_helpers'; | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptionContext, EncryptedDataKey, KeyringWebCrypto, KeyringTrace, KeyringTraceFlag, needs, MixedBackendCryptoKey, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, WebCryptoMaterialsManager, unwrapDataKey, AwsEsdkJsCryptoKey } from '@aws-crypto/material-management'; | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptionContext, EncryptedDataKey, KeyringWebCrypto, KeyringTrace, KeyringTraceFlag, needs, MixedBackendCryptoKey, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, WebCryptoMaterialsManager, unwrapDataKey, AwsEsdkJsCryptoKey, } from '@aws-crypto/material-management'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,15 +0,3 @@ | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export * from './browser_cryptographic_materials_manager'; | ||
@@ -19,3 +7,3 @@ export * from './material_helpers'; | ||
export * from './keyring_helpers'; | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptedDataKey, KeyringWebCrypto, KeyringTraceFlag, needs, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, unwrapDataKey } from '@aws-crypto/material-management'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUVILGNBQWMsMkNBQTJDLENBQUE7QUFDekQsY0FBYyxvQkFBb0IsQ0FBQTtBQUNsQyxjQUFjLGNBQWMsQ0FBQTtBQUM1QixjQUFjLG1CQUFtQixDQUFBO0FBQ2pDLE9BQU8sRUFDTCwyQkFBMkIsRUFBRSwyQkFBMkIsRUFBRSx1QkFBdUIsRUFDakYsd0JBQXdCLEVBQXFCLGdCQUFnQixFQUFFLGdCQUFnQixFQUNqRSxnQkFBZ0IsRUFBRSxLQUFLLEVBQXlCLHFCQUFxQixFQUNuRixrQkFBa0IsRUFBRSxjQUFjLEVBQUUsV0FBVyxFQUFFLGdCQUFnQixFQUFFLG1CQUFtQixFQUN0RixnQkFBZ0IsRUFBRSxXQUFXLEVBQTZCLGFBQWEsRUFDeEUsTUFBTSxpQ0FBaUMsQ0FBQSJ9 | ||
export { WebCryptoDecryptionMaterial, WebCryptoEncryptionMaterial, WebCryptoAlgorithmSuite, AlgorithmSuiteIdentifier, EncryptedDataKey, KeyringWebCrypto, KeyringTraceFlag, needs, MultiKeyringWebCrypto, immutableBaseClass, immutableClass, frozenClass, readOnlyProperty, keyUsageForMaterial, isValidCryptoKey, isCryptoKey, unwrapDataKey, } from '@aws-crypto/material-management'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0VBQW9FO0FBQ3BFLHNDQUFzQztBQUV0QyxjQUFjLDJDQUEyQyxDQUFBO0FBQ3pELGNBQWMsb0JBQW9CLENBQUE7QUFDbEMsY0FBYyxjQUFjLENBQUE7QUFDNUIsY0FBYyxtQkFBbUIsQ0FBQTtBQUNqQyxPQUFPLEVBQ0wsMkJBQTJCLEVBQzNCLDJCQUEyQixFQUMzQix1QkFBdUIsRUFDdkIsd0JBQXdCLEVBRXhCLGdCQUFnQixFQUNoQixnQkFBZ0IsRUFFaEIsZ0JBQWdCLEVBQ2hCLEtBQUssRUFFTCxxQkFBcUIsRUFDckIsa0JBQWtCLEVBQ2xCLGNBQWMsRUFDZCxXQUFXLEVBQ1gsZ0JBQWdCLEVBQ2hCLG1CQUFtQixFQUNuQixnQkFBZ0IsRUFDaEIsV0FBVyxFQUVYLGFBQWEsR0FFZCxNQUFNLGlDQUFpQyxDQUFBIn0= |
@@ -1,4 +0,2 @@ | ||
import { WebCryptoEncryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoDecryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
export declare function importForWebCryptoEncryptionMaterial(material: WebCryptoEncryptionMaterial): Promise<WebCryptoEncryptionMaterial>; | ||
@@ -5,0 +3,0 @@ export declare function importForWebCryptoDecryptionMaterial(material: WebCryptoDecryptionMaterial): Promise<WebCryptoDecryptionMaterial>; |
@@ -1,15 +0,3 @@ | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { importCryptoKey } from './material_helpers'; | ||
@@ -30,3 +18,3 @@ import { getWebCryptoBackend } from '@aws-crypto/web-crypto-backend'; | ||
return material; | ||
return (await importCryptoKeyToMaterial(material)) | ||
return ((await importCryptoKeyToMaterial(material)) | ||
/* Now that a cryptoKey has been imported, the unencrypted data key can be zeroed. | ||
@@ -37,3 +25,3 @@ * this is safe, because one and only one EncryptedDataKey should be used to | ||
*/ | ||
.zeroUnencryptedDataKey(); | ||
.zeroUnencryptedDataKey()); | ||
} | ||
@@ -48,2 +36,2 @@ export async function import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BQUksQ0FBQyxRQUFRLENBQUMscUJBQXFCO1FBQUUsT0FBTyxRQUFRLENBQUE7SUFFcEQsT0FBTyxDQUNMLENBQUMsTUFBTSx5QkFBeUIsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUN6Qzs7OztXQUlHO1NBQ0Ysc0JBQXNCLEVBQUUsQ0FDNUIsQ0FBQTtBQUNILENBQUM7QUFFRCxNQUFNLENBQUMsS0FBSyxVQUFVLHlCQUF5QixDQUM3QyxRQUFXO0lBRVgsTUFBTSxPQUFPLEdBQUcsTUFBTSxtQkFBbUIsRUFBRSxDQUFBO0lBQzNDLE1BQU0sU0FBUyxHQUFHLE1BQU0sZUFBZSxDQUFDLE9BQU8sRUFBRSxRQUFRLENBQUMsQ0FBQTtJQUMxRCxnRUFBZ0U7SUFDaEUsaUVBQWlFO0lBQ2pFLE1BQU0sQ0FBQyxLQUFLLENBQUMsR0FBRyxRQUFRLENBQUMsWUFBWSxDQUFBO0lBQ3JDLE9BQU8sUUFBUSxDQUFDLFlBQVksQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLENBQUE7QUFDaEQsQ0FBQyJ9 |
@@ -1,4 +0,2 @@ | ||
import { WebCryptoEncryptionMaterial, // eslint-disable-line no-unused-vars | ||
WebCryptoDecryptionMaterial, AwsEsdkJsCryptoKey, // eslint-disable-line no-unused-vars | ||
WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoEncryptionMaterial, WebCryptoDecryptionMaterial, AwsEsdkJsCryptoKey, WebCryptoMaterial } from '@aws-crypto/material-management'; | ||
import { WebCryptoBackend } from '@aws-crypto/web-crypto-backend'; | ||
@@ -5,0 +3,0 @@ export interface GetSubtleEncrypt { |
@@ -1,18 +0,5 @@ | ||
/* | ||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. A copy of the License is | ||
* located at | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { needs, // eslint-disable-line no-unused-vars | ||
isCryptoKey, isValidCryptoKey, keyUsageForMaterial, subtleFunctionForMaterial, unwrapDataKey } from '@aws-crypto/material-management'; | ||
import { getWebCryptoBackend, getNonZeroByteBackend, getZeroByteSubtle, isFullSupportWebCryptoBackend } from '@aws-crypto/web-crypto-backend'; | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { needs, isCryptoKey, isValidCryptoKey, keyUsageForMaterial, subtleFunctionForMaterial, unwrapDataKey, } from '@aws-crypto/material-management'; | ||
import { getWebCryptoBackend, getNonZeroByteBackend, getZeroByteSubtle, isFullSupportWebCryptoBackend, } from '@aws-crypto/web-crypto-backend'; | ||
import { bytes2JWK } from './bytes2_jwk'; | ||
@@ -28,3 +15,3 @@ export const getEncryptHelper = async (material) => { | ||
subtleSign: signatureHash ? getSubtleSign : undefined, | ||
dispose | ||
dispose, | ||
}); | ||
@@ -56,3 +43,3 @@ function getSubtleSign(data) { | ||
subtleVerify: signatureHash ? subtleVerify : undefined, | ||
dispose | ||
dispose, | ||
}); | ||
@@ -88,4 +75,7 @@ function subtleVerify(signature, data) { | ||
WebCryptoKdf(getNonZeroByteBackend(backend), material, cryptoKey.nonZeroByteCryptoKey, [subtleFunction], info), | ||
WebCryptoKdf(getZeroByteSubtle(backend), material, cryptoKey.zeroByteCryptoKey, [subtleFunction], info) | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ nonZeroByteCryptoKey, zeroByteCryptoKey })); | ||
WebCryptoKdf(getZeroByteSubtle(backend), material, cryptoKey.zeroByteCryptoKey, [subtleFunction], info), | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ | ||
nonZeroByteCryptoKey, | ||
zeroByteCryptoKey, | ||
})); | ||
return (iv, additionalData) => { | ||
@@ -101,3 +91,4 @@ /* Precondition: The length of the IV must match the WebCryptoAlgorithmSuite specification. */ | ||
} | ||
else if (!isCryptoKey(deriveKey) && !isFullSupportWebCryptoBackend(backend)) { | ||
else if (!isCryptoKey(deriveKey) && | ||
!isFullSupportWebCryptoBackend(backend)) { | ||
const { nonZeroByteSubtle, zeroByteSubtle } = backend; | ||
@@ -110,3 +101,5 @@ const { nonZeroByteCryptoKey, zeroByteCryptoKey } = deriveKey; | ||
*/ | ||
const dataByteLength = subtleFunction === 'decrypt' ? data.byteLength - tagLength / 8 : data.byteLength; | ||
const dataByteLength = subtleFunction === 'decrypt' | ||
? data.byteLength - tagLength / 8 | ||
: data.byteLength; | ||
needs(dataByteLength >= 0, 'Invalid data length.'); | ||
@@ -132,12 +125,13 @@ if (dataByteLength === 0) { | ||
/* Precondition: Valid HKDF values must exist for browsers. */ | ||
needs(kdf === 'HKDF' && | ||
kdfHash && | ||
info instanceof Uint8Array && | ||
info.byteLength, 'Invalid HKDF values.'); | ||
needs(kdf === 'HKDF' && kdfHash && info instanceof Uint8Array && info.byteLength, 'Invalid HKDF values.'); | ||
// https://developer.mozilla.org/en-US/docs/Web/API/HkdfParams | ||
const kdfAlgorithm = { name: kdf, hash: { name: kdfHash }, info, salt: new Uint8Array() }; | ||
const kdfAlgorithm = { | ||
name: kdf, | ||
hash: { name: kdfHash }, | ||
info, | ||
salt: new Uint8Array(), | ||
}; | ||
const derivedKeyAlgorithm = { name: encryption, length: keyLength }; | ||
const extractable = false; | ||
const deriveKey = await subtle | ||
.deriveKey( | ||
const deriveKey = await subtle.deriveKey( | ||
// @ts-ignore types need to be updated see: https://developer.mozilla.org/en-US/docs/Web/API/HkdfParams | ||
@@ -156,4 +150,7 @@ kdfAlgorithm, cryptoKey, derivedKeyAlgorithm, extractable, keyUsages); | ||
_importCryptoKey(getNonZeroByteBackend(backend), material, keyUsages), | ||
_importCryptoKey(getZeroByteSubtle(backend), material, keyUsages) | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ nonZeroByteCryptoKey, zeroByteCryptoKey })); | ||
_importCryptoKey(getZeroByteSubtle(backend), material, keyUsages), | ||
]).then(([nonZeroByteCryptoKey, zeroByteCryptoKey]) => ({ | ||
nonZeroByteCryptoKey, | ||
zeroByteCryptoKey, | ||
})); | ||
} | ||
@@ -181,2 +178,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0ZXJpYWxfaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tYXRlcmlhbF9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFFSCxPQUFPLEVBQ0wsS0FBSyxFQUdrQixxQ0FBcUM7QUFDNUQsV0FBVyxFQUNYLGdCQUFnQixFQUNoQixtQkFBbUIsRUFDbkIseUJBQXlCLEVBQ3pCLGFBQWEsRUFHZCxNQUFNLGlDQUFpQyxDQUFBO0FBRXhDLE9BQU8sRUFDTCxtQkFBbUIsRUFDbkIscUJBQXFCLEVBQ3JCLGlCQUFpQixFQUNqQiw2QkFBNkIsRUFFOUIsTUFBTSxnQ0FBZ0MsQ0FBQTtBQUV2QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBd0J4QyxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBcUIsS0FBSyxFQUFFLFFBQXFDLEVBQUUsRUFBRTtJQUNoRyxNQUFNLE9BQU8sR0FBRyxNQUFNLG1CQUFtQixFQUFFLENBQUE7SUFFM0MsMkVBQTJFO0lBQzNFLEtBQUssQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLEVBQUUsNEJBQTRCLEN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RUFBRSxNQUFNLEVBQUUsS0FBSyxDQUFDLFNBQVMsRUFBRSxDQUFBO1FBQzlELE9BQU8sTUFBTSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsU0FBUyxDQUFDLENBQUE7S0FDeEU7U0FBTTtRQUNMLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQTtRQUNwQixNQUFNLFNBQVMsR0FBRyxFQUFFLElBQUksRUFBRSxLQUFLLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxLQUFLLENBQUMsU0FBUyxFQUFFLENBQUE7UUFDckUsTUFBTSxHQUFHLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQzFCLE9BQU8sTUFBTSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsU0FBUyxDQUFDLENBQUE7S0FDeEU7QUFDSCxDQUFDIn0= |
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.2.1](https://github.com/aws/aws-encryption-sdk-javascript/compare/@aws-crypto/material-management-browser@1.2.0...@aws-crypto/material-management-browser@1.2.1) (2020-05-26) | ||
**Note:** Version bump only for package @aws-crypto/material-management-browser | ||
# [1.2.0](https://github.com/aws/aws-encryption-sdk-javascript/compare/@aws-crypto/material-management-browser@1.1.0...@aws-crypto/material-management-browser@1.2.0) (2020-04-02) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@aws-crypto/material-management-browser", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "tsc -b tsconfig.json && tsc -b tsconfig.module.json", | ||
"lint": "standard src/*.ts test/**/*.ts", | ||
"lint": "run-s lint-*", | ||
"lint-eslint": "eslint src/*.ts test/**/*.ts", | ||
"lint-prettier": "prettier -c src/*.ts test/**/*.ts", | ||
"mocha": "mocha --require ts-node/register test/**/*test.ts", | ||
@@ -19,6 +21,6 @@ "test": "npm run lint && npm run coverage", | ||
"dependencies": { | ||
"@aws-crypto/material-management": "^1.0.3", | ||
"@aws-crypto/serialize": "^1.0.3", | ||
"@aws-crypto/web-crypto-backend": "^1.1.1", | ||
"@aws-sdk/util-base64-browser": "1.0.0-alpha.3", | ||
"@aws-crypto/material-management": "^1.0.4", | ||
"@aws-crypto/serialize": "^1.0.4", | ||
"@aws-crypto/web-crypto-backend": "^1.1.2", | ||
"@aws-sdk/util-base64-browser": "1.0.0-beta.2", | ||
"tslib": "^1.11.1" | ||
@@ -33,9 +35,3 @@ }, | ||
], | ||
"standard": { | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
] | ||
}, | ||
"gitHead": "6fdb7e50f91cff05999eeaf79fbd6ad1720024a2" | ||
"gitHead": "4b60e0607e83d1ea2da98fd593e681f98f0d0082" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395634
828
+ Added@aws-sdk/util-base64-browser@1.0.0-beta.2(transitive)
- Removed@aws-sdk/util-base64-browser@1.0.0-alpha.3(transitive)
Updated@aws-crypto/serialize@^1.0.4