| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // "verifySignature". | 173 // "verifySignature". |
| 174 // | 174 // |
| 175 // ----------------------- | 175 // ----------------------- |
| 176 // Guarantees on input validity | 176 // Guarantees on input validity |
| 177 // ----------------------- | 177 // ----------------------- |
| 178 // | 178 // |
| 179 // Implementations MUST carefully sanitize algorithm inputs before using | 179 // Implementations MUST carefully sanitize algorithm inputs before using |
| 180 // them, as they come directly from the user. Few checks have been done on | 180 // them, as they come directly from the user. Few checks have been done on |
| 181 // algorithm parameters prior to passing to the embedder. | 181 // algorithm parameters prior to passing to the embedder. |
| 182 // | 182 // |
| 183 // Only the following checks can be assumed as having alread passed: | 183 // Only the following checks can be assumed as having already passed: |
| 184 // | 184 // |
| 185 // * The key is extractable when calling into exportKey/wrapKey. | 185 // * The key is extractable when calling into exportKey/wrapKey. |
| 186 // * The key usages permit the operation being requested. | 186 // * The key usages permit the operation being requested. |
| 187 // * The key's algorithm matches that of the requested operation. | 187 // * The key's algorithm matches that of the requested operation. |
| 188 // | 188 // |
| 189 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } | 189 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } |
| 190 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } | 190 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } |
| 191 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWit
hError(); } | 191 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWit
hError(); } |
| 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(); } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // Returns true on success. | 254 // Returns true on success. |
| 255 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } | 255 virtual bool serializeKeyForClone(const WebCryptoKey&, WebVector<unsigned ch
ar>&) { return false; } |
| 256 | 256 |
| 257 protected: | 257 protected: |
| 258 virtual ~WebCrypto() { } | 258 virtual ~WebCrypto() { } |
| 259 }; | 259 }; |
| 260 | 260 |
| 261 } // namespace blink | 261 } // namespace blink |
| 262 | 262 |
| 263 #endif | 263 #endif |
| OLD | NEW |