Package es.gob.jmulticard.card.dnie
Class Dnie3
- java.lang.Object
-
- All Implemented Interfaces:
Card,CryptoCard,Cwa14890Card,Dni,MrtdLds1
- Direct Known Subclasses:
DnieNfc,IcaoMrtdWithBac
public class Dnie3 extends Dnie implements MrtdLds1
DNI Electrónico versión 3.0.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringidesp-
Fields inherited from class es.gob.jmulticard.card.dnie.Dnie
rawConnection
-
Fields inherited from interface es.gob.jmulticard.card.icao.MrtdLds1
FILE_ATR_INFO_LOCATION, FILE_CARD_ACCESS_LOCATION, FILE_CARD_SECURITY_LOCATION, FILE_COM_LOCATION, FILE_DG01_LOCATION, FILE_DG02_LOCATION, FILE_DG03_LOCATION, FILE_DG04_LOCATION, FILE_DG05_LOCATION, FILE_DG06_LOCATION, FILE_DG07_LOCATION, FILE_DG08_LOCATION, FILE_DG09_LOCATION, FILE_DG10_LOCATION, FILE_DG11_LOCATION, FILE_DG12_LOCATION, FILE_DG13_LOCATION, FILE_DG14_LOCATION, FILE_DG15_LOCATION, FILE_DG16_LOCATION, FILE_DIR_LOCATION, FILE_SOD_LOCATION
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDnie3(ApduConnection conn, javax.security.auth.callback.PasswordCallback pwc, CryptoHelper cryptoHlpr, javax.security.auth.callback.CallbackHandler ch)Construye una clase que representa un DNIe 3.0.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.cert.X509Certificate[]checkSecurityObjects()Comprueba la validez de los objetos de seguridad a partir del SOD.byte[]getAtrInfo()Obtiene el ATR/INFO.byte[]getCardAccess()Obtiene el CardAccess.java.lang.StringgetCardName()Obtiene el nombre de la tarjeta.byte[]getCardSecurity()Obtiene el CardSecurity.ComgetCom()Obtiene el COM.MrzgetDg1()Obtiene el DG1 (MRZ).byte[]getDg10()Obtiene el DG10 (elemento sustancia).AdditionalPersonalDetailsgetDg11()Obtiene el DG11 (detalles personales adicionales).byte[]getDg12()Obtiene el DG12 (detalles del documento adicionales).OptionalDetailsgetDg13()Obtiene el DG13 (detalles opcionales).SecurityOptionsgetDg14()Obtiene el DG14 (opciones de seguridad).byte[]getDg15()Obtiene el DG15 (información de clave pública de autenticación activa).byte[]getDg16()Obtiene el DG16 (personas que han de notificarse).SubjectFacePhotogetDg2()Obtiene el DG2 (fotografía del rostro del titular).byte[]getDg3()Obtiene el DG3 (elementos de identificación adicionales - Dedos).byte[]getDg4()Obtiene el DG4 (elementos de identificación adicionales - Iris).byte[]getDg5()Obtiene el DG5 (retrato exhibido).byte[]getDg6()Obtiene el DG6 (reservado para uso futuro).SubjectSignaturePhotogetDg7()Obtiene el DG7 (imagen de la firma o marca habitual exhibida).byte[]getDg8()Obtiene el DG8 (elemento datos).byte[]getDg9()Obtiene el DG9 (elemento estructura).byte[]getDir()Obtiene el DIR.intgetPinRetriesLeft()Devuelve los intentos restantes de comprobación de PIN del DNIe.SodgetSod()Obtiene el SOD.protected booleanneedsPinForLoadingCerts()Indica si es necesario haber verificado o no el PIN para poder leer los certicados.ApduConnectionopenPinChannel()Abre y establece el canal seguro de PIN.voidopenSecureChannelIfNotAlreadyOpened()Establece y abre el canal seguro CWA-14890 si no lo estaba ya.voidopenSecureChannelIfNotAlreadyOpened(boolean doChv)Establece y abre el canal seguro CWA-14890 si no lo estaba ya.ApduConnectionopenUserChannel()Abre y establece el canal seguro de usuario.-
Methods inherited from class es.gob.jmulticard.card.dnie.Dnie
changePIN, cipherData, connect, externalAuthentication, getAliases, getCertificate, getChrCCvIfd, getCryptoHelper, getCwa14890PrivateConstants, getCwa14890PublicConstants, getIccCertPublicKey, getIdesp, getIfdKeyLength, getIfdPrivateKey, getInternalAuthenticateMessage, getInternalPasswordCallback, getPasswordCallback, getPinMessage, getPrivateKey, getRefIccPrivateKey, getSerialNumber, isSecurityChannelOpen, selectMasterFile, setCallbackHandler, setKeysToAuthentication, setPasswordCallback, sign, signInternal, toString, verifyIcc, verifyIfdCertificateChain, verifyPin
-
Methods inherited from class es.gob.jmulticard.card.iso7816eight.AbstractIso7816EightCard
verifyCertificate
-
Methods inherited from class es.gob.jmulticard.card.iso7816four.AbstractIso7816FourCard
getChallenge, readAllRecords, readBinaryComplete, selectFileById, selectFileByIdAndRead, selectFileByLocationAndRead, selectFileByName, selectFileByName, setPublicKeyToVerification
-
Methods inherited from class es.gob.jmulticard.card.AbstractSmartCard
getCla, getConnection, sendArbitraryApdu, setConnection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface es.gob.jmulticard.card.cwa14890.Cwa14890Card
getChallenge
-
-
-
-
Constructor Detail
-
Dnie3
protected Dnie3(ApduConnection conn, javax.security.auth.callback.PasswordCallback pwc, CryptoHelper cryptoHlpr, javax.security.auth.callback.CallbackHandler ch) throws ApduConnectionException
Construye una clase que representa un DNIe 3.0.- Parameters:
conn- Conexión con la tarjeta.pwc- PasswordCallback para obtener el PIN del DNIe.cryptoHlpr- Funcionalidades criptográficas de utilidad que pueden variar entre máquinas virtuales.ch- Gestor de las Callbacks (PIN, confirmación, etc.).- Throws:
ApduConnectionException- Si la conexión con la tarjeta se proporciona cerrada y no es posible abrirla.
-
-
Method Detail
-
getCardName
public java.lang.String getCardName()
Description copied from class:AbstractSmartCardObtiene el nombre de la tarjeta.- Overrides:
getCardNamein classDnie- Returns:
- Nombre de la tarjeta.
-
getPinRetriesLeft
public int getPinRetriesLeft() throws ApduConnectionExceptionDescription copied from class:DnieDevuelve los intentos restantes de comprobación de PIN del DNIe.- Overrides:
getPinRetriesLeftin classDnie- Returns:
- Intentos restantes de comprobación de PIN del DNIe.
- Throws:
ApduConnectionException- Cuando hay problemas en el proceso.
-
openSecureChannelIfNotAlreadyOpened
public void openSecureChannelIfNotAlreadyOpened() throws CryptoCardException, PinExceptionDescription copied from class:DnieEstablece y abre el canal seguro CWA-14890 si no lo estaba ya.- Overrides:
openSecureChannelIfNotAlreadyOpenedin classDnie- Throws:
CryptoCardException- Si hay problemas en el proceso.PinException- Si el PIN usado para la apertura de canal no es válido o la tarjeta tiene el PIN bloqueado.PasswordCallbackNotFoundException- Si no se ha proporcionado una forma de obtener el PIN.
-
openSecureChannelIfNotAlreadyOpened
public void openSecureChannelIfNotAlreadyOpened(boolean doChv) throws CryptoCardException, PinExceptionDescription copied from class:DnieEstablece y abre el canal seguro CWA-14890 si no lo estaba ya.- Overrides:
openSecureChannelIfNotAlreadyOpenedin classDnie- Parameters:
doChv-truesi la apertura de canal seguro debe incluir la verificación de PIN,falsesi debe abrirse canal seguro sin verificar PIN.- Throws:
CryptoCardException- Si hay problemas en el proceso.PinException- Si el PIN usado para la apertura de canal no es válido o la tarjeta tiene el PIN bloqueado.PasswordCallbackNotFoundException- Si no se ha proporcionado una forma de obtener el PIN.
-
openPinChannel
public final ApduConnection openPinChannel() throws CryptoCardException
Abre y establece el canal seguro de PIN.- Returns:
- Nueva conexión establecida.
- Throws:
CryptoCardException- Si hay problemas en la apertura de canal.
-
openUserChannel
public final ApduConnection openUserChannel() throws CryptoCardException
Abre y establece el canal seguro de usuario.- Returns:
- Nueva conexión establecida.
- Throws:
CryptoCardException- Si hay problemas en la apertura de canal.
-
needsPinForLoadingCerts
protected boolean needsPinForLoadingCerts()
Description copied from class:DnieIndica si es necesario haber verificado o no el PIN para poder leer los certicados.- Overrides:
needsPinForLoadingCertsin classDnie- Returns:
truesi es necesario haber verificado o no el PIN para poder leer los certicados,falseen caso contrario.
-
checkSecurityObjects
public final java.security.cert.X509Certificate[] checkSecurityObjects() throws java.io.IOException, TlvException, Asn1Exception, java.security.SignatureException, java.security.cert.CertificateExceptionDescription copied from interface:MrtdLds1Comprueba la validez de los objetos de seguridad a partir del SOD.- Specified by:
checkSecurityObjectsin interfaceMrtdLds1- Returns:
- Cadena de certificados del firmante del SOD (para comprobación externa).
- Throws:
java.io.IOException- Si no se puede finalizar la comprobación o esta resulta en que algún objeto no pasa las validaciones.TlvException- Si el SOD del documento no es un TLV válido.Asn1Exception- Si el SOD es estructuralmente incorrecto.java.security.SignatureException- Si la firma del SOD es inválida o presenta problemas.java.security.cert.CertificateException- Si los certificados de firma del SOD presentan problemas.
-
getCardAccess
public final byte[] getCardAccess() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el CardAccess.- Specified by:
getCardAccessin interfaceMrtdLds1- Returns:
- CardAccess.
- Throws:
java.io.IOException- Si no se puede leer el fichero.
-
getAtrInfo
public final byte[] getAtrInfo() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el ATR/INFO.- Specified by:
getAtrInfoin interfaceMrtdLds1- Returns:
- ATR/INFO.
- Throws:
java.io.IOException- Si no se puede leer el fichero.
-
getDg1
public final Mrz getDg1() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG1 (MRZ). Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg2
public final SubjectFacePhoto getDg2() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG2 (fotografía del rostro del titular). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg3
public byte[] getDg3() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG3 (elementos de identificación adicionales - Dedos). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de administración esté previamente establecido.
-
getDg7
public final SubjectSignaturePhoto getDg7() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG7 (imagen de la firma o marca habitual exhibida). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg11
public final AdditionalPersonalDetails getDg11() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG11 (detalles personales adicionales). Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg12
public final byte[] getDg12() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG12 (detalles del documento adicionales). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg13
public OptionalDetails getDg13() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG13 (detalles opcionales). Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg14
public final SecurityOptions getDg14() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el DG14 (opciones de seguridad). Puede necesitar que el canal de usuario esté previamente establecido.
-
getSod
public final Sod getSod() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el SOD. El SOD contiene las huellas digitales de los DG. Puede necesitar que el canal de usuario esté previamente establecido.
-
getCom
public final Com getCom() throws java.io.IOException
Description copied from interface:MrtdLds1Obtiene el COM. El COM contiene los "datos comunes" (Common Data). Puede necesitar que el canal de usuario esté previamente establecido.
-
getCardSecurity
public byte[] getCardSecurity() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el CardSecurity.- Specified by:
getCardSecurityin interfaceMrtdLds1- Returns:
- CardSecurity.
- Throws:
java.io.IOException- Si no se puede leer el fichero.
-
getDg4
public byte[] getDg4() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG4 (elementos de identificación adicionales - Iris). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de administración esté previamente establecido.
-
getDg5
public byte[] getDg5() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG5 (retrato exhibido). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg6
public byte[] getDg6() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG6 (reservado para uso futuro). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg8
public byte[] getDg8() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG8 (elemento datos). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg9
public byte[] getDg9() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG9 (elemento estructura). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg10
public byte[] getDg10() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG10 (elemento sustancia). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg15
public byte[] getDg15() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG15 (información de clave pública de autenticación activa). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDg16
public byte[] getDg16() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DG16 (personas que han de notificarse). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
-
getDir
public final byte[] getDir() throws java.io.IOExceptionDescription copied from interface:MrtdLds1Obtiene el DIR. Puede necesitar que el canal de usuario esté previamente establecido.
-
-