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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 const WebCryptoHmacKeyGenParams* WebCryptoAlgorithm::hmacKeyGenParams() const | 118 const WebCryptoHmacKeyGenParams* WebCryptoAlgorithm::hmacKeyGenParams() const |
119 { | 119 { |
120 ASSERT(!isNull()); | 120 ASSERT(!isNull()); |
121 if (paramsType() == WebCryptoAlgorithmParamsTypeHmacKeyGenParams) | 121 if (paramsType() == WebCryptoAlgorithmParamsTypeHmacKeyGenParams) |
122 return static_cast<WebCryptoHmacKeyGenParams*>(m_private->params.get()); | 122 return static_cast<WebCryptoHmacKeyGenParams*>(m_private->params.get()); |
123 return 0; | 123 return 0; |
124 } | 124 } |
125 | 125 |
| 126 const WebCryptoRsaKeyGenParams* WebCryptoAlgorithm::rsaKeyGenParams() const |
| 127 { |
| 128 ASSERT(!isNull()); |
| 129 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaKeyGenParams) |
| 130 return static_cast<WebCryptoRsaKeyGenParams*>(m_private->params.get()); |
| 131 return 0; |
| 132 } |
| 133 |
126 const WebCryptoAesGcmParams* WebCryptoAlgorithm::aesGcmParams() const | 134 const WebCryptoAesGcmParams* WebCryptoAlgorithm::aesGcmParams() const |
127 { | 135 { |
128 ASSERT(!isNull()); | 136 ASSERT(!isNull()); |
129 if (paramsType() == WebCryptoAlgorithmParamsTypeAesGcmParams) | 137 if (paramsType() == WebCryptoAlgorithmParamsTypeAesGcmParams) |
130 return static_cast<WebCryptoAesGcmParams*>(m_private->params.get()); | 138 return static_cast<WebCryptoAesGcmParams*>(m_private->params.get()); |
131 return 0; | 139 return 0; |
132 } | 140 } |
133 | 141 |
134 const WebCryptoRsaOaepParams* WebCryptoAlgorithm::rsaOaepParams() const | 142 const WebCryptoRsaOaepParams* WebCryptoAlgorithm::rsaOaepParams() const |
135 { | 143 { |
(...skipping 23 matching lines...) Expand all Loading... |
159 { | 167 { |
160 switch (id) { | 168 switch (id) { |
161 case WebCryptoAlgorithmIdSha1: | 169 case WebCryptoAlgorithmIdSha1: |
162 case WebCryptoAlgorithmIdSha256: | 170 case WebCryptoAlgorithmIdSha256: |
163 case WebCryptoAlgorithmIdSha384: | 171 case WebCryptoAlgorithmIdSha384: |
164 case WebCryptoAlgorithmIdSha512: | 172 case WebCryptoAlgorithmIdSha512: |
165 return true; | 173 return true; |
166 case WebCryptoAlgorithmIdAesCbc: | 174 case WebCryptoAlgorithmIdAesCbc: |
167 case WebCryptoAlgorithmIdHmac: | 175 case WebCryptoAlgorithmIdHmac: |
168 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: | 176 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: |
| 177 case WebCryptoAlgorithmIdRsaEsPkcs1v1_5: |
169 case WebCryptoAlgorithmIdAesGcm: | 178 case WebCryptoAlgorithmIdAesGcm: |
170 case WebCryptoAlgorithmIdRsaOaep: | 179 case WebCryptoAlgorithmIdRsaOaep: |
171 case WebCryptoAlgorithmIdAesCtr: | 180 case WebCryptoAlgorithmIdAesCtr: |
172 case WebCryptoAlgorithmIdAesKw: | 181 case WebCryptoAlgorithmIdAesKw: |
173 break; | 182 break; |
174 } | 183 } |
175 return false; | 184 return false; |
176 } | 185 } |
177 | 186 |
178 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) | 187 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) |
179 { | 188 { |
180 m_private = other.m_private; | 189 m_private = other.m_private; |
181 } | 190 } |
182 | 191 |
183 void WebCryptoAlgorithm::reset() | 192 void WebCryptoAlgorithm::reset() |
184 { | 193 { |
185 m_private.reset(); | 194 m_private.reset(); |
186 } | 195 } |
187 | 196 |
188 } // namespace blink | 197 } // namespace blink |
OLD | NEW |