Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: content/child/webcrypto/shared_crypto.cc

Issue 287133004: [webcrypto] Add JWK import/export of RSA private keys (NSS). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment typeo Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/webcrypto/shared_crypto.h ('k') | content/child/webcrypto/shared_crypto_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index 7d4704fc656ec7aca87fdefa3ffe22201bd70608..92fdc6f3d0c44ffa752c7a7f3c436b141157b07b 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -47,30 +47,6 @@ bool IsValidAesKeyLengthBytes(unsigned int length_bytes) {
return length_bytes == 16 || length_bytes == 24 || length_bytes == 32;
}
-Status ToPlatformSymKey(const blink::WebCryptoKey& key,
- platform::SymKey** out) {
- *out = static_cast<platform::Key*>(key.handle())->AsSymKey();
- if (!*out)
- return Status::ErrorUnexpectedKeyType();
- return Status::Success();
-}
-
-Status ToPlatformPublicKey(const blink::WebCryptoKey& key,
- platform::PublicKey** out) {
- *out = static_cast<platform::Key*>(key.handle())->AsPublicKey();
- if (!*out)
- return Status::ErrorUnexpectedKeyType();
- return Status::Success();
-}
-
-Status ToPlatformPrivateKey(const blink::WebCryptoKey& key,
- platform::PrivateKey** out) {
- *out = static_cast<platform::Key*>(key.handle())->AsPrivateKey();
- if (!*out)
- return Status::ErrorUnexpectedKeyType();
- return Status::Success();
-}
-
const size_t kAesBlockSizeBytes = 16;
Status EncryptDecryptAesCbc(EncryptOrDecrypt mode,
@@ -848,6 +824,30 @@ bool DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
return ValidateDeserializedKey(*key, algorithm, type);
}
+Status ToPlatformSymKey(const blink::WebCryptoKey& key,
+ platform::SymKey** out) {
+ *out = static_cast<platform::Key*>(key.handle())->AsSymKey();
+ if (!*out)
+ return Status::ErrorUnexpectedKeyType();
+ return Status::Success();
+}
+
+Status ToPlatformPublicKey(const blink::WebCryptoKey& key,
+ platform::PublicKey** out) {
+ *out = static_cast<platform::Key*>(key.handle())->AsPublicKey();
+ if (!*out)
+ return Status::ErrorUnexpectedKeyType();
+ return Status::Success();
+}
+
+Status ToPlatformPrivateKey(const blink::WebCryptoKey& key,
+ platform::PrivateKey** out) {
+ *out = static_cast<platform::Key*>(key.handle())->AsPrivateKey();
+ if (!*out)
+ return Status::ErrorUnexpectedKeyType();
+ return Status::Success();
+}
+
} // namespace webcrypto
} // namespace content
« no previous file with comments | « content/child/webcrypto/shared_crypto.h ('k') | content/child/webcrypto/shared_crypto_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698