| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_BASE_KEYGEN_HANDLER_H_ | 5 #ifndef NET_BASE_KEYGEN_HANDLER_H_ |
| 6 #define NET_BASE_KEYGEN_HANDLER_H_ | 6 #define NET_BASE_KEYGEN_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 #include "net/base/net_api.h" | 14 #include "net/base/net_export.h" |
| 15 | 15 |
| 16 #if defined(USE_NSS) | 16 #if defined(USE_NSS) |
| 17 #include "crypto/crypto_module_blocking_password_delegate.h" | 17 #include "crypto/crypto_module_blocking_password_delegate.h" |
| 18 #endif // defined(USE_NSS) | 18 #endif // defined(USE_NSS) |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 // This class handles keypair generation for generating client | 22 // This class handles keypair generation for generating client |
| 23 // certificates via the <keygen> tag. | 23 // certificates via the <keygen> tag. |
| 24 // <http://dev.w3.org/html5/spec/Overview.html#the-keygen-element> | 24 // <http://dev.w3.org/html5/spec/Overview.html#the-keygen-element> |
| 25 // <https://developer.mozilla.org/En/HTML/HTML_Extensions/KEYGEN_Tag> | 25 // <https://developer.mozilla.org/En/HTML/HTML_Extensions/KEYGEN_Tag> |
| 26 | 26 |
| 27 class NET_API KeygenHandler { | 27 class NET_EXPORT KeygenHandler { |
| 28 public: | 28 public: |
| 29 // Creates a handler that will generate a key with the given key size and | 29 // Creates a handler that will generate a key with the given key size and |
| 30 // incorporate the |challenge| into the Netscape SPKAC structure. The request | 30 // incorporate the |challenge| into the Netscape SPKAC structure. The request |
| 31 // for the key originated from |url|. | 31 // for the key originated from |url|. |
| 32 KeygenHandler(int key_size_in_bits, | 32 KeygenHandler(int key_size_in_bits, |
| 33 const std::string& challenge, | 33 const std::string& challenge, |
| 34 const GURL& url); | 34 const GURL& url); |
| 35 ~KeygenHandler(); | 35 ~KeygenHandler(); |
| 36 | 36 |
| 37 // Actually generates the key-pair and the cert request (SPKAC), and returns | 37 // Actually generates the key-pair and the cert request (SPKAC), and returns |
| (...skipping 20 matching lines...) Expand all Loading... |
| 58 #if defined(USE_NSS) | 58 #if defined(USE_NSS) |
| 59 // The callback for requesting a password to the PKCS#11 token. | 59 // The callback for requesting a password to the PKCS#11 token. |
| 60 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> | 60 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> |
| 61 crypto_module_password_delegate_; | 61 crypto_module_password_delegate_; |
| 62 #endif // defined(USE_NSS) | 62 #endif // defined(USE_NSS) |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace net | 65 } // namespace net |
| 66 | 66 |
| 67 #endif // NET_BASE_KEYGEN_HANDLER_H_ | 67 #endif // NET_BASE_KEYGEN_HANDLER_H_ |
| OLD | NEW |