OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "modules/crypto/KeyAlgorithm.h" | 32 #include "modules/crypto/KeyAlgorithm.h" |
33 | 33 |
34 #include "modules/crypto/AesKeyAlgorithm.h" | 34 #include "modules/crypto/AesKeyAlgorithm.h" |
35 #include "modules/crypto/HmacKeyAlgorithm.h" | 35 #include "modules/crypto/HmacKeyAlgorithm.h" |
36 #include "modules/crypto/NormalizeAlgorithm.h" | 36 #include "modules/crypto/NormalizeAlgorithm.h" |
37 #include "modules/crypto/RsaHashedKeyAlgorithm.h" | 37 #include "modules/crypto/RsaHashedKeyAlgorithm.h" |
38 #include "modules/crypto/RsaKeyAlgorithm.h" | 38 #include "modules/crypto/RsaKeyAlgorithm.h" |
| 39 #include "public/platform/WebCryptoAlgorithm.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
40 | 41 |
41 namespace WebCore { | 42 namespace WebCore { |
42 | 43 |
43 KeyAlgorithm::~KeyAlgorithm() | 44 KeyAlgorithm::~KeyAlgorithm() |
44 { | 45 { |
45 } | 46 } |
46 | 47 |
47 KeyAlgorithm* KeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm
) | 48 KeyAlgorithm* KeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm
) |
48 { | 49 { |
(...skipping 19 matching lines...) Expand all Loading... |
68 } | 69 } |
69 | 70 |
70 KeyAlgorithm::KeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm) | 71 KeyAlgorithm::KeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm) |
71 : m_algorithm(algorithm) | 72 : m_algorithm(algorithm) |
72 { | 73 { |
73 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
74 } | 75 } |
75 | 76 |
76 String KeyAlgorithm::name() | 77 String KeyAlgorithm::name() |
77 { | 78 { |
78 return algorithmIdToName(m_algorithm.id()); | 79 return blink::WebCryptoAlgorithm::idToName(m_algorithm.id()); |
79 } | 80 } |
80 | 81 |
81 bool KeyAlgorithm::isAesKeyAlgorithm() const | 82 bool KeyAlgorithm::isAesKeyAlgorithm() const |
82 { | 83 { |
83 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeAes
; | 84 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeAes
; |
84 } | 85 } |
85 | 86 |
86 bool KeyAlgorithm::isHmacKeyAlgorithm() const | 87 bool KeyAlgorithm::isHmacKeyAlgorithm() const |
87 { | 88 { |
88 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeHma
c; | 89 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeHma
c; |
89 } | 90 } |
90 | 91 |
91 bool KeyAlgorithm::isRsaHashedKeyAlgorithm() const | 92 bool KeyAlgorithm::isRsaHashedKeyAlgorithm() const |
92 { | 93 { |
93 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeRsa
Hashed; | 94 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeRsa
Hashed; |
94 } | 95 } |
95 | 96 |
96 void KeyAlgorithm::trace(Visitor*) | 97 void KeyAlgorithm::trace(Visitor*) |
97 { | 98 { |
98 } | 99 } |
99 | 100 |
100 } // namespace WebCore | 101 } // namespace WebCore |
OLD | NEW |