UNPKG

@peculiar/webcrypto

Version:
30 lines (29 loc) • 1.12 kB
/** * Copyright (c) 2019-2026, Peculiar Ventures * SPDX-License-Identifier: MIT */ import { JsonBase64UrlConverter } from "../../converters/base64_url.js"; import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js"; import { SymmetricKey } from "../../keys/symmetric.js"; import * as core from "webcrypto-core"; import { JsonProp } from "@peculiar/json-schema"; // src/mechs/aes/key.ts var AesCryptoKey = class extends SymmetricKey { get alg() { switch (this.algorithm.name.toUpperCase()) { case "AES-CBC": return `A${this.algorithm.length}CBC`; case "AES-CTR": return `A${this.algorithm.length}CTR`; case "AES-GCM": return `A${this.algorithm.length}GCM`; case "AES-KW": return `A${this.algorithm.length}KW`; case "AES-CMAC": return `A${this.algorithm.length}CMAC`; case "AES-ECB": return `A${this.algorithm.length}ECB`; default: throw new core.AlgorithmError("Unsupported algorithm name"); } } set alg(value) {} }; __decorate([JsonProp({ name: "k", converter: JsonBase64UrlConverter })], AesCryptoKey.prototype, "data", void 0); export { AesCryptoKey };