Index: public/platform/WebCryptoKeyAlgorithmParams.h |
diff --git a/public/platform/WebCryptoKeyAlgorithmParams.h b/public/platform/WebCryptoKeyAlgorithmParams.h |
index 903d32c146a58b3d65bb7b09d1ec13487f2b7da9..3450c02e427ae1c2eaeaaf52f5372e84a12a8c7a 100644 |
--- a/public/platform/WebCryptoKeyAlgorithmParams.h |
+++ b/public/platform/WebCryptoKeyAlgorithmParams.h |
@@ -53,7 +53,8 @@ enum WebCryptoKeyAlgorithmParamsType { |
WebCryptoKeyAlgorithmParamsTypeNone, |
WebCryptoKeyAlgorithmParamsTypeHmac, |
WebCryptoKeyAlgorithmParamsTypeAes, |
- WebCryptoKeyAlgorithmParamsTypeRsaHashed |
+ WebCryptoKeyAlgorithmParamsTypeRsaHashed, |
+ WebCryptoKeyAlgorithmParamsTypeEc, |
}; |
class WebCryptoKeyAlgorithmParams { |
@@ -169,6 +170,42 @@ private: |
WebCryptoAlgorithm m_hash; |
}; |
+class WebCryptoEcKeyAlgorithmParams : public WebCryptoKeyAlgorithmParams { |
+public: |
+ explicit WebCryptoEcKeyAlgorithmParams(WebCryptoNamedCurve namedCurve) |
+ : m_namedCurve(namedCurve) |
+ { |
+ } |
+ |
+ WebCryptoNamedCurve namedCurve() const |
+ { |
+ return m_namedCurve; |
+ } |
+ |
+ virtual WebCryptoKeyAlgorithmParamsType type() const |
+ { |
+ return WebCryptoKeyAlgorithmParamsTypeEc; |
+ } |
+ |
+ virtual void writeToDictionary(WebCryptoKeyAlgorithmDictionary* dict) const |
+ { |
+ switch (m_namedCurve) { |
+ case WebCryptoNamedCurveP256: |
+ dict->setString("namedCurve", "P-256"); |
+ break; |
+ case WebCryptoNamedCurveP384: |
+ dict->setString("namedCurve", "P-384"); |
+ break; |
+ case WebCryptoNamedCurveP521: |
+ dict->setString("namedCurve", "P-521"); |
+ break; |
+ } |
+ } |
+ |
+private: |
+ const WebCryptoNamedCurve m_namedCurve; |
+}; |
+ |
} // namespace blink |
#endif |