public class P11SmartCard extends java.lang.Object implements BaseSmartCard
Modifier and Type | Field and Description |
---|---|
protected SmartCard |
sc |
protected long |
session |
protected long |
slot |
Constructor and Description |
---|
P11SmartCard(CardType aCardType)
Create smart card with a card type
|
Modifier and Type | Method and Description |
---|---|
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 of token
|
byte[] |
getSerial(long aSlotID)
return serial number of token
|
long |
getSessionNo() |
java.util.List<byte[]> |
getSignatureCertificates()
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 |
getSlotNo() |
SmartCard |
getSmartCard()
return smart card
|
boolean |
isSessionActive()
Checks whether session is active or not.
|
void |
login(java.lang.String aCardPIN)
logs user to the token
|
void |
logout()
logs a user out from a token.
|
void |
openSession(long aSlotID)
openSession opens a session between the application and the token present in the given slot.
|
protected SmartCard sc
protected long slot
protected long session
public P11SmartCard(CardType aCardType) throws sun.security.pkcs11.wrapper.PKCS11Exception, java.io.IOException
aCardType
- sun.security.pkcs11.wrapper.PKCS11Exception
java.io.IOException
public void openSession(long aSlotID) throws SmartCardException
openSession
in interface BaseSmartCard
aSlotID
- slot id of the tokenSmartCardException
public java.util.List<byte[]> getSignatureCertificates() throws SmartCardException
getSignatureCertificates
in interface BaseSmartCard
SmartCardException
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 boolean isSessionActive()
isSessionActive
in interface BaseSmartCard
public byte[] getSerial() throws SmartCardException
getSerial
in interface BaseSmartCard
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 SmartCard getSmartCard()
public void closeSession() throws SmartCardException
closeSession
in interface BaseSmartCard
SmartCardException
public byte[] getSerial(long aSlotID) throws SmartCardException
getSerial
in interface BaseSmartCard
aSlotID
- SmartCardException
public long getSlotNo()
public long getSessionNo()
Copyright © 2025. All rights reserved.