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