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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 KeyAlgorithm* KeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm
) | 47 KeyAlgorithm* KeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm
) |
48 { | 48 { |
49 switch (algorithm.paramsType()) { | 49 switch (algorithm.paramsType()) { |
50 case blink::WebCryptoKeyAlgorithmParamsTypeNone: | 50 case blink::WebCryptoKeyAlgorithmParamsTypeNone: |
51 return new KeyAlgorithm(algorithm); | 51 return new KeyAlgorithm(algorithm); |
52 case blink::WebCryptoKeyAlgorithmParamsTypeAes: | 52 case blink::WebCryptoKeyAlgorithmParamsTypeAes: |
53 return AesKeyAlgorithm::create(algorithm); | 53 return AesKeyAlgorithm::create(algorithm); |
54 case blink::WebCryptoKeyAlgorithmParamsTypeHmac: | 54 case blink::WebCryptoKeyAlgorithmParamsTypeHmac: |
55 return HmacKeyAlgorithm::create(algorithm); | 55 return HmacKeyAlgorithm::create(algorithm); |
56 case blink::WebCryptoKeyAlgorithmParamsTypeRsa: | |
57 return RsaKeyAlgorithm::create(algorithm); | |
58 case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: | 56 case blink::WebCryptoKeyAlgorithmParamsTypeRsaHashed: |
59 return RsaHashedKeyAlgorithm::create(algorithm); | 57 return RsaHashedKeyAlgorithm::create(algorithm); |
60 } | 58 } |
61 ASSERT_NOT_REACHED(); | 59 ASSERT_NOT_REACHED(); |
62 return 0; | 60 return 0; |
63 } | 61 } |
64 | 62 |
65 KeyAlgorithm* KeyAlgorithm::createHash(const blink::WebCryptoAlgorithm& hash) | 63 KeyAlgorithm* KeyAlgorithm::createHash(const blink::WebCryptoAlgorithm& hash) |
66 { | 64 { |
67 // Assume that none of the hash algorithms have any parameters. | 65 // Assume that none of the hash algorithms have any parameters. |
(...skipping 20 matching lines...) Expand all Loading... |
88 bool KeyAlgorithm::isHmacKeyAlgorithm() const | 86 bool KeyAlgorithm::isHmacKeyAlgorithm() const |
89 { | 87 { |
90 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeHma
c; | 88 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeHma
c; |
91 } | 89 } |
92 | 90 |
93 bool KeyAlgorithm::isRsaHashedKeyAlgorithm() const | 91 bool KeyAlgorithm::isRsaHashedKeyAlgorithm() const |
94 { | 92 { |
95 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeRsa
Hashed; | 93 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeRsa
Hashed; |
96 } | 94 } |
97 | 95 |
98 bool KeyAlgorithm::isRsaKeyAlgorithm() const | |
99 { | |
100 return m_algorithm.paramsType() == blink::WebCryptoKeyAlgorithmParamsTypeRsa
; | |
101 } | |
102 | |
103 void KeyAlgorithm::trace(Visitor*) | 96 void KeyAlgorithm::trace(Visitor*) |
104 { | 97 { |
105 } | 98 } |
106 | 99 |
107 } // namespace WebCore | 100 } // namespace WebCore |
OLD | NEW |