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

Unified Diff: Source/modules/crypto/NormalizeAlgorithm.h

Issue 18475002: WebCrypto: Add framework for AlgorithmIdentifier normalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rename verify --> verifySignature (because "verify" is a macro on Mac) Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/crypto/DOMWindowCrypto.cpp ('k') | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/NormalizeAlgorithm.h
diff --git a/Source/modules/crypto/WorkerCrypto.h b/Source/modules/crypto/NormalizeAlgorithm.h
similarity index 71%
copy from Source/modules/crypto/WorkerCrypto.h
copy to Source/modules/crypto/NormalizeAlgorithm.h
index 5bbb3f5d39eba918f40aab6f91439d3993547e81..fdf1fd6299518a912e111769984786d87c8ebef5 100644
--- a/Source/modules/crypto/WorkerCrypto.h
+++ b/Source/modules/crypto/NormalizeAlgorithm.h
@@ -28,26 +28,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WorkerCrypto_h
-#define WorkerCrypto_h
+#ifndef NormalizeAlgorithm_h
+#define NormalizeAlgorithm_h
-#include "bindings/v8/ScriptWrappable.h"
-#include "wtf/Forward.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
+#include "wtf/Assertions.h"
+
+namespace WebKit { class WebCryptoAlgorithm; }
namespace WebCore {
-typedef int ExceptionCode;
+class Dictionary;
-class WorkerCrypto : public ScriptWrappable, public RefCounted<WorkerCrypto> {
-public:
- static PassRefPtr<WorkerCrypto> create() { return adoptRef(new WorkerCrypto()); }
+typedef int ExceptionCode;
-private:
- WorkerCrypto();
+enum AlgorithmOperation {
+ Encrypt,
+ Decrypt,
+ Sign,
+ Verify,
+ Digest,
+ GenerateKey,
+ DeriveKey,
+ WrapKey,
+ UnwrapKey,
+ // <---- End of list
+ NumberOfAlgorithmOperations,
};
-}
+// Normalizes an algorithm identifier (dictionary) into a WebCryptoAlgorithm. If
+// normalization fails then returns false and sets |ec|.
+bool normalizeAlgorithm(const Dictionary&, AlgorithmOperation, WebKit::WebCryptoAlgorithm&, ExceptionCode&) WARN_UNUSED_RETURN;
+
+} // namespace WebCore
#endif
« no previous file with comments | « Source/modules/crypto/DOMWindowCrypto.cpp ('k') | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698