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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, unsigned signatureSize, const unsigned char* da
ta, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } | 192 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, unsigned signatureSize, const unsigned char* da
ta, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } |
193 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, un
signed dataSize, WebCryptoResult result) { result.completeWithError(); } | 193 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, un
signed dataSize, WebCryptoResult result) { result.completeWithError(); } |
194 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } | 194 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } |
195 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, uns
igned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsag
eMask, WebCryptoResult result) { result.completeWithError(); } | 195 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, uns
igned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsag
eMask, WebCryptoResult result) { result.completeWithError(); } |
196 virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoRes
ult result) { result.completeWithError(); } | 196 virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoRes
ult result) { result.completeWithError(); } |
197 virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebC
ryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { resu
lt.completeWithError(); } | 197 virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebC
ryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { resu
lt.completeWithError(); } |
198 virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey,
unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAl
gorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebC
ryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } | 198 virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey,
unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAl
gorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebC
ryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } |
199 | 199 |
200 // This is the exception to the "Completing the request" guarantees | 200 // This is the exception to the "Completing the request" guarantees |
201 // outlined above. This is useful for Blink internal crypto and is not part | 201 // outlined above. This is useful for Blink internal crypto and is not part |
202 // of the WebCrypto standard. digestSynchronous returns |true| if the | 202 // of the WebCrypto standard. createDigestor must provide the result via |
203 // digest was successfully computed and put into result. Otherwise, returns | 203 // the WebCryptoDigestor object synchronously. createDigestor may return 0 |
204 // |false|. It must compute the digest or fail synchronously. | 204 // if it fails to create a WebCryptoDigestor. If it succeeds, the |
205 // createDigestor must provide the result via the WebCryptoDigestor object | 205 // WebCryptoDigestor returned by createDigestor must be freed by the |
206 // synchronously. createDigestor may return 0 if it fails to create a | 206 // caller. |
207 // WebCryptoDigestor. If it succeeds, the WebCryptoDigestor returned by | |
208 // createDigestor must be freed by the caller. | |
209 virtual bool digestSynchronous(const WebCryptoAlgorithmId algorithmId, const
unsigned char* data, unsigned dataSize, WebArrayBuffer& result) { return false;
} | |
210 virtual WebCryptoDigestor* createDigestor(WebCryptoAlgorithmId algorithmId)
{ return 0; } | 207 virtual WebCryptoDigestor* createDigestor(WebCryptoAlgorithmId algorithmId)
{ return 0; } |
211 | 208 |
212 // ----------------------- | 209 // ----------------------- |
213 // Structured clone | 210 // Structured clone |
214 // ----------------------- | 211 // ----------------------- |
215 // | 212 // |
216 // deserializeKeyForClone() and serializeKeyForClone() are used for | 213 // deserializeKeyForClone() and serializeKeyForClone() are used for |
217 // implementing structured cloning of WebCryptoKey. | 214 // implementing structured cloning of WebCryptoKey. |
218 // | 215 // |
219 // Blink is responsible for saving and restoring all of the attributes of | 216 // Blink is responsible for saving and restoring all of the attributes of |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Returns true on success. | 254 // Returns true on success. |
258 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } | 255 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } |
259 | 256 |
260 protected: | 257 protected: |
261 virtual ~WebCrypto() { } | 258 virtual ~WebCrypto() { } |
262 }; | 259 }; |
263 | 260 |
264 } // namespace blink | 261 } // namespace blink |
265 | 262 |
266 #endif | 263 #endif |
OLD | NEW |