Search in sources :

Example 1 with CeresSc

use of es.gob.jmulticard.card.dnie.CeresSc 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)

Aggregations

JseCryptoHelper (es.gob.jmulticard.JseCryptoHelper)1 ApduConnection (es.gob.jmulticard.apdu.connection.ApduConnection)1 AuthenticationModeLockedException (es.gob.jmulticard.card.AuthenticationModeLockedException)1 BadPinException (es.gob.jmulticard.card.BadPinException)1 CryptoCardException (es.gob.jmulticard.card.CryptoCardException)1 PinException (es.gob.jmulticard.card.PinException)1 CeresSc (es.gob.jmulticard.card.dnie.CeresSc)1 IOException (java.io.IOException)1 ProviderException (java.security.ProviderException)1