OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 Status ToPlatformSymKey(const blink::WebCryptoKey& key, platform::SymKey** out); | 169 Status ToPlatformSymKey(const blink::WebCryptoKey& key, platform::SymKey** out); |
170 | 170 |
171 Status ToPlatformPublicKey(const blink::WebCryptoKey& key, | 171 Status ToPlatformPublicKey(const blink::WebCryptoKey& key, |
172 platform::PublicKey** out); | 172 platform::PublicKey** out); |
173 | 173 |
174 Status ToPlatformPrivateKey(const blink::WebCryptoKey& key, | 174 Status ToPlatformPrivateKey(const blink::WebCryptoKey& key, |
175 platform::PrivateKey** out); | 175 platform::PrivateKey** out); |
176 | 176 |
| 177 // Returns Staus::Success() if |usages| is valid for |key_type| and |algorithm|. |
| 178 // Otherwise returns a failure |
| 179 Status CheckKeyUsages(blink::WebCryptoAlgorithmId algorithm, |
| 180 blink::WebCryptoKeyType key_type, |
| 181 blink::WebCryptoKeyUsageMask usages); |
| 182 |
177 } // namespace webcrypto | 183 } // namespace webcrypto |
178 | 184 |
179 } // namespace content | 185 } // namespace content |
180 | 186 |
181 #endif // CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ | 187 #endif // CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ |
OLD | NEW |