1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/child/webcrypto/algorithm_implementation.h"
7 #include "content/child/webcrypto/status.h"
13 AlgorithmImplementation::~AlgorithmImplementation() {
16 Status AlgorithmImplementation::Encrypt(
17 const blink::WebCryptoAlgorithm& algorithm,
18 const blink::WebCryptoKey& key,
19 const CryptoData& data,
20 std::vector<uint8_t>* buffer) const {
21 return Status::ErrorUnsupported();
24 Status AlgorithmImplementation::Decrypt(
25 const blink::WebCryptoAlgorithm& algorithm,
26 const blink::WebCryptoKey& key,
27 const CryptoData& data,
28 std::vector<uint8_t>* buffer) const {
29 return Status::ErrorUnsupported();
32 Status AlgorithmImplementation::Sign(const blink::WebCryptoAlgorithm& algorithm,
33 const blink::WebCryptoKey& key,
34 const CryptoData& data,
35 std::vector<uint8_t>* buffer) const {
36 return Status::ErrorUnsupported();
39 Status AlgorithmImplementation::Verify(
40 const blink::WebCryptoAlgorithm& algorithm,
41 const blink::WebCryptoKey& key,
42 const CryptoData& signature,
43 const CryptoData& data,
44 bool* signature_match) const {
45 return Status::ErrorUnsupported();
48 Status AlgorithmImplementation::Digest(
49 const blink::WebCryptoAlgorithm& algorithm,
50 const CryptoData& data,
51 std::vector<uint8_t>* buffer) const {
52 return Status::ErrorUnsupported();
55 Status AlgorithmImplementation::GenerateKey(
56 const blink::WebCryptoAlgorithm& algorithm,
58 blink::WebCryptoKeyUsageMask usages,
59 GenerateKeyResult* result) const {
60 return Status::ErrorUnsupported();
63 Status AlgorithmImplementation::VerifyKeyUsagesBeforeImportKey(
64 blink::WebCryptoKeyFormat format,
65 blink::WebCryptoKeyUsageMask usages) const {
66 return Status::ErrorUnsupportedImportKeyFormat();
69 Status AlgorithmImplementation::ImportKeyRaw(
70 const CryptoData& key_data,
71 const blink::WebCryptoAlgorithm& algorithm,
73 blink::WebCryptoKeyUsageMask usages,
74 blink::WebCryptoKey* key) const {
75 return Status::ErrorUnsupportedImportKeyFormat();
78 Status AlgorithmImplementation::ImportKeyPkcs8(
79 const CryptoData& key_data,
80 const blink::WebCryptoAlgorithm& algorithm,
82 blink::WebCryptoKeyUsageMask usages,
83 blink::WebCryptoKey* key) const {
84 return Status::ErrorUnsupportedImportKeyFormat();
87 Status AlgorithmImplementation::ImportKeySpki(
88 const CryptoData& key_data,
89 const blink::WebCryptoAlgorithm& algorithm,
91 blink::WebCryptoKeyUsageMask usages,
92 blink::WebCryptoKey* key) const {
93 return Status::ErrorUnsupportedImportKeyFormat();
96 Status AlgorithmImplementation::ImportKeyJwk(
97 const CryptoData& key_data,
98 const blink::WebCryptoAlgorithm& algorithm,
100 blink::WebCryptoKeyUsageMask usages,
101 blink::WebCryptoKey* key) const {
102 return Status::ErrorUnsupportedImportKeyFormat();
105 Status AlgorithmImplementation::ExportKeyRaw(
106 const blink::WebCryptoKey& key,
107 std::vector<uint8_t>* buffer) const {
108 return Status::ErrorUnsupportedExportKeyFormat();
111 Status AlgorithmImplementation::ExportKeyPkcs8(
112 const blink::WebCryptoKey& key,
113 std::vector<uint8_t>* buffer) const {
114 return Status::ErrorUnsupportedExportKeyFormat();
117 Status AlgorithmImplementation::ExportKeySpki(
118 const blink::WebCryptoKey& key,
119 std::vector<uint8_t>* buffer) const {
120 return Status::ErrorUnsupportedExportKeyFormat();
123 Status AlgorithmImplementation::ExportKeyJwk(
124 const blink::WebCryptoKey& key,
125 std::vector<uint8_t>* buffer) const {
126 return Status::ErrorUnsupportedExportKeyFormat();
129 } // namespace webcrypto
131 } // namespace content