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

Side by Side 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: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 , m_hash(hash) 94 , m_hash(hash)
95 { 95 {
96 } 96 }
97 97
98 const WebCryptoAlgorithm& hash() const { return m_hash; } 98 const WebCryptoAlgorithm& hash() const { return m_hash; }
99 99
100 private: 100 private:
101 WebCryptoAlgorithm m_hash; 101 WebCryptoAlgorithm m_hash;
102 }; 102 };
103 103
104 class WebCryptoRsaSsaParams : public WebCryptoAlgorithmParams {
105 public:
106 WebCryptoRsaSsaParams(const WebCryptoAlgorithm& hash)
abarth-chromium 2013/08/02 17:56:56 explicit?
eroman 2013/08/02 19:25:42 Done.
107 : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaSsaParams)
108 , m_hash(hash)
109 {
110 }
111
112 const WebCryptoAlgorithm& hash() const { return m_hash; }
113
114 private:
115 WebCryptoAlgorithm m_hash;
116 };
117
118 class WebCryptoRsaKeyGenParams : public WebCryptoAlgorithmParams {
119 public:
120 WebCryptoRsaKeyGenParams(unsigned modulusLength, const unsigned char* public Exponent, size_t publicExponentSize)
121 : WebCryptoAlgorithmParams(WebCryptoAlgorithmParamsTypeRsaKeyGenParams)
122 , m_modulusLength(modulusLength)
123 , m_publicExponent(publicExponent, publicExponentSize)
124 {
125 }
126
127 unsigned modulusLength() const { return m_modulusLength; }
128 const WebVector<unsigned char>& publicExponent() const { return m_publicExpo nent; }
129
130 private:
131 const unsigned m_modulusLength;
132 const WebVector<unsigned char> m_publicExponent;
133 };
134
104 } // namespace WebKit 135 } // namespace WebKit
105 136
106 #endif 137 #endif
OLDNEW
« Source/modules/crypto/NormalizeAlgorithm.cpp ('K') | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698