Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / child / webcrypto / algorithm_implementation.cc
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.
4
5 #include "content/child/webcrypto/algorithm_implementation.h"
6
7 #include "content/child/webcrypto/status.h"
8
9 namespace content {
10
11 namespace webcrypto {
12
13 AlgorithmImplementation::~AlgorithmImplementation() {
14 }
15
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();
22 }
23
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();
30 }
31
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();
37 }
38
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();
46 }
47
48 Status AlgorithmImplementation::Digest(
49     const blink::WebCryptoAlgorithm& algorithm,
50     const CryptoData& data,
51     std::vector<uint8_t>* buffer) const {
52   return Status::ErrorUnsupported();
53 }
54
55 Status AlgorithmImplementation::GenerateKey(
56     const blink::WebCryptoAlgorithm& algorithm,
57     bool extractable,
58     blink::WebCryptoKeyUsageMask usages,
59     GenerateKeyResult* result) const {
60   return Status::ErrorUnsupported();
61 }
62
63 Status AlgorithmImplementation::VerifyKeyUsagesBeforeImportKey(
64     blink::WebCryptoKeyFormat format,
65     blink::WebCryptoKeyUsageMask usages) const {
66   return Status::ErrorUnsupportedImportKeyFormat();
67 }
68
69 Status AlgorithmImplementation::ImportKeyRaw(
70     const CryptoData& key_data,
71     const blink::WebCryptoAlgorithm& algorithm,
72     bool extractable,
73     blink::WebCryptoKeyUsageMask usages,
74     blink::WebCryptoKey* key) const {
75   return Status::ErrorUnsupportedImportKeyFormat();
76 }
77
78 Status AlgorithmImplementation::ImportKeyPkcs8(
79     const CryptoData& key_data,
80     const blink::WebCryptoAlgorithm& algorithm,
81     bool extractable,
82     blink::WebCryptoKeyUsageMask usages,
83     blink::WebCryptoKey* key) const {
84   return Status::ErrorUnsupportedImportKeyFormat();
85 }
86
87 Status AlgorithmImplementation::ImportKeySpki(
88     const CryptoData& key_data,
89     const blink::WebCryptoAlgorithm& algorithm,
90     bool extractable,
91     blink::WebCryptoKeyUsageMask usages,
92     blink::WebCryptoKey* key) const {
93   return Status::ErrorUnsupportedImportKeyFormat();
94 }
95
96 Status AlgorithmImplementation::ImportKeyJwk(
97     const CryptoData& key_data,
98     const blink::WebCryptoAlgorithm& algorithm,
99     bool extractable,
100     blink::WebCryptoKeyUsageMask usages,
101     blink::WebCryptoKey* key) const {
102   return Status::ErrorUnsupportedImportKeyFormat();
103 }
104
105 Status AlgorithmImplementation::ExportKeyRaw(
106     const blink::WebCryptoKey& key,
107     std::vector<uint8_t>* buffer) const {
108   return Status::ErrorUnsupportedExportKeyFormat();
109 }
110
111 Status AlgorithmImplementation::ExportKeyPkcs8(
112     const blink::WebCryptoKey& key,
113     std::vector<uint8_t>* buffer) const {
114   return Status::ErrorUnsupportedExportKeyFormat();
115 }
116
117 Status AlgorithmImplementation::ExportKeySpki(
118     const blink::WebCryptoKey& key,
119     std::vector<uint8_t>* buffer) const {
120   return Status::ErrorUnsupportedExportKeyFormat();
121 }
122
123 Status AlgorithmImplementation::ExportKeyJwk(
124     const blink::WebCryptoKey& key,
125     std::vector<uint8_t>* buffer) const {
126   return Status::ErrorUnsupportedExportKeyFormat();
127 }
128
129 }  // namespace webcrypto
130
131 }  // namespace content