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 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 #include "modules/crypto/CryptoKey.h" | 32 #include "modules/crypto/CryptoKey.h" |
33 | 33 |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "core/dom/ExceptionCode.h" | 35 #include "core/dom/ExceptionCode.h" |
36 #include "platform/CryptoResult.h" | 36 #include "platform/CryptoResult.h" |
37 #include "public/platform/WebCryptoAlgorithmParams.h" | 37 #include "public/platform/WebCryptoAlgorithmParams.h" |
38 #include "public/platform/WebCryptoKeyAlgorithm.h" | 38 #include "public/platform/WebCryptoKeyAlgorithm.h" |
39 #include "public/platform/WebString.h" | 39 #include "public/platform/WebString.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace blink { |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 const char* keyTypeToString(blink::WebCryptoKeyType type) | 45 const char* keyTypeToString(blink::WebCryptoKeyType type) |
46 { | 46 { |
47 switch (type) { | 47 switch (type) { |
48 case blink::WebCryptoKeyTypeSecret: | 48 case blink::WebCryptoKeyTypeSecret: |
49 return "secret"; | 49 return "secret"; |
50 case blink::WebCryptoKeyTypePublic: | 50 case blink::WebCryptoKeyTypePublic: |
51 return "public"; | 51 return "public"; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 blink::WebCryptoKeyUsageMask usage = keyUsageStringToMask(usages[i]); | 208 blink::WebCryptoKeyUsageMask usage = keyUsageStringToMask(usages[i]); |
209 if (!usage) { | 209 if (!usage) { |
210 result->completeWithError(blink::WebCryptoErrorTypeSyntax, "Invalid
keyUsages argument"); | 210 result->completeWithError(blink::WebCryptoErrorTypeSyntax, "Invalid
keyUsages argument"); |
211 return false; | 211 return false; |
212 } | 212 } |
213 mask |= usage; | 213 mask |= usage; |
214 } | 214 } |
215 return true; | 215 return true; |
216 } | 216 } |
217 | 217 |
218 } // namespace WebCore | 218 } // namespace blink |
OLD | NEW |