Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: Source/platform/exported/WebCryptoAlgorithm.cpp

Issue 195543002: [webcrypto] Implement structured clone of keys (blink-side). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update serialized-script-value.html for version bump Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 const WebCryptoRsaHashedKeyGenParams* WebCryptoAlgorithm::rsaHashedKeyGenParams( ) const 158 const WebCryptoRsaHashedKeyGenParams* WebCryptoAlgorithm::rsaHashedKeyGenParams( ) const
159 { 159 {
160 ASSERT(!isNull()); 160 ASSERT(!isNull());
161 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams) 161 if (paramsType() == WebCryptoAlgorithmParamsTypeRsaHashedKeyGenParams)
162 return static_cast<WebCryptoRsaHashedKeyGenParams*>(m_private->params.ge t()); 162 return static_cast<WebCryptoRsaHashedKeyGenParams*>(m_private->params.ge t());
163 return 0; 163 return 0;
164 } 164 }
165 165
166 bool WebCryptoAlgorithm::isHash(WebCryptoAlgorithmId id)
167 {
168 switch (id) {
169 case WebCryptoAlgorithmIdSha1:
170 case WebCryptoAlgorithmIdSha256:
171 case WebCryptoAlgorithmIdSha384:
172 case WebCryptoAlgorithmIdSha512:
173 return true;
174 case WebCryptoAlgorithmIdAesCbc:
175 case WebCryptoAlgorithmIdHmac:
176 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5:
177 case WebCryptoAlgorithmIdRsaEsPkcs1v1_5:
178 case WebCryptoAlgorithmIdAesGcm:
179 case WebCryptoAlgorithmIdRsaOaep:
180 case WebCryptoAlgorithmIdAesCtr:
181 case WebCryptoAlgorithmIdAesKw:
182 break;
183 }
184 return false;
185 }
186
166 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other) 187 void WebCryptoAlgorithm::assign(const WebCryptoAlgorithm& other)
167 { 188 {
168 m_private = other.m_private; 189 m_private = other.m_private;
169 } 190 }
170 191
171 void WebCryptoAlgorithm::reset() 192 void WebCryptoAlgorithm::reset()
172 { 193 {
173 m_private.reset(); 194 m_private.reset();
174 } 195 }
175 196
176 } // namespace blink 197 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | Source/platform/exported/WebCryptoKeyAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698