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

Side by Side Diff: content/renderer/webcrypto/platform_crypto.h

Issue 178073007: [webcrypto] Update to use the KeyAlgorithm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unrelated change that makes public keys extractable Created 6 years, 10 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
« no previous file with comments | « content/renderer/webcrypto/jwk.cc ('k') | content/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_
6 #define CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ 6 #define CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" 10 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // * keylen_bytes is non-zero (TODO(eroman): revisit this). 115 // * keylen_bytes is non-zero (TODO(eroman): revisit this).
116 // * For AES algorithms |keylen_bytes| is either 16, 24, or 32 bytes long. 116 // * For AES algorithms |keylen_bytes| is either 16, 24, or 32 bytes long.
117 Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, 117 Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
118 bool extractable, 118 bool extractable,
119 blink::WebCryptoKeyUsageMask usage_mask, 119 blink::WebCryptoKeyUsageMask usage_mask,
120 unsigned keylen_bytes, 120 unsigned keylen_bytes,
121 blink::WebCryptoKey* key); 121 blink::WebCryptoKey* key);
122 122
123 // Preconditions: 123 // Preconditions:
124 // * algorithm.id() is for an RSA algorithm. 124 // * algorithm.id() is for an RSA algorithm.
125 // * algorithm.rsaKeyGenParams() is non-null. 125 // * public_exponent, modulus_length_bits and hash_or_null are the same as what
126 // is in algorithm. They are split out for convenience.
127 // * hash_or_null.isNull() may be true if a hash is not applicable to the
128 // algorithm
129 // * modulus_length_bits is not 0
130 // * public_exponent is not empty.
126 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, 131 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm,
127 bool extractable, 132 bool extractable,
128 blink::WebCryptoKeyUsageMask usage_mask, 133 blink::WebCryptoKeyUsageMask usage_mask,
134 unsigned int modulus_length_bits,
135 const CryptoData& public_exponent,
136 const blink::WebCryptoAlgorithm& hash,
129 blink::WebCryptoKey* public_key, 137 blink::WebCryptoKey* public_key,
130 blink::WebCryptoKey* private_key); 138 blink::WebCryptoKey* private_key);
131 139
132 // Preconditions: 140 // Preconditions:
133 // * |key| is non-null. 141 // * |key| is non-null.
134 // * |algorithm.id()| is for a symmetric key algorithm. 142 // * |algorithm.id()| is for a symmetric key algorithm.
135 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long. 143 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long.
136 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm, 144 Status ImportKeyRaw(const blink::WebCryptoAlgorithm& algorithm,
137 const CryptoData& key_data, 145 const CryptoData& key_data,
138 bool extractable, 146 bool extractable,
(...skipping 29 matching lines...) Expand all
168 // * |key| is non-null. 176 // * |key| is non-null.
169 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer); 177 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer);
170 178
171 } // namespace platform 179 } // namespace platform
172 180
173 } // namespace webcrypto 181 } // namespace webcrypto
174 182
175 } // namespace content 183 } // namespace content
176 184
177 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ 185 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_
OLDNEW
« no previous file with comments | « content/renderer/webcrypto/jwk.cc ('k') | content/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698