/* * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(WEB_CRYPTO) #include "CryptoKey.h" #include "ExceptionOr.h" #include #include namespace WebCore { class CryptoAlgorithmParameters; struct JsonWebKey; class CryptoKeyHMAC final : public CryptoKey { public: static Ref create(const Vector& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage) { return adoptRef(*new CryptoKeyHMAC(key, hash, extractable, usage)); } virtual ~CryptoKeyHMAC(); static RefPtr generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); static RefPtr importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap); using CheckAlgCallback = Function; static RefPtr importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap, CheckAlgCallback&&); CryptoKeyClass keyClass() const final { return CryptoKeyClass::HMAC; } const Vector& key() const { return m_key; } JsonWebKey exportJwk() const; CryptoAlgorithmIdentifier hashAlgorithmIdentifier() const { return m_hash; } static ExceptionOr getKeyLength(const CryptoAlgorithmParameters&); private: CryptoKeyHMAC(const Vector& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); CryptoKeyHMAC(Vector&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap); KeyAlgorithm algorithm() const final; CryptoAlgorithmIdentifier m_hash; Vector m_key; }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(CryptoKeyHMAC, CryptoKeyClass::HMAC) #endif // ENABLE(WEB_CRYPTO) itter-async-iter Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2022-02-27[TS Parser] Support `export {type Foo}`Gravatar Jarred Sumner 6-26/+114
2022-02-25be more carefulGravatar Jarred Sumner 3-6/+11
2022-02-25Update cli.zigbun-v0.0.71Gravatar Jarred Sumner 1-2/+2
2022-02-25bump target nextjs versionGravatar Jarred Sumner 1-1/+1
2022-02-25[bun pm] add help menuGravatar Jarred Sumner 1-4/+22
2022-02-25Fix alignment bug with `bun --help`Gravatar Jarred Sumner 1-1/+1
2022-02-25hopefully no more unnecessary git statusGravatar Jarred Sumner 6-1/+1
2022-02-25Update bun-install-lockfile-status.shGravatar Jarred Sumner 1-9/+2
2022-02-25[bun install] Add metadata hashGravatar Jarred Sumner 9-19/+277
2022-02-25Update README.md (#119)Gravatar Evan Boehs 1-1/+0
2022-02-24[bun install] Skip saving the lockfile if there are no changesGravatar Jarred Sumner 3-12/+97
2022-02-24Update MakefileGravatar Jarred Sumner 1-1/+1
2022-02-24Update MakefileGravatar Jarred Sumner 1-1/+0
2022-02-24Update WebKitGravatar Jarred Sumner 1-0/+0
2022-02-24Update generated versionsGravatar Jarred Sumner 1-2/+2
2022-02-24Update MakefileGravatar Jarred Sumner 1-1/+3
2022-02-24miscGravatar Jarred Sumner 2-4/+4
2022-02-24[bun dev] Don't log errors twiceGravatar Jarred Sumner 1-1/+0
2022-02-24Add a simple HMR testGravatar Jarred Sumner 1-2/+40
2022-02-24Make alignment more consitentGravatar Jarred Sumner 3-4/+56
2022-02-24[bun dev] Fix bug with not transpiling files at the rootGravatar Jarred Sumner 2-21/+47
2022-02-24slightly clean up react exampleGravatar Jarred Sumner 5-55/+2
2022-02-24[bun-framework-next] Support Next.js 12.1Gravatar Jarred Sumner 6-25/+46
2022-02-24[bun.js] Implement `process.exit` (no callbacks yet)Gravatar Jarred Sumner 2-0/+29
2022-02-24[bun install] Print correct bin nameGravatar Jarred Sumner 1-1/+1
2022-02-24[bun install] Add integration test for bin linksGravatar Jarred Sumner 1-1/+7
2022-02-24Add WASM modules but disable it for nowGravatar Jarred Sumner 28-134/+530
2022-02-24bump build idGravatar Jarred Sumner 1-1/+1
2022-02-24fix test failure in path.resolveGravatar Jarred Sumner 1-2/+6
2022-02-24Ensure we run the process testGravatar Jarred Sumner 2-48/+54
2022-02-24Update javascript.zigGravatar Jarred Sumner 1-1/+110
2022-02-24[bun.js] Add `ShadowRealm`Gravatar Jarred Sumner 7-18/+70
2022-02-24[bun-framework-next] Remove TextEncoder & TextDecoder polyfillsGravatar Jarred Sumner 3-340/+19
2022-02-24Use a JSFinalobject for PathGravatar Jarred Sumner 2-81/+42
2022-02-24Expose TextEncoder & TextDecoder globallyGravatar Jarred Sumner 3-20/+750
2022-02-24[Web Platform] Implement TextEncoder & TextDecoderGravatar Jarred Sumner 12-358/+1044
2022-02-24move GCDeferralContextGravatar Jarred Sumner 2-18/+24
2022-02-24[JS Parser] ensure assertions are never run at runtimeGravatar Jarred Sumner 1-13/+18
2022-02-24misc cleanupGravatar Jarred Sumner 2-7/+18
2022-02-22Make format consistent with WebKitGravatar Jarred Sumner 20-3596/+4110
2022-02-22import assertion testGravatar Jarred Sumner 1-0/+33
2022-02-22snaspshotsGravatar Jarred Sumner 42-94/+113