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

Side by Side Diff: Source/modules/crypto/NormalizeAlgorithm.h

Issue 248963006: [webcrypto] Add key usage for 'deriveBits' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/crypto/Key.cpp ('k') | public/platform/WebCryptoKey.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 enum AlgorithmOperation { 45 enum AlgorithmOperation {
46 Encrypt, 46 Encrypt,
47 Decrypt, 47 Decrypt,
48 Sign, 48 Sign,
49 Verify, 49 Verify,
50 Digest, 50 Digest,
51 GenerateKey, 51 GenerateKey,
52 ImportKey, 52 ImportKey,
53 DeriveKey, 53 DeriveKey,
54 DeriveBits,
54 WrapKey, 55 WrapKey,
55 UnwrapKey, 56 UnwrapKey,
56 // <---- End of list (keep this up-to-date) 57 // <---- End of list (keep this up-to-date)
57 LastAlgorithmOperation = UnwrapKey, 58 LastAlgorithmOperation = UnwrapKey,
58 }; 59 };
59 60
60 // Converts a javascript Dictionary to a WebCryptoAlgorithm object. 61 // Converts a javascript Dictionary to a WebCryptoAlgorithm object.
61 // 62 //
62 // This corresponds with "normalizing" [1] the algorithm, and then validating 63 // This corresponds with "normalizing" [1] the algorithm, and then validating
63 // the expected parameters for the algorithm/operation combination. 64 // the expected parameters for the algorithm/operation combination.
64 // 65 //
65 // On success returns true and sets the WebCryptoAlgorithm. 66 // On success returns true and sets the WebCryptoAlgorithm.
66 // 67 //
67 // On failure parseAlgorithm returns false and completes the CryptoResult 68 // On failure parseAlgorithm returns false and completes the CryptoResult
68 // with a (non-localized) debug string. 69 // with a (non-localized) debug string.
69 // 70 //
70 // [1] http://www.w3.org/TR/WebCryptoAPI/#algorithm-normalizing-rules 71 // [1] http://www.w3.org/TR/WebCryptoAPI/#algorithm-normalizing-rules
71 bool parseAlgorithm(const Dictionary&, AlgorithmOperation, blink::WebCryptoAlgor ithm&, CryptoResult*) WARN_UNUSED_RETURN; 72 bool parseAlgorithm(const Dictionary&, AlgorithmOperation, blink::WebCryptoAlgor ithm&, CryptoResult*) WARN_UNUSED_RETURN;
72 73
73 // Returns a null-terminated C-string literal. Caller can assume the pointer 74 // Returns a null-terminated C-string literal. Caller can assume the pointer
74 // will be valid for the program's entire runtime. 75 // will be valid for the program's entire runtime.
75 const char* algorithmIdToName(blink::WebCryptoAlgorithmId); 76 const char* algorithmIdToName(blink::WebCryptoAlgorithmId);
76 77
77 } // namespace WebCore 78 } // namespace WebCore
78 79
79 #endif 80 #endif
OLDNEW
« no previous file with comments | « Source/modules/crypto/Key.cpp ('k') | public/platform/WebCryptoKey.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698