public class APDUSmartCard extends java.lang.Object implements BaseSmartCard
Modifier and Type | Field and Description |
---|---|
protected javax.smartcardio.Card |
card |
static int |
CERT_FID_END |
static int |
CERT_FID_START |
protected tubitak.akis.cif.commands.AbstractAkisCommands |
commands |
protected boolean |
disableSecureMessaging |
protected java.util.List<byte[]> |
encryptionCerts |
protected tubitak.akis.cif.functions.ICommandTransmitter |
pcsc |
protected java.util.Hashtable<java.lang.String,java.lang.Integer> |
serialCertIndex |
protected java.util.Hashtable<java.lang.String,java.lang.Integer> |
serialKeyID |
protected java.util.List<byte[]> |
signingCerts |
protected TerminalHandler |
terminalHandler |
Constructor and Description |
---|
APDUSmartCard()
Default constructor
|
APDUSmartCard(TerminalHandler aTerminalHandler)
Create APDUSmartCard with TerminalHandler
|
Modifier and Type | Method and Description |
---|---|
static boolean |
_in(long aElement,
long[] aList) |
void |
closeSession()
closeSession closes the session between the application and the token
|
java.util.List<byte[]> |
getEncryptionCertificates()
getEncryptionCertificates returns encryption certificates.
|
byte[] |
getSerial()
return serial number
|
byte[] |
getSerial(long aSlotID)
return serial number of token
|
java.util.List<byte[]> |
getSignatureCertificates()
returns signing certificates.
|
tr.gov.tubitak.uekae.esya.api.common.crypto.BaseSigner |
getSigner(java.security.cert.X509Certificate aCert,
java.lang.String aSigningAlg)
prepare and return signer from X509Certificate and signing algorithm
|
tr.gov.tubitak.uekae.esya.api.common.crypto.BaseSigner |
getSigner(java.security.cert.X509Certificate aCert,
java.lang.String aSigningAlg,
java.security.spec.AlgorithmParameterSpec aParams)
prepare and return signer from X509Certificate, signing algorithm and AlgorithmParameterSpec
|
long[] |
getSlotList()
List slots
|
javax.smartcardio.CardTerminal[] |
getTerminalList()
List terminals
|
protected void |
initialize() |
boolean |
isSessionActive()
Checks whether session is active or not.
|
static boolean |
isSupported(javax.smartcardio.CardTerminal aTerminal)
Checks whether smart card support APDU or not.
|
static boolean |
isSupported(javax.smartcardio.CardTerminal aTerminal,
TerminalHandler aTerminalHandler) |
protected static boolean |
isSupported(tubitak.akis.cif.functions.ICommandTransmitter transmitter)
Checks whether smart card support APDU or not.
|
static boolean |
isSupported(java.lang.String aTerminalName)
Checks whether smart card support APDU or not.
|
static boolean |
isSupported(java.lang.String aTerminalName,
TerminalHandler aTerminalHandler)
Checks whether smart card support APDU or not.
|
static boolean |
isVersion20(tubitak.akis.cif.dataStructures.Version aVersion)
Checks whether version is 20 or not.
|
void |
login(java.lang.String aCardPIN)
logs user to the token
|
void |
logout()
logs a user out from a token.
|
void |
openSession(javax.smartcardio.CardTerminal aTerminal)
openSession opens a session between the application and the token present in the given slot.
|
void |
openSession(tubitak.akis.cif.functions.ICommandTransmitter iCommandTransmitter)
openSession opens a session between the application and the token present in the given slot.
|
void |
openSession(long aSlotID)
openSession opens a session between the application and the token present in the given slot.
|
protected java.util.List<java.security.cert.X509Certificate> |
readCertificates()
Return X509 certificates
|
void |
setCommandLoggingPath(java.lang.String commandLoggingPath) |
void |
setDisableSecureMessaging(boolean disableSecureMessaging)
Set disableSecureMessaging flag
|
byte[] |
sign(byte[] aData,
java.security.cert.X509Certificate aCertificate,
java.lang.String aSigningAlg)
returns signnature after signing data.
|
byte[] |
sign(byte[] aData,
java.security.cert.X509Certificate aCertificate,
java.lang.String aSigningAlg,
java.security.spec.AlgorithmParameterSpec spec)
returns signnature after signing data.
|
public static int CERT_FID_START
public static int CERT_FID_END
protected java.util.Hashtable<java.lang.String,java.lang.Integer> serialCertIndex
protected java.util.Hashtable<java.lang.String,java.lang.Integer> serialKeyID
protected java.util.List<byte[]> signingCerts
protected java.util.List<byte[]> encryptionCerts
protected TerminalHandler terminalHandler
protected tubitak.akis.cif.commands.AbstractAkisCommands commands
protected tubitak.akis.cif.functions.ICommandTransmitter pcsc
protected javax.smartcardio.Card card
protected boolean disableSecureMessaging
public APDUSmartCard(TerminalHandler aTerminalHandler)
aTerminalHandler
- public APDUSmartCard()
public void setCommandLoggingPath(java.lang.String commandLoggingPath)
public void setDisableSecureMessaging(boolean disableSecureMessaging)
disableSecureMessaging
- booleanpublic static boolean isSupported(java.lang.String aTerminalName)
public static boolean isSupported(java.lang.String aTerminalName, TerminalHandler aTerminalHandler)
public static boolean isSupported(javax.smartcardio.CardTerminal aTerminal, TerminalHandler aTerminalHandler)
public static boolean isSupported(javax.smartcardio.CardTerminal aTerminal)
protected static boolean isSupported(tubitak.akis.cif.functions.ICommandTransmitter transmitter)
protected void initialize()
public long[] getSlotList() throws javax.smartcardio.CardException
javax.smartcardio.CardException
public javax.smartcardio.CardTerminal[] getTerminalList() throws javax.smartcardio.CardException
javax.smartcardio.CardException
public void openSession(tubitak.akis.cif.functions.ICommandTransmitter iCommandTransmitter) throws SmartCardException
iCommandTransmitter
- given command transmitterSmartCardException
public void openSession(javax.smartcardio.CardTerminal aTerminal) throws SmartCardException
aTerminal
- terminal of the tokenSmartCardException
public boolean isSessionActive()
isSessionActive
in interface BaseSmartCard
protected java.util.List<java.security.cert.X509Certificate> readCertificates() throws SmartCardException
SmartCardException
public java.util.List<byte[]> getSignatureCertificates() throws SmartCardException
getSignatureCertificates
in interface BaseSmartCard
SmartCardException
public byte[] sign(byte[] aData, java.security.cert.X509Certificate aCertificate, java.lang.String aSigningAlg) throws SmartCardException, javax.smartcardio.CardException
SmartCardException
javax.smartcardio.CardException
public byte[] sign(byte[] aData, java.security.cert.X509Certificate aCertificate, java.lang.String aSigningAlg, java.security.spec.AlgorithmParameterSpec spec) throws javax.smartcardio.CardException, SmartCardException
SmartCardException
javax.smartcardio.CardException
public void openSession(long aSlotID) throws SmartCardException
openSession
in interface BaseSmartCard
aSlotID
- slot id of the tokenSmartCardException
public java.util.List<byte[]> getEncryptionCertificates() throws SmartCardException
getEncryptionCertificates
in interface BaseSmartCard
SmartCardException
public void login(java.lang.String aCardPIN) throws SmartCardException, LoginException
login
in interface BaseSmartCard
aCardPIN
- pin of the tokenSmartCardException
LoginException
public void logout() throws SmartCardException
logout
in interface BaseSmartCard
SmartCardException
public byte[] getSerial() throws SmartCardException
getSerial
in interface BaseSmartCard
SmartCardException
public byte[] getSerial(long aSlotID) throws SmartCardException
getSerial
in interface BaseSmartCard
aSlotID
- SmartCardException
public tr.gov.tubitak.uekae.esya.api.common.crypto.BaseSigner getSigner(java.security.cert.X509Certificate aCert, java.lang.String aSigningAlg) throws SmartCardException
getSigner
in interface BaseSmartCard
SmartCardException
public tr.gov.tubitak.uekae.esya.api.common.crypto.BaseSigner getSigner(java.security.cert.X509Certificate aCert, java.lang.String aSigningAlg, java.security.spec.AlgorithmParameterSpec aParams) throws SmartCardException
getSigner
in interface BaseSmartCard
SmartCardException
public void closeSession() throws SmartCardException
closeSession
in interface BaseSmartCard
SmartCardException
public static boolean isVersion20(tubitak.akis.cif.dataStructures.Version aVersion)
public static boolean _in(long aElement, long[] aList)
Copyright © 2025. All rights reserved.