Package es.gob.jmulticard.crypto
Class BcPaceChannelHelper
- java.lang.Object
-
- es.gob.jmulticard.CryptoHelper.PaceChannelHelper
-
- es.gob.jmulticard.crypto.BcPaceChannelHelper
-
public class BcPaceChannelHelper extends CryptoHelper.PaceChannelHelper
Utilidades para el establecimiento de un canal PACE (Password Authenticated Connection Establishment).
-
-
Field Summary
Fields Modifier and Type Field Description private CardAccesscardAccessprivate PaceChatpaceChat-
Fields inherited from class es.gob.jmulticard.CryptoHelper.PaceChannelHelper
CAN_MRZ_PADDING, cryptoHelper, KENC_PADDING, KMAC_PADDING, MAC_PADDING_PRE, MAC2_PADDING_POST
-
-
Constructor Summary
Constructors Constructor Description BcPaceChannelHelper(CryptoHelper ch, CardAccess crdAccess, PaceChat paceCht)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.bouncycastle.math.ec.ECPointbyteArrayToECPoint(byte[] value, org.bouncycastle.math.ec.ECCurve.Fp curve)protected byte[]getSecretNonce(WirelessInitializer pi, byte[] nonce, int aesKeyLength, DigestAlgorithm digestAlgorithm)SecureMessagingopenPaceChannel(byte cla, WirelessInitializer pi, ApduConnection conn)Abre un canal PACE.protected byte[]padAndDigest(byte[] input, byte[] padding, DigestAlgorithm digestAlgorithm, int resultBitLength)-
Methods inherited from class es.gob.jmulticard.CryptoHelper.PaceChannelHelper
bigIntToByteArray, unwrapEcKey
-
-
-
-
Field Detail
-
cardAccess
private final CardAccess cardAccess
-
paceChat
private final PaceChat paceChat
-
-
Constructor Detail
-
BcPaceChannelHelper
public BcPaceChannelHelper(CryptoHelper ch, CardAccess crdAccess, PaceChat paceCht)
Constructor.- Parameters:
ch- Utilidad para operaciones criptográficas.crdAccess- CardAccess de la tarjeta.paceCht- PACE CHAT a usar en el establecimiento del canal PACE.
-
-
Method Detail
-
openPaceChannel
public SecureMessaging openPaceChannel(byte cla, WirelessInitializer pi, ApduConnection conn) throws ApduConnectionException, IcaoException
Description copied from class:CryptoHelper.PaceChannelHelperAbre un canal PACE.- Specified by:
openPaceChannelin classCryptoHelper.PaceChannelHelper- Parameters:
cla- Clase de APDU para los comandos de establecimiento de canal.pi- Valor de inicialización del canal. Puede ser un CAN (Card Access Number), una MRZ (Machine Readable Zone) o un PIN.conn- Conexión hacia la tarjeta inteligente.- Returns:
- SecureMessaging Objeto para el envío de mensajes seguros a través de canal PACE.
- Throws:
ApduConnectionException- Si hay problemas de conexión con la tarjeta.IcaoException- Si hay problemas en la apertura del canal.
-
padAndDigest
protected byte[] padAndDigest(byte[] input, byte[] padding, DigestAlgorithm digestAlgorithm, int resultBitLength) throws java.io.IOException- Throws:
java.io.IOException
-
getSecretNonce
protected byte[] getSecretNonce(WirelessInitializer pi, byte[] nonce, int aesKeyLength, DigestAlgorithm digestAlgorithm) throws PaceException
- Throws:
PaceException
-
byteArrayToECPoint
protected static org.bouncycastle.math.ec.ECPoint byteArrayToECPoint(byte[] value, org.bouncycastle.math.ec.ECCurve.Fp curve)
-
-