Search in sources :

Example 1 with Dnie

use of es.gob.jmulticard.card.dnie.Dnie in project jmulticard by ctt-gob-es.

the class TestDnieChangePIN method testChangePIN.

/**
 * Test para probar el cambio de PIN tras la apertura del canal seguro.
 * @throws Exception En cualquier error.
 */
@SuppressWarnings("static-method")
@Test
@Ignore
public void testChangePIN() throws Exception {
    // $NON-NLS-1$
    final CachePasswordCallback cpc = new CachePasswordCallback("password".toCharArray());
    final ApduConnection ac = new SmartcardIoConnection();
    final Dnie dni = DnieFactory.getDnie(ac, cpc, new JseCryptoHelper(), null);
    // $NON-NLS-1$ //$NON-NLS-2$
    dni.changePIN("password", "pinNuevo");
}
Also used : Dnie(es.gob.jmulticard.card.dnie.Dnie) SmartcardIoConnection(es.gob.jmulticard.jse.smartcardio.SmartcardIoConnection) ApduConnection(es.gob.jmulticard.apdu.connection.ApduConnection) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with Dnie

use of es.gob.jmulticard.card.dnie.Dnie in project jmulticard by ctt-gob-es.

the class TestPaceDnie method main.

/**
 * Main.
 * @param args No se usa.
 * @throws Exception En cualquier error.
 */
public static void main(final String[] args) throws Exception {
    final ApduConnection conn = new SmartcardIoConnection();
    // $NON-NLS-1$
    final CachePasswordCallback cpc = new CachePasswordCallback("password".toCharArray());
    final Dnie dni = DnieFactory.getDnie(conn, cpc, new JseCryptoHelper(), null);
    // $NON-NLS-1$
    System.out.println("Canal PACE abierto");
    // $NON-NLS-1$ //$NON-NLS-2$
    dni.changePIN("password", "1234512345");
    // $NON-NLS-1$
    System.out.println("Se ha realizado el cambio de PIN correctamente");
}
Also used : Dnie(es.gob.jmulticard.card.dnie.Dnie) SmartcardIoConnection(es.gob.jmulticard.jse.smartcardio.SmartcardIoConnection) ApduConnection(es.gob.jmulticard.apdu.connection.ApduConnection)

Aggregations

ApduConnection (es.gob.jmulticard.apdu.connection.ApduConnection)2 Dnie (es.gob.jmulticard.card.dnie.Dnie)2 SmartcardIoConnection (es.gob.jmulticard.jse.smartcardio.SmartcardIoConnection)2 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1