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

Unified Diff: trunk/public/platform/WebCryptoAlgorithmParams.h

Issue 296333002: Revert 174726 "[webcrypto] Remove RSA-ES support (3 of 3)" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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 | « trunk/public/platform/WebCryptoAlgorithm.h ('k') | trunk/public/platform/WebCryptoKeyAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/public/platform/WebCryptoAlgorithmParams.h
===================================================================
--- trunk/public/platform/WebCryptoAlgorithmParams.h (revision 174732)
+++ trunk/public/platform/WebCryptoAlgorithmParams.h (working copy)
@@ -150,6 +150,24 @@
const unsigned m_optionalLengthBits;
};
+class WebCryptoRsaKeyGenParams : public WebCryptoAlgorithmParams {
+public:
+ WebCryptoRsaKeyGenParams(unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize)
+ : m_modulusLengthBits(modulusLengthBits)
+ , m_publicExponent(publicExponent, publicExponentSize)
+ {
+ }
+
+ virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaKeyGenParams; }
+
+ unsigned modulusLengthBits() const { return m_modulusLengthBits; }
+ const WebVector<unsigned char>& publicExponent() const { return m_publicExponent; }
+
+private:
+ const unsigned m_modulusLengthBits;
+ const WebVector<unsigned char> m_publicExponent;
+};
+
class WebCryptoAesGcmParams : public WebCryptoAlgorithmParams {
public:
WebCryptoAesGcmParams(const unsigned char* iv, unsigned ivSize, bool hasAdditionalData, const unsigned char* additionalData, unsigned additionalDataSize, bool hasTagLengthBits, unsigned char tagLengthBits)
@@ -191,11 +209,10 @@
virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaHashedImportParams; }
};
-class WebCryptoRsaHashedKeyGenParams : public WebCryptoAlgorithmParams {
+class WebCryptoRsaHashedKeyGenParams : public WebCryptoRsaKeyGenParams {
public:
explicit WebCryptoRsaHashedKeyGenParams(const WebCryptoAlgorithm& hash, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize)
- : m_modulusLengthBits(modulusLengthBits)
- , m_publicExponent(publicExponent, publicExponentSize)
+ : WebCryptoRsaKeyGenParams(modulusLengthBits, publicExponent, publicExponentSize)
, m_hash(hash)
{
BLINK_ASSERT(!hash.isNull());
@@ -203,13 +220,9 @@
virtual WebCryptoAlgorithmParamsType type() const { return WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams; }
- unsigned modulusLengthBits() const { return m_modulusLengthBits; }
- const WebVector<unsigned char>& publicExponent() const { return m_publicExponent; }
const WebCryptoAlgorithm& hash() const { return m_hash; }
private:
- const unsigned m_modulusLengthBits;
- const WebVector<unsigned char> m_publicExponent;
const WebCryptoAlgorithm m_hash;
};
« no previous file with comments | « trunk/public/platform/WebCryptoAlgorithm.h ('k') | trunk/public/platform/WebCryptoKeyAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698