| 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_H | 5 #ifndef NET_ANDROID_KEYSTORE_H |
| 6 #define NET_ANDROID_KEYSTORE_H | 6 #define NET_ANDROID_KEYSTORE_H |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Compute the signature of a given message, which is actually a hash, | 75 // Compute the signature of a given message, which is actually a hash, |
| 76 // using a private key. For more details, please read the comments for the | 76 // using a private key. For more details, please read the comments for the |
| 77 // rawSignDigestWithPrivateKey method in AndroidKeyStore.java. | 77 // rawSignDigestWithPrivateKey method in AndroidKeyStore.java. |
| 78 // | 78 // |
| 79 // |private_key| is a JNI reference for the private key. | 79 // |private_key| is a JNI reference for the private key. |
| 80 // |digest| is the input digest. | 80 // |digest| is the input digest. |
| 81 // |signature| will receive the signature on success. | 81 // |signature| will receive the signature on success. |
| 82 // Returns true on success, false on failure. | 82 // Returns true on success, false on failure. |
| 83 // | 83 // |
| 84 bool RawSignDigestWithPrivateKey( | 84 NET_EXPORT bool RawSignDigestWithPrivateKey( |
| 85 jobject private_key, | 85 jobject private_key, |
| 86 const base::StringPiece& digest, | 86 const base::StringPiece& digest, |
| 87 std::vector<uint8>* signature); | 87 std::vector<uint8>* signature); |
| 88 | 88 |
| 89 | 89 |
| 90 // Return the PrivateKeyType of a given private key. | 90 // Return the PrivateKeyType of a given private key. |
| 91 // |private_key| is a JNI reference for the private key. | 91 // |private_key| is a JNI reference for the private key. |
| 92 // Returns a PrivateKeyType, while will be CLIENT_CERT_INVALID_TYPE | 92 // Returns a PrivateKeyType, while will be CLIENT_CERT_INVALID_TYPE |
| 93 // on error. | 93 // on error. |
| 94 NET_EXPORT PrivateKeyType GetPrivateKeyType(jobject private_key); | 94 NET_EXPORT PrivateKeyType GetPrivateKeyType(jobject private_key); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 108 // the returned key's reference count. | 108 // the returned key's reference count. |
| 109 EVP_PKEY* GetOpenSSLSystemHandleForPrivateKey(jobject private_key); | 109 EVP_PKEY* GetOpenSSLSystemHandleForPrivateKey(jobject private_key); |
| 110 | 110 |
| 111 // Register JNI methods | 111 // Register JNI methods |
| 112 NET_EXPORT bool RegisterKeyStore(JNIEnv* env); | 112 NET_EXPORT bool RegisterKeyStore(JNIEnv* env); |
| 113 | 113 |
| 114 } // namespace android | 114 } // namespace android |
| 115 } // namespace net | 115 } // namespace net |
| 116 | 116 |
| 117 #endif // NET_ANDROID_KEYSTORE_H | 117 #endif // NET_ANDROID_KEYSTORE_H |
| OLD | NEW |