Class BcPaceChannelHelper
java.lang.Object
es.gob.jmulticard.CryptoHelper.PaceChannelHelper
es.gob.jmulticard.crypto.BcPaceChannelHelper
Utilidades para el establecimiento de un canal PACE (Password Authenticated Connection Establishment).
-
Field Summary
FieldsFields inherited from class CryptoHelper.PaceChannelHelper
CAN_MRZ_PADDING, cryptoHelper, KENC_PADDING, KMAC_PADDING, MAC_PADDING_PRE, MAC2_PADDING_POST -
Constructor Summary
ConstructorsConstructorDescriptionBcPaceChannelHelper(CryptoHelper ch, CardAccess crdAccess, PaceChat paceCht) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) openPaceChannel(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 CryptoHelper.PaceChannelHelper
bigIntToByteArray, unwrapEcKey
-
Field Details
-
cardAccess
-
paceChat
-
-
Constructor Details
-
BcPaceChannelHelper
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 Details
-
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 IOException - Throws:
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)
-