Package es.gob.jmulticard.apdu
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
public class CommandApdu extends Apdu
Comando APDU para comunicación con tarjeta inteligente.
-
-
Constructor Summary
Constructors Constructor Description CommandApdu(byte[] bytes)Construye una APDU en base a un array de octetos.CommandApdu(byte apduCla, byte apduIns, byte param1, byte param2, byte[] data, java.lang.Integer ne)Construye una APDU genérica.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private 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.java.lang.IntegergetLe()Obtiene el número máximo de octetos esperados en la APDU de respuesta.private static java.lang.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.
-
-
-
Constructor Detail
-
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
public CommandApdu(byte apduCla, byte apduIns, byte param1, byte param2, byte[] data, java.lang.Integer ne)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 Detail
-
getBody
private static byte[] getBody(byte[] bytes)
-
getLength
private static java.lang.Integer getLength(byte[] bytes)
-
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
public java.lang.Integer 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.
-
-