Search in sources :

Example 11 with JseCryptoHelper

use of es.gob.jmulticard.JseCryptoHelper in project jmulticard by ctt-gob-es.

the class Ceres430KeyStoreImpl method engineLoad.

/**
 * {@inheritDoc}
 */
@Override
public void engineLoad(final InputStream stream, final char[] password) throws IOException {
    // Ponemos la conexion por defecto
    final ApduConnection conn;
    try {
        conn = Ceres430Provider.getDefaultApduConnection() == null ? // $NON-NLS-1$
        (ApduConnection) Class.forName("es.gob.jmulticard.jse.smartcardio.SmartcardIoConnection").getConstructor().newInstance() : Ceres430Provider.getDefaultApduConnection();
    } catch (final Exception e) {
        // $NON-NLS-1$
        throw new IllegalStateException("No hay una conexion de APDU por defecto: " + e);
    }
    // Aqui se realiza el acceso e inicializacion del DNIe
    this.cryptoCard = new CeresSc(conn, password != null ? new CachePasswordCallback(password) : null, new JseCryptoHelper(), null);
    this.aliases = Arrays.asList(this.cryptoCard.getAliases());
}
Also used : JseCryptoHelper(es.gob.jmulticard.JseCryptoHelper) ApduConnection(es.gob.jmulticard.apdu.connection.ApduConnection) AuthenticationModeLockedException(es.gob.jmulticard.card.AuthenticationModeLockedException) CryptoCardException(es.gob.jmulticard.card.CryptoCardException) BadPinException(es.gob.jmulticard.card.BadPinException) ProviderException(java.security.ProviderException) IOException(java.io.IOException) PinException(es.gob.jmulticard.card.PinException) CeresSc(es.gob.jmulticard.card.dnie.CeresSc)

Example 12 with JseCryptoHelper

use of es.gob.jmulticard.JseCryptoHelper in project jmulticard by ctt-gob-es.

the class CeresKeyStoreImpl method engineLoad.

/**
 * {@inheritDoc}
 */
@Override
public void engineLoad(final InputStream stream, final char[] password) throws IOException {
    // Aqui se realiza el acceso e inicializacion de la tarjeta
    this.cryptoCard = new Ceres(getApduConnection(), new JseCryptoHelper());
    // Precargamos los alias
    loadAliases();
}
Also used : Ceres(es.gob.jmulticard.card.fnmt.ceres.Ceres) JseCryptoHelper(es.gob.jmulticard.JseCryptoHelper)

Example 13 with JseCryptoHelper

use of es.gob.jmulticard.JseCryptoHelper in project jmulticard by ctt-gob-es.

the class SmartCafeKeyStoreImpl method engineLoad.

/**
 * {@inheritDoc}
 */
@Override
public void engineLoad(final InputStream stream, final char[] password) throws IOException {
    // Ponemos la conexion por defecto
    final ApduConnection conn = new es.gob.jmulticard.jse.smartcardio.SmartcardIoConnection();
    // Aqui se realiza el acceso e inicializacion de la tarjeta
    this.cryptoCard = new SmartCafePkcs15Applet(conn, new JseCryptoHelper());
    if (password != null) {
        this.cryptoCard.setPasswordCallback(new CachePasswordCallback(password));
    }
    this.aliases = Arrays.asList(this.cryptoCard.getAliases());
}
Also used : SmartCafePkcs15Applet(es.gob.jmulticard.card.gide.smartcafe.SmartCafePkcs15Applet) JseCryptoHelper(es.gob.jmulticard.JseCryptoHelper) ApduConnection(es.gob.jmulticard.apdu.connection.ApduConnection)

Aggregations

JseCryptoHelper (es.gob.jmulticard.JseCryptoHelper)13 CommandApdu (es.gob.jmulticard.apdu.CommandApdu)4 ApduConnection (es.gob.jmulticard.apdu.connection.ApduConnection)4 Test (org.junit.Test)4 CryptoCardException (es.gob.jmulticard.card.CryptoCardException)3 PinException (es.gob.jmulticard.card.PinException)3 PasswordCallback (javax.security.auth.callback.PasswordCallback)3 ApduEncrypter (es.gob.jmulticard.apdu.connection.ApduEncrypter)2 ApduEncrypterDes (es.gob.jmulticard.apdu.connection.ApduEncrypterDes)2 AuthenticationModeLockedException (es.gob.jmulticard.card.AuthenticationModeLockedException)2 BadPinException (es.gob.jmulticard.card.BadPinException)2 Ceres (es.gob.jmulticard.card.fnmt.ceres.Ceres)2 SmartCafePkcs15Applet (es.gob.jmulticard.card.gide.smartcafe.SmartCafePkcs15Applet)2 PaceConnection (es.gob.jmulticard.card.pace.PaceConnection)2 PaceInitializer (es.gob.jmulticard.card.pace.PaceInitializer)2 PaceInitializerCan (es.gob.jmulticard.card.pace.PaceInitializerCan)2 SecureMessaging (es.gob.jmulticard.de.tsenger.androsmex.iso7816.SecureMessaging)2 IOException (java.io.IOException)2 KeyStore (java.security.KeyStore)2 PasswordProtection (java.security.KeyStore.PasswordProtection)2