public interface Token
| Modifier and Type | Method and Description |
|---|---|
byte[] |
calculateSignature(byte[] pin2,
byte[] hash,
boolean ecc)
Calculate electronic signature with pre-calculated hash.
|
byte[] |
certificate(CertificateType type)
Read certificate data of the cardholder.
|
void |
changeCode(CodeType type,
byte[] currentCode,
byte[] newCode)
Change PIN1/PIN2/PUK code.
|
int |
codeRetryCounter(CodeType type)
Read retry counter for PIN1/PIN2/PUK code.
|
static Token |
create(SmartCardReader reader)
Create an instance of Token based on the current card in the reader.
|
byte[] |
decrypt(byte[] pin1,
byte[] data,
boolean ecc)
Decrypt data.
|
PersonalData |
personalData()
Read personal information of the cardholder.
|
void |
unblockAndChangeCode(byte[] pukCode,
CodeType type,
byte[] newCode)
Unblock PIN1/PIN2 via PUK code and change it to a new value.
|
PersonalData personalData() throws SmartCardReaderException
SmartCardReaderException - When reading failed.void changeCode(CodeType type, byte[] currentCode, byte[] newCode) throws SmartCardReaderException
type - Code type.currentCode - Current code.newCode - New code.SmartCardReaderException - When changing failed.CodeVerificationException - When current code is wrong.void unblockAndChangeCode(byte[] pukCode,
CodeType type,
byte[] newCode)
throws SmartCardReaderException
pukCode - PUK code.type - Code type.newCode - New code.SmartCardReaderException - When changing failed.CodeVerificationException - When PUK code is wrong.int codeRetryCounter(CodeType type) throws SmartCardReaderException
type - Code type.SmartCardReaderExceptionbyte[] certificate(CertificateType type) throws SmartCardReaderException
type - Type of the certificate.SmartCardReaderException - When reading failed.byte[] calculateSignature(byte[] pin2,
byte[] hash,
boolean ecc)
throws SmartCardReaderException
pin2 - PIN2 code.hash - Pre-calculated hash.ecc - Whether it's a elliptic curve certificate.SmartCardReaderException - When calculating signature failed.CodeVerificationException - When PIN2 code is wrong.byte[] decrypt(byte[] pin1,
byte[] data,
boolean ecc)
throws SmartCardReaderException
pin1 - PIN1 code.data - Data to decrypt.ecc - Whether it's a elliptic curve certificate.SmartCardReaderException - When decrypting failed.CodeVerificationException - When PIN1 code is wrong.static Token create(SmartCardReader reader) throws SmartCardReaderException
reader - Smart card reader instance, must be connected.SmartCardReaderException - When card is not supported or reader is not connected.