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

Unified Diff: Source/platform/exported/WebCryptoKeyAlgorithm.cpp

Issue 707743002: WebCrypto: Add ECDSA algorithm (Blink side). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 6 years, 1 month 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 | « Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/exported/WebCryptoKeyAlgorithm.cpp
diff --git a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
index 1648380c10dc3fba795ed0fa9e10c00e1096c973..bef587d0d25dbd6e796cacba6688ed7e2bc256b6 100644
--- a/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
+++ b/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
@@ -88,6 +88,11 @@ WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed(WebCryptoAlgorithmI
return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoRsaHashedKeyAlgorithmParams(modulusLengthBits, publicExponent, publicExponentSize, createHash(hash))));
}
+WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createEc(WebCryptoAlgorithmId id, WebCryptoNamedCurve namedCurve)
+{
+ return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoEcKeyAlgorithmParams(namedCurve)));
+}
+
bool WebCryptoKeyAlgorithm::isNull() const
{
return m_private.isNull();
@@ -131,6 +136,14 @@ WebCryptoRsaHashedKeyAlgorithmParams* WebCryptoKeyAlgorithm::rsaHashedParams() c
return 0;
}
+WebCryptoEcKeyAlgorithmParams* WebCryptoKeyAlgorithm::ecParams() const
+{
+ ASSERT(!isNull());
+ if (paramsType() == WebCryptoKeyAlgorithmParamsTypeEc)
+ return static_cast<WebCryptoEcKeyAlgorithmParams*>(m_private->params.get());
+ return 0;
+}
+
void WebCryptoKeyAlgorithm::writeToDictionary(WebCryptoKeyAlgorithmDictionary* dict) const
{
ASSERT(!isNull());
« no previous file with comments | « Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698