aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/webcrypto/CryptoKeyRaw.cpp
blob: c75684189d5b7c5e7f38586caa150daabc1e6155 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (C) 2017 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.
 */

#include "config.h"
#include "CryptoKeyRaw.h"

#if ENABLE(WEB_CRYPTO)

#include "CryptoAlgorithmRegistry.h"

namespace WebCore {

CryptoKeyRaw::CryptoKeyRaw(CryptoAlgorithmIdentifier identifier, Vector<uint8_t>&& keyData, CryptoKeyUsageBitmap usages)
    : CryptoKey(identifier, CryptoKeyType::Secret, false, usages)
    , m_key(WTFMove(keyData))
{
}

auto CryptoKeyRaw::algorithm() const -> KeyAlgorithm
{
    CryptoKeyAlgorithm result;
    result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
    return result;
}

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
/5145ad1d8bb861137d85da7a3e32ef36?s=13&d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner 1-1/+4 2022-10-21CodegenGravatar Jarred Sumner 2-16/+25 2022-10-21Treat invalid buffer value as utf8 stringGravatar Jarred Sumner 1-2/+3 2022-10-21Add test for `fs.createReadStream`Gravatar Jarred Sumner 1-0/+43 2022-10-21Implement `fs.createReadStream`, begin `fs.createWriteStream`Gravatar Jarred Sumner 1-3/+621 2022-10-21Make Node Streams work better in BunGravatar Jarred Sumner 1-140/+214 2022-10-21Fix error handling logic in read()Gravatar Jarred Sumner 1-51/+79 2022-10-21Fix bugs in mask boolean valuesGravatar Jarred Sumner 2-15/+21 2022-10-21Emit errorsGravatar Jarred Sumner 2-2/+37 2022-10-21Add test for ResolveError.position being inspectableGravatar Jarred Sumner 2-0/+12 2022-10-21Fix segfault when logging position object from failed nested importGravatar Jarred Sumner 1-114/+34 2022-10-21Implement `setMaxListeners` and `getMaxListeners`Gravatar Jarred Sumner 1-1/+46 2022-10-21Fix `import Foo, {bar}` when from hardcoded builtin modules in runtimeGravatar Jarred Sumner 2-19/+34 2022-10-21Fix test failureGravatar Jarred Sumner 1-2/+3 2022-10-21Reload node:fs in developmentGravatar Jarred Sumner 1-0/+9 2022-10-21chore: remove outdated `var` usages (#1364)Gravatar Carter Snook 1-34/+34 2022-10-21Fix "/" in exampleGravatar Jarred Sumner 1-3/+10 2022-10-21Fix infinite loopGravatar Jarred Sumner 1-3/+13 2022-10-21micro-optimizeGravatar Jarred Sumner 1-7/+14 2022-10-20Update install script to use secure flagsGravatar Ashcon Partovi 2-5/+5 2022-10-20Add installation method for HomebrewGravatar Ashcon Partovi 1-0/+7 2022-10-20Fix crash in `highWaterMark`Gravatar Jarred Sumner 1-143/+144 2022-10-20Fix Bun.serve error handler error param (#1359)Gravatar zhiyuan 7-4/+37 2022-10-19Fix calling `ws.publish` inside `close` when other clients are connectedGravatar Jarred Sumner 3-28/+111 2022-10-19Cache dir loader: Prefer `$BUN_INSTALL` and `$XDG_CACHE_HOME` to `$HOME`. (#1...Gravatar Lucas Garron 1-5/+5 2022-10-19Improve issue templates (#1353)Gravatar Ashcon Partovi 8-89/+136