|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include<jni.h> |
|
20 #include <string> |
|
21 |
|
22 namespace java |
|
23 { |
|
24 namespace satsa |
|
25 { |
|
26 |
|
27 /** |
|
28 * JavaApduConnectionBase abstract class which defines |
|
29 * the interface method that are to be implemented by the os specific class |
|
30 * |
|
31 */ |
|
32 class JavaApduConnectionBase |
|
33 { |
|
34 |
|
35 public: |
|
36 virtual ~JavaApduConnectionBase() |
|
37 { |
|
38 |
|
39 } |
|
40 |
|
41 /** |
|
42 * Method to perform various pin related functions(enable pin, disable pin etc) |
|
43 * |
|
44 * @param[in] |
|
45 * @param[out] |
|
46 * @return int The success or Failure value. |
|
47 * @exception ? |
|
48 */ |
|
49 |
|
50 virtual int DoPinMethod(JNIEnv& aJni, jclass aPeer, int aHandle, |
|
51 int aPinMethodType, int aPinID)=0; |
|
52 /** |
|
53 * Method to exchange apdu commands. |
|
54 * |
|
55 * |
|
56 * @param[in] |
|
57 * @param[out] |
|
58 * @return |
|
59 * @exception ? |
|
60 */ |
|
61 virtual int ExchangeAPDU(JNIEnv& aJni, jclass aPeer, int aHandle, |
|
62 jbyteArray aCommandAPDU)=0; |
|
63 |
|
64 /** |
|
65 * This function unblocks the blocing Pin. |
|
66 * @param[in] |
|
67 * @param[out] |
|
68 * @return |
|
69 * @exception ? |
|
70 */ |
|
71 virtual int UnblockPin(JNIEnv& aJni, jclass aPeer, int aHandle, |
|
72 int aBlockedPinID, int aUnblockingPinID)=0; |
|
73 |
|
74 /** |
|
75 * This function gets the answer to reset operation |
|
76 * @param[in] |
|
77 * @param[out] |
|
78 * @return |
|
79 * @exception ? |
|
80 */ |
|
81 virtual std::wstring GetATR()=0; |
|
82 |
|
83 /** |
|
84 * This function creates the connection object |
|
85 * @param[in] |
|
86 * @param[out] |
|
87 * @return |
|
88 * @exception ? |
|
89 */ |
|
90 virtual int CreateConn( |
|
91 JNIEnv& aJni, |
|
92 jobject aPeer, |
|
93 jmethodID aHandleEventMethod, |
|
94 jstring aUri, jstring aName, jstring aVendor, jstring aVersion, |
|
95 jstring aDomain, jstring aRootCertHash, jstring aSigningCertHash, |
|
96 int* TypeArray)=0; |
|
97 |
|
98 /** |
|
99 * This function creates a slot object |
|
100 * @param[in] |
|
101 * @param[out] |
|
102 * @return |
|
103 * @exception ? |
|
104 */ |
|
105 virtual int CreateSlot(JNIEnv& aJni, jobject aPeer)=0; |
|
106 |
|
107 /** |
|
108 * This function returns Slot Information |
|
109 * @param[in] |
|
110 * @param[out] |
|
111 * @return |
|
112 * @exception ? |
|
113 */ |
|
114 virtual std::wstring GetSlot()=0; |
|
115 |
|
116 /** |
|
117 * This function opens a connection to a smart card application |
|
118 * @param[in] |
|
119 * @param[out] |
|
120 * @return |
|
121 * @exception ? |
|
122 */ |
|
123 virtual int Open(JNIEnv& aJni, jclass aPeer, int aHandle)=0; |
|
124 |
|
125 /** |
|
126 * This function closes all connection to a smart card |
|
127 * @param[in] |
|
128 * @param[out] |
|
129 * @return |
|
130 * @exception ? |
|
131 */ |
|
132 virtual int Close(JNIEnv& aJni, jclass aPeer, int aHandle)=0; |
|
133 |
|
134 static JavaApduConnectionBase* getInstance(); |
|
135 |
|
136 }; |
|
137 |
|
138 } // namespace satsa |
|
139 } // namespace java |
|
140 |
|
141 |