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

Unified Diff: public/platform/WebCryptoAlgorithmParams.h

Issue 21759002: WebCrypto: Add algorithm normalization rules for RSASSA-PKCS1-v1_5. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 7 years, 5 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 | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCryptoAlgorithmParams.h
diff --git a/public/platform/WebCryptoAlgorithmParams.h b/public/platform/WebCryptoAlgorithmParams.h
index 37056bb3ccb6ad8e5d898f7c96d70d6287a4162a..08defe7a869f804f2cff86ba5bdab9eee7de6c52 100644
--- a/public/platform/WebCryptoAlgorithmParams.h
+++ b/public/platform/WebCryptoAlgorithmParams.h
@@ -46,7 +46,7 @@ namespace WebKit {
class WebCryptoAlgorithmParams {
public:
- WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsType type)
+ explicit WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsType type)
: m_type(type)
{
}
@@ -75,7 +75,7 @@ private:
class WebCryptoAesKeyGenParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoAesKeyGenParams(unsigned short length)
+ explicit WebCryptoAesKeyGenParams(unsigned short length)
: WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeAesKeyGenParams)
, m_length(length)
{
@@ -89,7 +89,7 @@ private:
class WebCryptoHmacParams : public WebCryptoAlgorithmParams {
public:
- WebCryptoHmacParams(const WebCryptoAlgorithm& hash)
+ explicit WebCryptoHmacParams(const WebCryptoAlgorithm& hash)
: WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeHmacParams)
, m_hash(hash)
{
@@ -101,6 +101,37 @@ private:
WebCryptoAlgorithm m_hash;
};
+class WebCryptoRsaSsaParams : public WebCryptoAlgorithmParams {
+public:
+ explicit WebCryptoRsaSsaParams(const WebCryptoAlgorithm& hash)
+ : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaSsaParams)
+ , m_hash(hash)
+ {
+ }
+
+ const WebCryptoAlgorithm& hash() const { return m_hash; }
+
+private:
+ WebCryptoAlgorithm m_hash;
+};
+
+class WebCryptoRsaKeyGenParams : public WebCryptoAlgorithmParams {
+public:
+ WebCryptoRsaKeyGenParams(unsigned modulusLength, const unsigned char* publicExponent, size_t publicExponentSize)
+ : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaKeyGenParams)
+ , m_modulusLength(modulusLength)
+ , m_publicExponent(publicExponent, publicExponentSize)
+ {
+ }
+
+ unsigned modulusLength() const { return m_modulusLength; }
+ const WebVector<unsigned char>& publicExponent() const { return m_publicExponent; }
+
+private:
+ const unsigned m_modulusLength;
+ const WebVector<unsigned char> m_publicExponent;
+};
+
} // namespace WebKit
#endif
« no previous file with comments | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698