OLD | NEW |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 virtual void deriveBits(const WebCryptoAlgorithm&, const WebCryptoKey&, unsi
gned length, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTy
peNotSupported, ""); } | 209 virtual void deriveBits(const WebCryptoAlgorithm&, const WebCryptoKey&, unsi
gned length, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTy
peNotSupported, ""); } |
210 virtual void deriveKey(const WebCryptoAlgorithm& algorithm, const WebCryptoK
ey& baseKey, const WebCryptoAlgorithm& importAlgorithm, const WebCryptoAlgorithm
& keyLengthAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult r
esult) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } | 210 virtual void deriveKey(const WebCryptoAlgorithm& algorithm, const WebCryptoK
ey& baseKey, const WebCryptoAlgorithm& importAlgorithm, const WebCryptoAlgorithm
& keyLengthAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult r
esult) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
211 | 211 |
212 // This is the exception to the "Completing the request" guarantees | 212 // This is the exception to the "Completing the request" guarantees |
213 // outlined above. This is useful for Blink internal crypto and is not part | 213 // outlined above. This is useful for Blink internal crypto and is not part |
214 // of the WebCrypto standard. createDigestor must provide the result via | 214 // of the WebCrypto standard. createDigestor must provide the result via |
215 // the WebCryptoDigestor object synchronously. createDigestor may return 0 | 215 // the WebCryptoDigestor object synchronously. createDigestor may return 0 |
216 // if it fails to create a WebCryptoDigestor. If it succeeds, the | 216 // if it fails to create a WebCryptoDigestor. If it succeeds, the |
217 // WebCryptoDigestor returned by createDigestor must be freed by the | 217 // WebCryptoDigestor returned by createDigestor must be freed by the |
218 // caller. | 218 // caller. |
219 virtual WebCryptoDigestor* createDigestor(WebCryptoAlgorithmId algorithmId)
{ return 0; } | 219 virtual WebCryptoDigestor* createDigestor(WebCryptoAlgorithmId algorithmId)
{ return nullptr; } |
220 | 220 |
221 // ----------------------- | 221 // ----------------------- |
222 // Structured clone | 222 // Structured clone |
223 // ----------------------- | 223 // ----------------------- |
224 // | 224 // |
225 // deserializeKeyForClone() and serializeKeyForClone() are used for | 225 // deserializeKeyForClone() and serializeKeyForClone() are used for |
226 // implementing structured cloning of WebCryptoKey. | 226 // implementing structured cloning of WebCryptoKey. |
227 // | 227 // |
228 // Blink is responsible for saving and restoring all of the attributes of | 228 // Blink is responsible for saving and restoring all of the attributes of |
229 // WebCryptoKey EXCEPT for the actual key data: | 229 // WebCryptoKey EXCEPT for the actual key data: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Returns true on success. | 266 // Returns true on success. |
267 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } | 267 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } |
268 | 268 |
269 protected: | 269 protected: |
270 virtual ~WebCrypto() { } | 270 virtual ~WebCrypto() { } |
271 }; | 271 }; |
272 | 272 |
273 } // namespace blink | 273 } // namespace blink |
274 | 274 |
275 #endif // WebCrypto_h | 275 #endif // WebCrypto_h |
OLD | NEW |