|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensc.util.DestroyableChild
org.opensc.util.DestroyableHolder
org.opensc.pkcs11.wrap.PKCS11Session
public class PKCS11Session
| Field Summary | |
|---|---|
protected long |
handle
The C handle of the session. |
static int |
OPEN_MODE_READ_ONLY
|
static int |
OPEN_MODE_READ_WRITE
|
protected long |
pvh
The C handle of the provider. |
protected long |
shandle
The C handle of the slot. |
| Constructor Summary | |
|---|---|
protected |
PKCS11Session(PKCS11Slot slot,
long handle)
Contruct a session from a given handle- |
| Method Summary | |
|---|---|
void |
destroy()
|
protected long |
getHandle()
|
protected long |
getPvh()
|
protected long |
getSlotHandle()
|
boolean |
isSOLoggedIn()
|
boolean |
isUserLoggedIn()
|
void |
loginSO(char[] pin)
Presents the security officer PIN to the token. |
void |
loginUser(char[] pin)
Presents the user PIN to the token. |
void |
logout()
Logs out from the token. |
static PKCS11Session |
open(PKCS11Slot slot,
int mode)
Opens a session on the given slot. |
| Methods inherited from class org.opensc.util.DestroyableHolder |
|---|
deregister, register |
| Methods inherited from class org.opensc.util.DestroyableChild |
|---|
getParent, isDestroyed, unlink |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long pvh
protected long shandle
protected long handle
public static final int OPEN_MODE_READ_ONLY
public static final int OPEN_MODE_READ_WRITE
| Constructor Detail |
|---|
protected PKCS11Session(PKCS11Slot slot,
long handle)
| Method Detail |
|---|
public static PKCS11Session open(PKCS11Slot slot,
int mode)
throws PKCS11Exception
slot - The slot on which we open the session.mode - Either OPEN_MODE_READ_ONLY or OPEN_MODE_READ_WRITE
PKCS11Exception - Upon errors of the underlying PKCS#11 module.
public void loginUser(char[] pin)
throws PKCS11Exception
pin - The user pin. This paremeter may be null, if the
token has a protected authentication path.
PKCS11Exception - Upon errors of the underlying PKCS#11 engine.PKCS11Slot.hasTokenProtectedAuthPath()
public void loginSO(char[] pin)
throws PKCS11Exception
pin - The SO pin. This paremeter may be null, if the
token has a protected authentication path.
PKCS11Exception - Upon errors of the underlying PKCS#11 engine.PKCS11Slot.hasTokenProtectedAuthPath()public boolean isSOLoggedIn()
public boolean isUserLoggedIn()
public void logout()
throws PKCS11Exception
PKCS11Exception
public void destroy()
throws DestroyFailedException
destroy in interface Destroyabledestroy in class DestroyableHolderDestroyFailedExceptionprotected long getPvh()
protected long getSlotHandle()
protected long getHandle()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||