public class PCRutokenKeysProcessor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
PCRutokenKeysProcessor.ChangePINCallback
Callback for handling results of
|
static interface |
PCRutokenKeysProcessor.SlotEventListener
Callback for catching slot events
|
| Modifier and Type | Method and Description |
|---|---|
void |
changePIN(java.lang.String newPIN,
PCRutokenKeysProcessor.ChangePINCallback callback)
Changes PIN on a smart card.
|
void |
finish()
This function must be called after work with smart card is finished
|
Context |
getContext()
Context passed to
init(Context) |
static PCRutokenKeysProcessor |
getInstance()
Always returns a non-null instance of PCRutokenKeysProcessor.
|
java.lang.Throwable |
getLastError()
Returns the last caught throwable.
|
void |
getPublicKey(PCUser user,
PCGetPublicKeyCallback callback)
This method generates a key pair for a specified PCUser.
|
boolean |
init(Context appContext)
This function performs necessary initialization and must be called prior to working with Pkcs11 module
|
boolean |
isInitialized()
Indicates whether the module has been initialized or
init(Context) must be called. |
boolean |
isReadyToSign()
Determines whether PIN form a smart card was submitted (and this has happened quite recently), so that the smart
card can be used for signing data
|
void |
process(PCUser user,
java.util.List<PCTransaction> transactionsToConfirm,
java.util.List<PCTransaction> transactionsToDecline,
PCMultipleProcessingCallback callback)
This method is used to confirm transactions via smart card.
|
void |
renew(PCUser user,
PCTransaction transaction,
java.lang.String externalAlias,
PCRenewRequestCallback callback)
Renews PCUser's symmetric and asymmetric keys
|
void |
setPassword(java.lang.String password)
This function can be called prior to calling
getPublicKey(PCUser, PCGetPublicKeyCallback) in order to save PCUser's password
on a smart card |
void |
setSlotEventListener(PCRutokenKeysProcessor.SlotEventListener slotEventListener)
Adds a listener which can receive events about starting and finished data exchange with a smart card
|
void |
submitPin(java.lang.String pin)
Submit a pin code which will be used to login at smart card.
|
public static PCRutokenKeysProcessor getInstance()
public void getPublicKey(PCUser user,
PCGetPublicKeyCallback callback)
getInstance()
in PCUsersManager.register(...).user - Target PCUsercallback - Callback to handle resultspublic void process(PCUser user,
java.util.List<PCTransaction> transactionsToConfirm,
java.util.List<PCTransaction> transactionsToDecline,
PCMultipleProcessingCallback callback)
getInstance() was passed to methods
which operate with transactions and operations.user - Target PCUsertransactionsToConfirm - List of transactions to be confirmedtransactionsToDecline - List of transactions to be declinedcallback - Callback to handle resultspublic void renew(PCUser user,
PCTransaction transaction,
java.lang.String externalAlias,
PCRenewRequestCallback callback)
user - Target PCUsertransaction - Pseudo-transaction which SDK composes of the data which must be signed with
existing keysexternalAlias - Unique alias which will be used to save the keyscallback - Callback to handle resultspublic boolean init(Context appContext)
appContext - Application contextgetLastError() can be called for details.public void finish()
public void submitPin(java.lang.String pin)
getPublicKey(PCUser, PCGetPublicKeyCallback),
process(PCUser, List, List, PCMultipleProcessingCallback) or
changePIN(String, ChangePINCallback).pin - Valid PIN. If invalid PIN is passed, subsequent methods may return an error of type
PCRutokenError#PIN_INCORRECT.public boolean isReadyToSign()
public void setSlotEventListener(PCRutokenKeysProcessor.SlotEventListener slotEventListener)
slotEventListener - A listener. The callback methods will be invoked in a main thread.public java.lang.Throwable getLastError()
PCRutokenError#GENERAL_ERROR or PCRutokenError#GENERAL_RUTOKEN_ERROR. In this case the throwable
might add some more informationpublic void setPassword(java.lang.String password)
getPublicKey(PCUser, PCGetPublicKeyCallback) in order to save PCUser's password
on a smart cardpassword - Password to be saved on a smart cardpublic boolean isInitialized()
init(Context) must be called.public void changePIN(java.lang.String newPIN,
PCRutokenKeysProcessor.ChangePINCallback callback)
submitPin(String) must be already called to be able
to login.newPIN - New value of PINcallback - Callback for handling resultspublic Context getContext()
init(Context)