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

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

Issue 203753009: [webcrypto] Add PKCS#8 export for RSA private keys for NSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static Created 6 years, 9 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
Index: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index 63af5768b33c756b31bdcb4082716135b460ac3e..4ef57157236a8eeedff1f1c452698f5c68b85371 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -607,11 +607,15 @@ Status ExportKeyDontCheckExtractability(blink::WebCryptoKeyFormat format,
return status;
return platform::ExportKeySpki(public_key, buffer);
}
+ case blink::WebCryptoKeyFormatPkcs8: {
+ platform::PrivateKey* private_key;
+ Status status = ToPlatformPrivateKey(key, &private_key);
+ if (status.IsError())
+ return status;
+ return platform::ExportKeyPkcs8(private_key, key.algorithm(), buffer);
+ }
case blink::WebCryptoKeyFormatJwk:
return ExportKeyJwk(key, buffer);
- case blink::WebCryptoKeyFormatPkcs8:
- // TODO(eroman):
- return Status::ErrorUnsupported();
default:
return Status::ErrorUnsupported();
}

Powered by Google App Engine
This is Rietveld 408576698