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

Side by Side Diff: net/android/keystore.h

Issue 11571059: Add net/android/keystore.h (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add DSA + ECDSA test keys and signing tests Created 7 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_ANDROID_KEYSTORE_H
6 #define NET_ANDROID_KEYSTORE_H
7
8 #include <jni.h>
9
10 #include <string>
11 #include <vector>
12
13 #include "base/basictypes.h"
14 #include "base/string_piece.h"
15 #include "net/base/net_export.h"
16 #include "net/base/ssl_client_cert_type.h"
17
18 // Misc classes to access the Android platform KeyStore.
19
20 namespace net {
21 namespace android {
22
23 // Compute the signature of a given message, using a private key.
24 // This is used to implement OpenSSL's client certificate signing
25 // callback, so must end up implementing the same thing than
26 // RSA_sign() / DSA_sign() / ECDSA_sign(), depending on the key
27 // type.
28 //
29 // |private_key| is a JNI reference for the private key.
30 // |message| is the input message.
31 // |signature| will receive the signature on success.
32 // Returns true on success, false on failure.
33 //
34 bool SignWithPrivateKey(
35 jobject private_key,
36 const base::StringPiece& message,
37 std::vector<uint8>* signature);
38
39
40 // Return the SSLClientCertType of a given private key.
41 // |private_key| is a JNI reference for the private key.
42 // Returns a SSLClientCertType, while will be CLIENT_CERT_INVALID_TYPE
43 // on error.
44 SSLClientCertType GetPrivateKeySigningType(jobject private_key);
Ryan Sleevi 2013/01/26 01:51:57 This is the wrong enum to use. The determination
digit1 2013/01/28 10:16:30 Ok, I'll not touch SSLClientCertType then, and try
45
46 // Register JNI methods
47 NET_EXPORT bool RegisterKeyStore(JNIEnv* env);
48
49 } // namespace android
50 } // namespace net
51
52 #endif // NET_ANDROID_KEYSTORE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698