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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 { | 42 { |
43 } | 43 } |
44 | 44 |
45 RsaKeyAlgorithm* RsaKeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& alg
orithm) | 45 RsaKeyAlgorithm* RsaKeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& alg
orithm) |
46 { | 46 { |
47 return new RsaKeyAlgorithm(algorithm); | 47 return new RsaKeyAlgorithm(algorithm); |
48 } | 48 } |
49 | 49 |
50 unsigned RsaKeyAlgorithm::modulusLength() | 50 unsigned RsaKeyAlgorithm::modulusLength() |
51 { | 51 { |
52 return m_algorithm.rsaHashedParams()->modulusLengthBits(); | 52 return m_algorithm.rsaParams()->modulusLengthBits(); |
53 } | 53 } |
54 | 54 |
55 Uint8Array* RsaKeyAlgorithm::publicExponent() | 55 Uint8Array* RsaKeyAlgorithm::publicExponent() |
56 { | 56 { |
57 if (!m_publicExponent.get()) { | 57 if (!m_publicExponent.get()) { |
58 const blink::WebVector<unsigned char>& exponent = m_algorithm.rsaHashedP
arams()->publicExponent(); | 58 const blink::WebVector<unsigned char>& exponent = m_algorithm.rsaParams(
)->publicExponent(); |
59 m_publicExponent = Uint8Array::create(exponent.data(), exponent.size()); | 59 m_publicExponent = Uint8Array::create(exponent.data(), exponent.size()); |
60 } | 60 } |
61 return m_publicExponent.get(); | 61 return m_publicExponent.get(); |
62 } | 62 } |
63 | 63 |
64 void RsaKeyAlgorithm::trace(Visitor* visitor) | 64 void RsaKeyAlgorithm::trace(Visitor* visitor) |
65 { | 65 { |
66 KeyAlgorithm::trace(visitor); | 66 KeyAlgorithm::trace(visitor); |
67 } | 67 } |
68 | 68 |
69 RsaKeyAlgorithm::RsaKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm) | 69 RsaKeyAlgorithm::RsaKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm) |
70 : KeyAlgorithm(algorithm) | 70 : KeyAlgorithm(algorithm) |
71 { | 71 { |
72 ASSERT(algorithm.rsaHashedParams()); | 72 ASSERT(algorithm.rsaParams()); |
73 ScriptWrappable::init(this); | 73 ScriptWrappable::init(this); |
74 } | 74 } |
75 | 75 |
76 } // namespace WebCore | 76 } // namespace WebCore |
OLD | NEW |