| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_ANDROID_KEYSTORE_OPENSSL_H | 5 #ifndef NET_ANDROID_KEYSTORE_OPENSSL_H |
| 6 #define NET_ANDROID_KEYSTORE_OPENSSL_H | 6 #define NET_ANDROID_KEYSTORE_OPENSSL_H |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <openssl/evp.h> | 9 #include <openssl/evp.h> |
| 10 | 10 |
| 11 #include "crypto/scoped_openssl_types.h" |
| 11 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 12 | 13 |
| 13 // OpenSSL-specific functions to use the Android platform keystore. | 14 // OpenSSL-specific functions to use the Android platform keystore. |
| 14 // The features provided here are highly specific to OpenSSL and are | 15 // The features provided here are highly specific to OpenSSL and are |
| 15 // segregated from net/android/keystore.h because the latter only provides | 16 // segregated from net/android/keystore.h because the latter only provides |
| 16 // simply JNI stubs to call Java code which only uses platform APIs. | 17 // simply JNI stubs to call Java code which only uses platform APIs. |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| 19 namespace android { | 20 namespace android { |
| 20 | 21 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 33 // - Only contains a private key. | 34 // - Only contains a private key. |
| 34 // | 35 // |
| 35 // - Owns its own _global_ JNI reference to the object. This means the | 36 // - Owns its own _global_ JNI reference to the object. This means the |
| 36 // caller can free |private_key| safely after the call, and that the | 37 // caller can free |private_key| safely after the call, and that the |
| 37 // the returned EVP_PKEY instance can be used from any thread. | 38 // the returned EVP_PKEY instance can be used from any thread. |
| 38 // | 39 // |
| 39 // - Uses a custom method to implement the minimum functions required to | 40 // - Uses a custom method to implement the minimum functions required to |
| 40 // *sign* the digest that is part of the "Verify Certificate" message | 41 // *sign* the digest that is part of the "Verify Certificate" message |
| 41 // during the OpenSSL handshake. Anything else will result in undefined | 42 // during the OpenSSL handshake. Anything else will result in undefined |
| 42 // behaviour. | 43 // behaviour. |
| 43 NET_EXPORT EVP_PKEY* GetOpenSSLPrivateKeyWrapper(jobject private_key); | 44 NET_EXPORT crypto::ScopedEVP_PKEY GetOpenSSLPrivateKeyWrapper( |
| 45 jobject private_key); |
| 44 | 46 |
| 45 } // namespace android | 47 } // namespace android |
| 46 } // namespace net | 48 } // namespace net |
| 47 | 49 |
| 48 #endif // NET_ANDROID_KEYSTORE_OPENSSL_H | 50 #endif // NET_ANDROID_KEYSTORE_OPENSSL_H |
| OLD | NEW |