public class pteid extends Object
Constructor and Description |
---|
pteid() |
Modifier and Type | Method and Description |
---|---|
static void |
Activate(String pin,
byte[] date,
int mode)
Activate the card (= update a specific file on the card).
|
static void |
CancelChangeAddress()
Allows the library user to cancel a running Change Address operation.
|
static void |
ChangeAddress(String server,
byte[] serverCaCert,
PTEID_Proxy_Info proxyInfo,
String secretCode,
String processCode)
Do an address change, this function will connect the Address Change
Server and forward commands between the Card and the Address Change
Server.
|
static int |
ChangePIN(byte pinId,
String oldPin,
String newPin) |
static byte[] |
CVC_Authenticate_SM101(byte[] signedChallenge,
byte[] ifdSerialNr,
byte[] iccSerialNr,
byte[] keyIfd,
byte[] encKey,
byte[] macKey)
Only for IAS 1.0.1 cards, 2nd command to be executed starting a secure
session using symmetric keys.
|
static void |
CVC_Authenticate(byte[] signedChallenge)
Finish the CVC authentication with the card, to be called after a
CVC_Init() Parameters: signedChallenge: (IN) the challenge that was
signed by the private key corresponding to the CVC
|
static PTEID_ADDR |
CVC_GetAddr()
Read the address file over a 'CVC channel' and put the contents into a
PTEID_ADDR class.
|
static byte[] |
CVC_Init_SM101()
Only for IAS 1.0.1 cards, 1st to be executed starting a secure session
using symmetric keys.
|
static byte[] |
CVC_Init(byte[] cert)
Start a CVC authentication with the card.
|
static PTEID_DH_Auth_Response |
CVC_R_DH_Auth(byte[] Kidf,
byte[] cvcCert)
Complete the DH key agreement and ask the card for a challenge.
|
static PTEID_DH_Params |
CVC_R_Init()
Get the DH parameters, to be sent to the Server
|
static void |
CVC_R_ValidateSignature(byte[] signedChallenge)
Provide the signed challenge (made by the Server)to the card.
|
static byte[] |
CVC_ReadFile(byte[] file)
Read out the contents of a file over a 'CVC channel'.
|
static void |
CVC_WriteAddr(PTEID_ADDR addr)
Write to the address file over a 'CVC channel' A successfull CVC_Init()
and CVC_Authenticate() must have been done before.
|
static void |
CVC_WriteFile(byte[] file,
int fileOffset,
byte[] in,
int mode)
Write to a file on the card over a 'CVC channel'.
|
static void |
CVC_WriteSOD(int fileOffset,
byte[] in,
int mode)
This function calls CVC_WriteFile() with the SOD file as path.
|
static void |
Exit(int mode) |
static PTEID_ADDR |
GetAddr() |
static int |
GetCardType() |
static PTEID_Certif[] |
GetCertificates() |
static int |
GetChangeAddressProgress()
Returns info on what the ChangeAddress() is currently doing:
ADDR_INITIALISING, ADDR_CONNECTING, ...
|
static PTEID_RSAPublicKey |
GetCVCRoot()
Get the CVC CA public key that this card uses to verify the CVC key;
allowing the application to select the correct CVC certificate for this
card.
|
static PTEID_ID |
GetID() |
static int |
GetLastWebErrorCode()
Returns the latest error code received or sent by Change Address.
|
static String |
GetLastWebErrorMessage()
Returns the latest error message received or sent by Change Address.
|
static PTEID_PIC |
GetPic() |
static PTEID_Pin[] |
GetPINs() |
static PTEID_TokenInfo |
GetTokenInfo() |
static void |
Init(String readerName) |
static int |
IsActivated()
Get the activation status of the card.
|
static byte[] |
ReadFile(byte[] file,
byte pinId)
Read a file in the card.
|
static byte[] |
ReadSOD()
This function calls ReadFile() with the SOD file as path.
|
static void |
SelectADF(byte[] adf)
Select an application in the card.
|
static byte[] |
SendAPDU(byte[] request)
Send an APDU to the card, see ISO7816-4 for more info.
|
static void |
SetSODCAs(PTEID_Certif[] certifs)
Specify the (root) certificates that are used to sign the DocumentSigner
certificates in the SOD file.
|
static void |
SetSODChecking(boolean check)
Turn on/off SOD checking.
|
static int |
UnblockPIN_Ext(byte pinId,
String puk,
String newPin,
int flags)
Extended Unblock PIN function: Values for ulFlags: - UNBLOCK_FLAG_NEW_PIN
- UNBLOCK_FLAG_PUK_MERGE E.g.
|
static int |
UnblockPIN(byte pinId,
String puk,
String newPin)
Unblock PIN with PIN change: If puk == null or newPin == null, a GUI is
shown asking for the PUK and the new PIN
|
static int |
VerifyPIN(byte pinId,
String pin) |
static void |
WriteFile(byte[] file,
byte[] in,
byte pinId)
Write to a file in the card.
|
static void |
WriteFileInOffset(byte[] file,
byte[] in,
byte pinId,
int offset)
Write to a file in the card, specifying the offset to start writing to.
|
public static final int PTEID_EXIT_LEAVE_CARD
public static final int PTEID_EXIT_UNPOWER
public static final int UNBLOCK_FLAG_NEW_PIN
public static final int UNBLOCK_FLAG_PUK_MERGE
public static final int MODE_ACTIVATE_BLOCK_PIN
public static final int CVC_WRITE_MODE_PAD
public static final int CARD_TYPE_ERR
public static final int CARD_TYPE_IAS07
public static final int CARD_TYPE_IAS101
public static final int ADDR_INITIALISING
public static final int ADDR_CONNECTING
public static final int ADDR_READING_INFO
public static final int ADDR_SENDING_INFO
public static final int ADDR_INIT_SEC_CHANNEL
public static final int ADDR_SERVER_CHALL
public static final int ADDR_SERVER_AUTH
public static final int ADDR_CLIENT_AUTH
public static final int ADDR_SERVER_AUTH2
public static final int ADDR_WRITE
public static final int ADDR_FINISH
public static final int ADDR_FINISHED
public static final int ADDR_CANCELLED
public static final int WEB_ERR_OK
public static final int WEB_ERR_SELECT_FILE
public static final int WEB_ERR_READ_FILE
public static final int WEB_ERR_WRITE_FILE
public static final int WEB_ERR_BAD_COMMAND
public static final int WEB_ERR_EMPTY_RES
public static final int WEB_ERR_DATA_SIZE
public static final int WEB_ERR_CARD_REMOVED
public static final int WEB_ERR_CARD_COMM
public static final int WEB_ERR_OUT_OF_MEM
public static final int WEB_ERR_INTERNAL
public static final int WEB_ERR_PARSING
public static final int WEB_ERR_MISSING_DATA
public static final int WEB_ERR_INVALID_HASH
public static void Init(String readerName) throws PteidException
PteidException
public static void Exit(int mode) throws PteidException
PteidException
public static int GetCardType() throws PteidException
PteidException
public static PTEID_ID GetID() throws PteidException
PteidException
public static PTEID_ADDR GetAddr() throws PteidException
PteidException
public static PTEID_PIC GetPic() throws PteidException
PteidException
public static PTEID_Certif[] GetCertificates() throws PteidException
PteidException
public static int VerifyPIN(byte pinId, String pin) throws PteidException
PteidException
public static int ChangePIN(byte pinId, String oldPin, String newPin) throws PteidException
PteidException
public static PTEID_Pin[] GetPINs() throws PteidException
PteidException
public static PTEID_TokenInfo GetTokenInfo() throws PteidException
PteidException
public static byte[] ReadSOD() throws PteidException
PteidException
public static int UnblockPIN(byte pinId, String puk, String newPin) throws PteidException
pinId
- The ID of the PIN to unlock.puk
- The PUK that allows unlocking this PIN, if null the citizen
will be asked the PUK.newPin
- The new PIN value to change to, if null the citizen will be
asked the new PIN.PteidException
public static int UnblockPIN_Ext(byte pinId, String puk, String newPin, int flags) throws PteidException
pinId
- The ID of the PIN to unlock.puk
- The PUK that allows unlocking this PIN, if null the citizen
will be asked the PUK.newPin
- The new PIN value to change to, if null the citizen will be
asked the new PIN.flags
- The flags to pass to the function.PteidException
public static void SelectADF(byte[] adf) throws PteidException
adf
- The application ID.PteidException
public static byte[] ReadFile(byte[] file, byte pinId) throws PteidException
file
- The file ID.pinId
- The PIN ID, if the file is protected by PIN.PteidException
public static void WriteFile(byte[] file, byte[] in, byte pinId) throws PteidException
file
- The file ID.in
- The data to be written in the file.pinId
- The PIN ID, if the file is protected by PIN.PteidException
public static void WriteFileInOffset(byte[] file, byte[] in, byte pinId, int offset) throws PteidException
file
- The file ID.in
- The data to be written in the file.pinId
- The PIN ID, if the file is protected by PIN.offset
- The offset to start writing, in number of bytes.PteidException
public static int IsActivated() throws PteidException
PteidException
public static void Activate(String pin, byte[] date, int mode) throws PteidException
pin
- The activation PIN.date
- The activation date.mode
- The activation mode.PteidException
public static void SetSODChecking(boolean check) throws PteidException
check
- True to enable SOD checking, false to disable it.PteidException
public static void SetSODCAs(PTEID_Certif[] certifs) throws PteidException
certifs
- The Certification Authority certificate chain for SOD
checking.PteidException
public static PTEID_RSAPublicKey GetCVCRoot() throws PteidException
PteidException
public static byte[] CVC_Init(byte[] cert) throws PteidException
cert
- The CVC certificate.PteidException
public static void CVC_Authenticate(byte[] signedChallenge) throws PteidException
signedChallenge
- The challenge signed by the reader.PteidException
public static byte[] CVC_Init_SM101() throws PteidException
PteidException
public static byte[] CVC_Authenticate_SM101(byte[] signedChallenge, byte[] ifdSerialNr, byte[] iccSerialNr, byte[] keyIfd, byte[] encKey, byte[] macKey)
signedChallenge
- ifdSerialNr
- iccSerialNr
- keyIfd
- encKey
- macKey
- public static byte[] CVC_ReadFile(byte[] file) throws PteidException
file
- The file ID.PteidException
public static void CVC_WriteFile(byte[] file, int fileOffset, byte[] in, int mode) throws PteidException
file
- The file ID.fileOffset
- The offset to begin writing to.in
- The data to write in the card.mode
- PteidException
public static PTEID_ADDR CVC_GetAddr()
public static void CVC_WriteAddr(PTEID_ADDR addr) throws PteidException
addr
- A structure containing the address data to be written in the
card.PteidException
public static void CVC_WriteSOD(int fileOffset, byte[] in, int mode) throws PteidException
fileOffset
- The offset to start writing fromin
- The data to write to the SOD file.mode
- Use CVC_WRITE_MODE_PAD to pad the file with zeros.PteidException
public static PTEID_DH_Params CVC_R_Init()
public static PTEID_DH_Auth_Response CVC_R_DH_Auth(byte[] Kidf, byte[] cvcCert)
Kidf
- cvcCert
- public static void CVC_R_ValidateSignature(byte[] signedChallenge)
signedChallenge
- public static byte[] SendAPDU(byte[] request)
request
- public static void ChangeAddress(String server, byte[] serverCaCert, PTEID_Proxy_Info proxyInfo, String secretCode, String processCode)
server
- serverCaCert
- proxyInfo
- secretCode
- processCode
- public static int GetChangeAddressProgress()
public static void CancelChangeAddress()
public static int GetLastWebErrorCode()
public static String GetLastWebErrorMessage()
Copyright © 2015–2016 Zetes. All rights reserved.