Class Dnie3

    • Field Detail

      • idesp

        private java.lang.String idesp
    • 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: AbstractSmartCard
        Obtiene el nombre de la tarjeta.
        Overrides:
        getCardName in class Dnie
        Returns:
        Nombre de la tarjeta.
      • getPinRetriesLeft

        public int getPinRetriesLeft()
                              throws ApduConnectionException
        Description copied from class: Dnie
        Devuelve los intentos restantes de comprobación de PIN del DNIe.
        Overrides:
        getPinRetriesLeft in class Dnie
        Returns:
        Intentos restantes de comprobación de PIN del DNIe.
        Throws:
        ApduConnectionException - Cuando hay problemas en el proceso.
      • openSecureChannelIfNotAlreadyOpened

        public void openSecureChannelIfNotAlreadyOpened​(boolean doChv)
                                                 throws CryptoCardException,
                                                        PinException
        Description copied from class: Dnie
        Establece y abre el canal seguro CWA-14890 si no lo estaba ya.
        Overrides:
        openSecureChannelIfNotAlreadyOpened in class Dnie
        Parameters:
        doChv - true si la apertura de canal seguro debe incluir la verificación de PIN, false si 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.
      • needsPinForLoadingCerts

        protected boolean needsPinForLoadingCerts()
        Description copied from class: Dnie
        Indica si es necesario haber verificado o no el PIN para poder leer los certicados.
        Overrides:
        needsPinForLoadingCerts in class Dnie
        Returns:
        true si es necesario haber verificado o no el PIN para poder leer los certicados, false en caso contrario.
      • checkSecurityObjects

        public final java.security.cert.X509Certificate[] checkSecurityObjects()
                                                                        throws java.io.IOException,
                                                                               TlvException,
                                                                               Asn1Exception,
                                                                               java.security.SignatureException,
                                                                               java.security.cert.CertificateException
        Description copied from interface: MrtdLds1
        Comprueba la validez de los objetos de seguridad a partir del SOD.
        Specified by:
        checkSecurityObjects in interface MrtdLds1
        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.IOException
        Description copied from interface: MrtdLds1
        Obtiene el CardAccess.
        Specified by:
        getCardAccess in interface MrtdLds1
        Returns:
        CardAccess.
        Throws:
        java.io.IOException - Si no se puede leer el fichero.
      • getAtrInfo

        public final byte[] getAtrInfo()
                                throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el ATR/INFO.
        Specified by:
        getAtrInfo in interface MrtdLds1
        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: MrtdLds1
        Obtiene el DG1 (MRZ). Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg1 in interface MrtdLds1
        Returns:
        DG1 (MRZ).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg2

        public final SubjectFacePhoto getDg2()
                                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG2 (fotografía del rostro del titular). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg2 in interface MrtdLds1
        Returns:
        DG2 (fotografía del rostro del titular).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg3

        public byte[] getDg3()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene 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.
        Specified by:
        getDg3 in interface MrtdLds1
        Returns:
        DG3 (elementos de identificación adicionales - Dedos).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg7

        public final SubjectSignaturePhoto getDg7()
                                           throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene 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.
        Specified by:
        getDg7 in interface MrtdLds1
        Returns:
        DG7 (imagen de la firma o marca habitual exhibida).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg11

        public final AdditionalPersonalDetails getDg11()
                                                throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG11 (detalles personales adicionales). Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg11 in interface MrtdLds1
        Returns:
        DG11 (detalles personales adicionales).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg12

        public final byte[] getDg12()
                             throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG12 (detalles del documento adicionales). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg12 in interface MrtdLds1
        Returns:
        DG12 (detalles del documento adicionales).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg13

        public OptionalDetails getDg13()
                                throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG13 (detalles opcionales). Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg13 in interface MrtdLds1
        Returns:
        DG13 (detalles opcionales).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg14

        public final SecurityOptions getDg14()
                                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG14 (opciones de seguridad). Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg14 in interface MrtdLds1
        Returns:
        DG14 (opciones de seguridad).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getSod

        public final Sod getSod()
                         throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el SOD. El SOD contiene las huellas digitales de los DG. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getSod in interface MrtdLds1
        Returns:
        SOD.
        Throws:
        java.io.IOException - Si hay problemas obteniendo el objeto.
      • getCom

        public final Com getCom()
                         throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el COM. El COM contiene los "datos comunes" (Common Data). Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getCom in interface MrtdLds1
        Returns:
        COM.
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getCardSecurity

        public byte[] getCardSecurity()
                               throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el CardSecurity.
        Specified by:
        getCardSecurity in interface MrtdLds1
        Returns:
        CardSecurity.
        Throws:
        java.io.IOException - Si no se puede leer el fichero.
      • getDg4

        public byte[] getDg4()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene 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.
        Specified by:
        getDg4 in interface MrtdLds1
        Returns:
        DG4 (elementos de identificación adicionales - Iris).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg5

        public byte[] getDg5()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG5 (retrato exhibido). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg5 in interface MrtdLds1
        Returns:
        DG5 (retrato exhibido).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg6

        public byte[] getDg6()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG6 (reservado para uso futuro). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg6 in interface MrtdLds1
        Returns:
        DG6 (reservado para uso futuro).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg8

        public byte[] getDg8()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG8 (elemento datos). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg8 in interface MrtdLds1
        Returns:
        DG7 (elemento datos).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg9

        public byte[] getDg9()
                      throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG9 (elemento estructura). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg9 in interface MrtdLds1
        Returns:
        DG9 (elemento estructura).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg10

        public byte[] getDg10()
                       throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG10 (elemento sustancia). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg10 in interface MrtdLds1
        Returns:
        DG10 (elemento sustancia).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg15

        public byte[] getDg15()
                       throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene 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.
        Specified by:
        getDg15 in interface MrtdLds1
        Returns:
        DG15 (información de clave pública de autenticación activa).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDg16

        public byte[] getDg16()
                       throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DG16 (personas que han de notificarse). Devuelve el objeto binario sin tratar. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDg16 in interface MrtdLds1
        Returns:
        DG16 (personas que han de notificarse).
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.
      • getDir

        public final byte[] getDir()
                            throws java.io.IOException
        Description copied from interface: MrtdLds1
        Obtiene el DIR. Puede necesitar que el canal de usuario esté previamente establecido.
        Specified by:
        getDir in interface MrtdLds1
        Returns:
        DIR.
        Throws:
        java.io.IOException - Si hay problemas leyendo el fichero.