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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 class WebCrypto { | 84 class WebCrypto { |
85 public: | 85 public: |
86 // Starts a one-shot cryptographic operation which can complete either | 86 // Starts a one-shot cryptographic operation which can complete either |
87 // synchronously, or asynchronously. | 87 // synchronously, or asynchronously. |
88 // | 88 // |
89 // Let the WebCryptoResult be called "result". | 89 // Let the WebCryptoResult be called "result". |
90 // | 90 // |
91 // The result should be set exactly once, from the same thread which | 91 // The result should be set exactly once, from the same thread which |
92 // initiated the operation. | 92 // initiated the operation. |
| 93 // |
| 94 // * WebCryptoAlgorithms parameters are guaranteed to be !isNull(), |
| 95 // unless noted otherwise. |
| 96 // * const unsigned char* data buffers are not valid after return. |
93 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } | 97 virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } |
94 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } | 98 virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const u
nsigned char* data, unsigned dataSize, WebCryptoResult result) { result.complete
WithError(); } |
95 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWit
hError(); } | 99 virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsi
gned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWit
hError(); } |
96 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, unsigned signatureSize, const unsigned char* da
ta, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } | 100 virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&,
const unsigned char* signature, unsigned signatureSize, const unsigned char* da
ta, unsigned dataSize, WebCryptoResult result) { result.completeWithError(); } |
97 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, un
signed dataSize, WebCryptoResult result) { result.completeWithError(); } | 101 virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, un
signed dataSize, WebCryptoResult result) { result.completeWithError(); } |
98 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } | 102 virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCry
ptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); } |
| 103 // The WebCryptoAlgorithm for importKey may be "isNull()" meaning that it |
| 104 // was unspecified by the caller. |
99 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, uns
igned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsag
eMask, WebCryptoResult result) { result.completeWithError(); } | 105 virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, uns
igned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsag
eMask, WebCryptoResult result) { result.completeWithError(); } |
100 virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoRes
ult result) { result.completeWithError(); } | 106 virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoRes
ult result) { result.completeWithError(); } |
101 | 107 |
102 protected: | 108 protected: |
103 virtual ~WebCrypto() { } | 109 virtual ~WebCrypto() { } |
104 }; | 110 }; |
105 | 111 |
106 } // namespace WebKit | 112 } // namespace WebKit |
107 | 113 |
108 #endif | 114 #endif |
OLD | NEW |