Class CommandApdu
java.lang.Object
es.gob.jmulticard.apdu.Apdu
es.gob.jmulticard.apdu.CommandApdu
- Direct Known Subclasses:
CeresLoadDataApduCommand, CeresSignDataApduCommand, CeresVerifyApduCommand, ChangePinApduCommand, CheckVerifyRetriesLeftApduCommand, CipheredApdu, Cwa14890CipheredApdu, EnvelopeDataApduCommand, ExternalAuthenticateApduCommand, GemaltoVerifyApduCommand, GeneralAuthenticateApduCommand, GetChallengeApduCommand, GetChipInfoApduCommand, GetResponseApduCommand, GiDeRetriesLeftApduCommand, GiDeVerifyApduCommand, InternalAuthenticateApduCommand, LoadDataApduCommand, MseSetApduCommand, MseSetSignatureKeyApduCommand, PsoSignHashApduCommand, PsoVerifyCertificateApduCommand, ReadBinaryApduCommand, ReadRecordApduCommand, RetriesLeftApduCommand, SelectDfByNameApduCommand, SelectFileByIdApduCommand, SignDataApduCommand, StcmVerifyApduCommand, VerifyApduCommand
Comando APDU para comunicación con tarjeta inteligente.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommandApdu(byte[] bytes) Construye una APDU en base a un array de octetos.CommandApdu(byte apduCla, byte apduIns, byte param1, byte param2, byte[] data, Integer ne) Construye una APDU genérica. -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]getBody(byte[] bytes) bytegetCla()Devuelve la clase (CLA) de APDU.byte[]getData()Obtiene el cuerpo de la APDU.bytegetIns()Devuelve el octeto identificador de la instrucción (INS) que esta APDU representa.getLe()Obtiene el número máximo de octetos esperados en la APDU de respuesta.private static IntegergetLength(byte[] bytes) bytegetP1()Devuelve el primer parámetro (P1) de la APDU.bytegetP2()Devuelve el segundo parámetro (P2) de la APDU.voidsetLe(int apduLe) Establece el número de octetos esperados en la APDU de respuesta.
-
Field Details
-
cla
private final byte cla -
ins
private final byte ins -
p1
private final byte p1 -
p2
private final byte p2 -
le
-
body
private final byte[] body
-
-
Constructor Details
-
CommandApdu
public CommandApdu(byte[] bytes) Construye una APDU en base a un array de octetos.- Parameters:
bytes- Array de octetos para la construcción del objeto.
-
CommandApdu
Construye una APDU genérica.- Parameters:
apduCla- Clase (CLA) de APDU.apduIns- Identificador de la instrucción (INS) que esta APDU representa.param1- Primer parámetro (P1) de la APDU.param2- Segundo parámetro (P2) de la APDU.data- Datos del comando.ne- Número de octetos esperados en la respuesta (Ne).
-
-
Method Details
-
getBody
private static byte[] getBody(byte[] bytes) -
getLength
-
getCla
public byte getCla()Devuelve la clase (CLA) de APDU.- Returns:
- Clase (CLA) de APDU.
-
getData
public byte[] getData()Obtiene el cuerpo de la APDU.- Returns:
- Cuerpo de la APDU, o
nullsi no está establecido.
-
getIns
public byte getIns()Devuelve el octeto identificador de la instrucción (INS) que esta APDU representa.- Returns:
- Identificador de instrucción.
-
getLe
Obtiene el número máximo de octetos esperados en la APDU de respuesta.- Returns:
- Número máximo de octetos esperados en la APDU de
respuesta, o
nullsi no está establecido.
-
getP1
public byte getP1()Devuelve el primer parámetro (P1) de la APDU.- Returns:
- Primer parámetro (P1) de la APDU.
-
getP2
public byte getP2()Devuelve el segundo parámetro (P2) de la APDU.- Returns:
- Segundo parámetro (P2) de la APDU.
-
setLe
public void setLe(int apduLe) Establece el número de octetos esperados en la APDU de respuesta.- Parameters:
apduLe- Número esperado de octetos.
-