aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/webcrypto/SerializedCryptoKeyWrap.h
blob: f1cf020586aea48e6dbbc6d5230d22b4c3e8c652 (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) 2014 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

#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

// The purpose of the following APIs is to protect serialized CryptoKey data in IndexedDB or
// any other local storage that go through the structured clone algorithm. However, a side effect
// of this extra layer of protection is redundant communications between mainThread(document) and
// workerThreads. Please refer to WorkerGlobalScope for detailed explanation. P.S. This extra layer
// of protection is not required by the spec as of 11 December 2014:
// https://www.w3.org/TR/WebCryptoAPI/#security-developers

WEBCORE_EXPORT std::optional<Vector<uint8_t>> defaultWebCryptoMasterKey();
WEBCORE_EXPORT bool deleteDefaultWebCryptoMasterKey();

WEBCORE_EXPORT bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result);
WEBCORE_EXPORT bool unwrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key);

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
ack&id=495ee7d4aef9c03ab188a6f77493e67385ef7714&follow=1'>commitdiff
path: root/examples/blog/astro.config.mjs (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2021-05-13chore: format workflow, format `.astro` files (#211)Gravatar Nate Moore 2-1/+2
2021-05-13chore: release astro-vscodeGravatar Nate Moore 6-148/+30
2021-05-13Version Packages (#195)Gravatar github-actions[bot] 23-65/+43
2021-05-13Support for import suggestions in the languageserver (#204)Gravatar Matthew Phillips 6-12/+32
2021-05-13Fix Svelte build output (#201)Gravatar Nate Moore 4-8/+14
2021-05-12[wip] Fix CI (#202)Gravatar Drew Powers 28-219/+191
2021-05-11VS Code extension (#197)Gravatar Matthew Phillips 7-20/+182
2021-05-11Fix workflows! (#198)Gravatar Nate Moore 3-2/+4
2021-05-11Add Astro.request.canonicalURL and Astro.site to global (#199)Gravatar Drew Powers 25-98/+234
2021-05-11Fix portfolio example (#196)Gravatar Drew Powers 2-3/+5
2021-05-10fix: build stuck on unhandled promise reject (#191)Gravatar Kevin (Kun) "Kassimo" Qian 2-2/+13
2021-05-10Allow default import component to be renamed based on import statement defaul...Gravatar Kevin (Kun) "Kassimo" Qian 3-8/+30
2021-05-08Add more docs on styling (#186)Gravatar Drew Powers 1-3/+321
2021-05-08Fix running the extension (#181)Gravatar Matthew Phillips 5-11/+37