Package pt.gov.cartaodecidadao
Class PTEID_SmartCard
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_Card
pt.gov.cartaodecidadao.PTEID_SmartCard
- All Implemented Interfaces:
PTEID_SigningDevice
- Direct Known Subclasses:
PTEID_EIDCard
Abstract base class for Smart card.
-
Method Summary
Modifier and TypeMethodDescriptionlongvoiddelete()getPins()longpinCount()intreadFile(String fileID, PTEID_ByteArray in) Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
intreadFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin) Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
intreadFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin, String csPinCode) Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
voidselectApplication(PTEID_ByteArray applicationId) Select an application from the cardsendAPDU(PTEID_ByteArray cmd) Send an APDU command to the card and get the result.sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin) Send an APDU command to the card and get the result.sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin, String csPinCode) Send an APDU command to the card and get the result.booleanwriteFile(String fileID, PTEID_ByteArray out) Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
booleanwriteFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin) Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
booleanwriteFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode) Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
booleanwriteFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode, long inOffset) Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
Methods inherited from class pt.gov.cartaodecidadao.PTEID_Card
getAuthentication, getCA, getCert, getCertificates, getDeviceType, getRoot, getSignature, getType, initPaceAuthentication, PTEID_SigningDevice_GetInterfaceCPtr, readFile, readFile, readFile, Sign, Sign, Sign, Sign, SignASiC, SignASiC, SignPDF, SignPDF, SignSHA256, SignSHA256, SignXades, SignXades, SignXadesA, SignXadesAIndividual, SignXadesIndividual, SignXadesT, SignXadesTIndividual, writeFile
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Card
-
selectApplication
Select an application from the card- Throws:
PTEID_Exception
-
sendAPDU
public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin, String csPinCode) throws PTEID_Exception Send an APDU command to the card and get the result.- Parameters:
cmd- is the apdu commandpin- is the pin to ask for writingcsPinCode- is the code of the pin (it will be asked if needed and not set)- Returns:
- a PTEID_ByteArray containing the result
- Throws:
PTEID_Exception
-
sendAPDU
Send an APDU command to the card and get the result.- Parameters:
cmd- is the apdu commandpin- is the pin to ask for writing
- Returns:
- a PTEID_ByteArray containing the result
- Throws:
PTEID_Exception
-
sendAPDU
Send an APDU command to the card and get the result.- Overrides:
sendAPDUin classPTEID_Card- Parameters:
cmd- is the apdu command
- Returns:
- a PTEID_ByteArray containing the result
- Throws:
PTEID_Exception
-
readFile
public int readFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin, String csPinCode) throws PTEID_Exception Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the filein- return the filepin- is the pin to ask for readingcsPinCode- is the code of the pin (it will be asked if needed and not set)- Throws:
PTEID_Exception
-
readFile
Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the filein- return the filepin- is the pin to ask for reading- Throws:
PTEID_Exception
-
readFile
Read a File from the card.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the filein- return the file
- Throws:
PTEID_Exception
-
writeFile
public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode, long inOffset) throws PTEID_Exception Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the fileout- contents the bytes to writepin- is the pin to ask for writingcsPinCode- is the code of the pin (it will be asked if needed and not set)inOffset- is the offset of the data to be written to the file- Throws:
PTEID_Exception
-
writeFile
public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode) throws PTEID_Exception Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the fileout- contents the bytes to writepin- is the pin to ask for writingcsPinCode- is the code of the pin (it will be asked if needed and not set)- Throws:
PTEID_Exception
-
writeFile
Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Parameters:
fileID- is the path of the fileout- contents the bytes to writepin- is the pin to ask for writing
- Throws:
PTEID_Exception
-
writeFile
Write a file to the card.
Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
- Overrides:
writeFilein classPTEID_Card- Parameters:
fileID- is the path of the fileout- contents the bytes to write
- Throws:
PTEID_Exception
-
pinCount
- Returns:
- the number of pins on the card.
- Throws:
PTEID_Exception
-
getPins
- Returns:
- an object to access all the pins on the card.
- Throws:
PTEID_Exception
-
certificateCount
- Returns:
- the number of certificate on the card.
- Throws:
PTEID_Exception
-