| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 5 #ifndef NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
| 6 #define NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 6 #define NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 Delegate() {} | 32 Delegate() {} |
| 33 virtual ~Delegate() {} | 33 virtual ~Delegate() {} |
| 34 | 34 |
| 35 // These methods behave as those of the same name on SSLPrivateKey. They | 35 // These methods behave as those of the same name on SSLPrivateKey. They |
| 36 // must be callable on any thread. | 36 // must be callable on any thread. |
| 37 virtual Type GetType() = 0; | 37 virtual Type GetType() = 0; |
| 38 virtual std::vector<SSLPrivateKey::Hash> GetDigestPreferences() = 0; | 38 virtual std::vector<SSLPrivateKey::Hash> GetDigestPreferences() = 0; |
| 39 virtual size_t GetMaxSignatureLengthInBytes() = 0; | 39 virtual size_t GetMaxSignatureLengthInBytes() = 0; |
| 40 | 40 |
| 41 // Signs |input| as a digest of type |hash|. On sucess it returns OK and | 41 // Signs |input| as a digest of type |hash|. On success it returns OK and |
| 42 // sets |signature| to the resulting signature. Otherwise it returns a net | 42 // sets |signature| to the resulting signature. Otherwise it returns a net |
| 43 // error code. It will only be called on the task runner passed to the | 43 // error code. It will only be called on the task runner passed to the |
| 44 // owning ThreadedSSLPrivateKey. | 44 // owning ThreadedSSLPrivateKey. |
| 45 virtual Error SignDigest(Hash hash, | 45 virtual Error SignDigest(Hash hash, |
| 46 const base::StringPiece& input, | 46 const base::StringPiece& input, |
| 47 std::vector<uint8_t>* signature) = 0; | 47 std::vector<uint8_t>* signature) = 0; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 DISALLOW_COPY_AND_ASSIGN(Delegate); | 50 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 51 }; | 51 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 scoped_refptr<Core> core_; | 68 scoped_refptr<Core> core_; |
| 69 scoped_refptr<base::TaskRunner> task_runner_; | 69 scoped_refptr<base::TaskRunner> task_runner_; |
| 70 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; | 70 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); | 72 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace net | 75 } // namespace net |
| 76 | 76 |
| 77 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 77 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
| OLD | NEW |