public class GlobalPlatform extends javax.smartcardio.CardChannel implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
GlobalPlatform.APDUMode |
static class |
GlobalPlatform.GPSpec |
| Modifier and Type | Field and Description |
|---|---|
static byte |
CLA_GP |
static byte |
CLA_MAC |
static EnumSet<GlobalPlatform.APDUMode> |
defaultMode |
static byte |
INS_DELETE |
static byte |
INS_GET_DATA |
static byte |
INS_GET_STATUS |
static byte |
INS_INITIALIZE_UPDATE |
static byte |
INS_INSTALL |
static byte |
INS_LOAD |
static byte |
INS_PUT_KEY |
static byte |
INS_SET_STATUS |
static byte |
INS_STORE_DATA |
static byte |
P1_INSTALL_AND_MAKE_SELECTABLE |
static byte |
P1_INSTALL_FOR_INSTALL |
static int |
SCP_01_05 |
static int |
SCP_01_15 |
static int |
SCP_02_04 |
static int |
SCP_02_05 |
static int |
SCP_02_0A |
static int |
SCP_02_0B |
static int |
SCP_02_14 |
static int |
SCP_02_15 |
static int |
SCP_02_1A |
static int |
SCP_02_1B |
static int |
SCP_ANY |
protected boolean |
strict |
| Constructor and Description |
|---|
GlobalPlatform(javax.smartcardio.CardChannel channel,
pro.javacard.AID sdAID)
Maintaining locks to the underlying hardware is the duty of the caller
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static GlobalPlatform |
connect(javax.smartcardio.CardChannel channel,
pro.javacard.AID sdAID) |
void |
deleteAID(pro.javacard.AID aid,
boolean deleteDeps)
Delete file
aid on the card. |
void |
deleteKey(int keyver) |
static GlobalPlatform |
discover(javax.smartcardio.CardChannel channel) |
void |
extradite(pro.javacard.AID what,
pro.javacard.AID to) |
pro.javacard.AID |
getAID() |
javax.smartcardio.Card |
getCard() |
javax.smartcardio.CardChannel |
getCardChannel() |
int |
getChannelNumber() |
GPRegistry |
getRegistry() |
int |
getScpKeyVersion() |
int |
getSCPVersion() |
static String |
getVersion()
Get the version and build information of the library.
|
protected void |
giveStrictWarning(String message) |
void |
installAndMakeSelectable(pro.javacard.AID packageAID,
pro.javacard.AID appletAID,
pro.javacard.AID instanceAID,
byte privileges,
byte[] installParams,
byte[] installToken)
Deprecated.
|
void |
installAndMakeSelectable(pro.javacard.AID packageAID,
pro.javacard.AID appletAID,
pro.javacard.AID instanceAID,
GPRegistryEntry.Privileges privileges,
byte[] installParams,
byte[] installToken)
Install an applet and make it selectable.
|
void |
installForInstall(pro.javacard.AID packageAID,
pro.javacard.AID appletAID,
pro.javacard.AID instanceAID,
GPRegistryEntry.Privileges privileges,
byte[] installParams,
byte[] installToken)
Install an applet.
|
void |
loadCapFile(pro.javacard.CAPFile cap,
pro.javacard.AID target) |
void |
loadCapFile(pro.javacard.CAPFile cap,
pro.javacard.AID target,
byte[] dap,
String hash) |
void |
lockUnlockApplet(pro.javacard.AID app,
boolean lock) |
void |
makeDefaultSelected(pro.javacard.AID aid) |
void |
openSecureChannel(GPSessionKeyProvider keys,
byte[] host_challenge,
int scpVersion,
EnumSet<GlobalPlatform.APDUMode> securityLevel)
Establishes a secure channel to the security domain.
|
void |
personalize(pro.javacard.AID aid,
byte[] data)
Sends STORE DATA commands to the application identified
|
void |
personalize(pro.javacard.AID aid,
byte[] data,
int P1)
Sends STORE DATA commands to the application identified
|
void |
putKey(RSAPublicKey pubkey,
int version) |
void |
putKeys(List<GPKey> keys,
boolean replace) |
void |
renameISD(pro.javacard.AID newaid) |
void |
setBlockSize(int size) |
void |
setCardStatus(byte status) |
void |
setSpec(GlobalPlatform.GPSpec spec) |
void |
setStrict(boolean strict) |
void |
storeData(byte[] data,
int P1) |
int |
transmit(ByteBuffer byteBuffer,
ByteBuffer byteBuffer1) |
javax.smartcardio.ResponseAPDU |
transmit(javax.smartcardio.CommandAPDU command) |
public static final int SCP_ANY
public static final int SCP_01_05
public static final int SCP_01_15
public static final int SCP_02_04
public static final int SCP_02_05
public static final int SCP_02_0A
public static final int SCP_02_0B
public static final int SCP_02_14
public static final int SCP_02_15
public static final int SCP_02_1A
public static final int SCP_02_1B
public static final EnumSet<GlobalPlatform.APDUMode> defaultMode
public static final byte CLA_GP
public static final byte CLA_MAC
public static final byte INS_INITIALIZE_UPDATE
public static final byte INS_INSTALL
public static final byte INS_LOAD
public static final byte INS_DELETE
public static final byte INS_GET_STATUS
public static final byte INS_SET_STATUS
public static final byte INS_PUT_KEY
public static final byte INS_STORE_DATA
public static final byte INS_GET_DATA
public static final byte P1_INSTALL_AND_MAKE_SELECTABLE
public static final byte P1_INSTALL_FOR_INSTALL
protected boolean strict
public GlobalPlatform(javax.smartcardio.CardChannel channel,
pro.javacard.AID sdAID)
channel - channel to talk toIllegalArgumentException - if channel is null.public static GlobalPlatform discover(javax.smartcardio.CardChannel channel) throws GPException, javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionpublic static GlobalPlatform connect(javax.smartcardio.CardChannel channel, pro.javacard.AID sdAID) throws javax.smartcardio.CardException, GPException
javax.smartcardio.CardExceptionGPExceptionpublic static String getVersion()
public void close()
close in interface AutoCloseableclose in class javax.smartcardio.CardChannelpublic void setStrict(boolean strict)
public void setBlockSize(int size)
public void setSpec(GlobalPlatform.GPSpec spec)
public pro.javacard.AID getAID()
public javax.smartcardio.CardChannel getCardChannel()
protected void giveStrictWarning(String message) throws GPException
GPExceptionpublic int getScpKeyVersion()
public void openSecureChannel(GPSessionKeyProvider keys, byte[] host_challenge, int scpVersion, EnumSet<GlobalPlatform.APDUMode> securityLevel) throws javax.smartcardio.CardException, GPException
javax.smartcardio.CardExceptionGPExceptionpublic javax.smartcardio.Card getCard()
getCard in class javax.smartcardio.CardChannelpublic int getChannelNumber()
getChannelNumber in class javax.smartcardio.CardChannelpublic javax.smartcardio.ResponseAPDU transmit(javax.smartcardio.CommandAPDU command)
throws javax.smartcardio.CardException
transmit in class javax.smartcardio.CardChanneljavax.smartcardio.CardExceptionpublic int transmit(ByteBuffer byteBuffer, ByteBuffer byteBuffer1) throws javax.smartcardio.CardException
transmit in class javax.smartcardio.CardChanneljavax.smartcardio.CardExceptionpublic int getSCPVersion()
public void loadCapFile(pro.javacard.CAPFile cap,
pro.javacard.AID target)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPExceptionpublic void loadCapFile(pro.javacard.CAPFile cap,
pro.javacard.AID target,
byte[] dap,
String hash)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPException@Deprecated public void installAndMakeSelectable(pro.javacard.AID packageAID, pro.javacard.AID appletAID, pro.javacard.AID instanceAID, byte privileges, byte[] installParams, byte[] installToken) throws GPException, javax.smartcardio.CardException
Before installation the package containing the applet must be loaded onto
the card, see loadCapFile.
This method installs just one applet. Call it several times for packages containing several applets.
packageAID - the package that containing the appletappletAID - the applet to be installedinstanceAID - the applet AID passed to the install method of the applet,
defaults to packageAID if nullprivileges - privileges encoded as byteinstallParams - tagged installation parameters, defaults to 0xC9 00
(ie. no installation parameters) if null, if non-null the
format is 0xC9 len data...GPExceptionjavax.smartcardio.CardExceptionpublic void installAndMakeSelectable(pro.javacard.AID packageAID,
pro.javacard.AID appletAID,
pro.javacard.AID instanceAID,
GPRegistryEntry.Privileges privileges,
byte[] installParams,
byte[] installToken)
throws GPException,
javax.smartcardio.CardException
Before installation the package containing the applet must be loaded onto
the card, see loadCapFile.
This method installs just one applet. Call it several times for packages containing several applets.
packageAID - the package that containing the appletappletAID - the applet to be installedinstanceAID - the applet AID passed to the install method of the applet,
defaults to packageAID if nullprivileges - privileges encoded as an objectinstallParams - tagged installation parameters, defaults to 0xC9 00
(ie. no installation parameters) if null, if non-null the
format is 0xC9 len data...GPExceptionjavax.smartcardio.CardExceptionpublic void installForInstall(pro.javacard.AID packageAID,
pro.javacard.AID appletAID,
pro.javacard.AID instanceAID,
GPRegistryEntry.Privileges privileges,
byte[] installParams,
byte[] installToken)
throws GPException,
javax.smartcardio.CardException
Before installation the package containing the applet must be loaded onto
the card, see loadCapFile.
This method installs just one applet. Call it several times for packages containing several applets.
packageAID - the package that containing the appletappletAID - the applet to be installedinstanceAID - the applet AID passed to the install method of the applet,
defaults to packageAID if nullprivileges - privileges encoded as an objectinstallParams - tagged installation parameters, defaults to 0xC9 00
(ie. no installation parameters) if null, if non-null the
format is 0xC9 len data...GPExceptionjavax.smartcardio.CardExceptionpublic void extradite(pro.javacard.AID what,
pro.javacard.AID to)
throws GPException,
javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionpublic void personalize(pro.javacard.AID aid,
byte[] data)
throws javax.smartcardio.CardException,
GPException
aid - - AID of the target application (or Security Domain)GPExceptionjavax.smartcardio.CardExceptionpublic void personalize(pro.javacard.AID aid,
byte[] data,
int P1)
throws javax.smartcardio.CardException,
GPException
aid - - AID of the target application (or Security Domain)GPExceptionjavax.smartcardio.CardExceptionpublic void storeData(byte[] data,
int P1)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPExceptionpublic void makeDefaultSelected(pro.javacard.AID aid)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPExceptionpublic void lockUnlockApplet(pro.javacard.AID app,
boolean lock)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPExceptionpublic void setCardStatus(byte status)
throws javax.smartcardio.CardException,
GPException
javax.smartcardio.CardExceptionGPExceptionpublic void deleteAID(pro.javacard.AID aid,
boolean deleteDeps)
throws GPException,
javax.smartcardio.CardException
aid on the card. Delete dependencies as well if
deleteDeps is true.aid - identifier of the file to deletedeleteDeps - if true delete dependencies as welljavax.smartcardio.CardException - for low-level communication errorsGPExceptionpublic void deleteKey(int keyver)
throws GPException,
javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionpublic void renameISD(pro.javacard.AID newaid)
throws GPException,
javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionpublic void putKeys(List<GPKey> keys, boolean replace) throws GPException, javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionpublic void putKey(RSAPublicKey pubkey, int version) throws javax.smartcardio.CardException, GPException
javax.smartcardio.CardExceptionGPExceptionpublic GPRegistry getRegistry() throws GPException, javax.smartcardio.CardException
GPExceptionjavax.smartcardio.CardExceptionCopyright © 2018. All rights reserved.