es.gob.jmulticard.jse.provider

## Class DnieKeyStore

- java.lang.Object
- - java.security.KeyStore
  - - es.gob.jmulticard.jse.provider.DnieKeyStore

-     public class DnieKeyStore
      extends java.security.KeyStore

  JCA Keystore for DNIe. It allows retrieving MRTD data type from DNIe.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.security.KeyStore

      `java.security.KeyStore.Builder, java.security.KeyStore.CallbackHandlerProtection, java.security.KeyStore.Entry, java.security.KeyStore.LoadStoreParameter, java.security.KeyStore.PasswordProtection, java.security.KeyStore.PrivateKeyEntry, java.security.KeyStore.ProtectionParameter, java.security.KeyStore.SecretKeyEntry, java.security.KeyStore.TrustedCertificateEntry`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `AUTH_CERT_ALIAS`
    `static java.lang.String` | `SIGN_CERT_ALIAS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DnieKeyStore(java.security.KeyStoreSpi keyStoreSpi, java.security.Provider provider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsLabels(java.lang.String alias)`
    `DG1_Dnie` | `getDatagroup1()` Read DG1 data type.
    `DG11` | `getDatagroup11()` Read DG11 data type.
    `DG13` | `getDatagroup13()` Read DG13 data type.
    `DG2` | `getDatagroup2()` Read DG2 data type.
    `DG7` | `getDatagroup7()` Read DG7 data type.
    `byte[]` | `getDataObject(java.lang.String label)`
    `EF_COM` | `getEFCOM()` Read EF.COM data type.
    `boolean` | `verifyAge(java.util.Date birthDate)` Verify if the age date read from DNIe is later than the one passed.
    `boolean` | `verifyAge(java.lang.String birthDate)` Verify if the age date read from DNIe is later than the one passed.

    - ### Methods inherited from class java.security.KeyStore

      `aliases, containsAlias, deleteEntry, entryInstanceOf, getCertificate, getCertificateAlias, getCertificateChain, getCreationDate, getDefaultType, getEntry, getInstance, getInstance, getInstance, getKey, getProvider, getType, isCertificateEntry, isKeyEntry, load, load, setCertificateEntry, setEntry, setKeyEntry, setKeyEntry, size, store, store`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### AUTH_CERT_ALIAS

          public static final java.lang.String AUTH_CERT_ALIAS

      See Also:
        Constant Field Values

    - #### SIGN_CERT_ALIAS

          public static final java.lang.String SIGN_CERT_ALIAS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DnieKeyStore

          public DnieKeyStore(java.security.KeyStoreSpi keyStoreSpi,
                              java.security.Provider provider)

  - ### Method Detail

    - #### containsLabels

          public boolean containsLabels(java.lang.String alias)

    - #### getDatagroup1

          public DG1_Dnie getDatagroup1()

      Read DG1 data type.
      Returns:
        DG1 data.

    - #### getDatagroup11

          public DG11 getDatagroup11()

      Read DG11 data type.
      Returns:
        DG11 data.

    - #### getDatagroup13

          public DG13 getDatagroup13()

      Read DG13 data type.
      Returns:
        DG13 data.

    - #### getDatagroup2

          public DG2 getDatagroup2()

      Read DG2 data type.
      Returns:
        DG2 data.

    - #### getDatagroup7

          public DG7 getDatagroup7()

      Read DG7 data type.
      Returns:
        DG7 data.

    - #### getDataObject

          public byte[] getDataObject(java.lang.String label)

    - #### getEFCOM

          public EF_COM getEFCOM()

      Read EF.COM data type.
      Returns:
        EF.COM data.

    - #### verifyAge

          public boolean verifyAge(java.util.Date birthDate)
                            throws java.security.KeyStoreException

      Verify if the age date read from DNIe is later than the one passed.
      Parameters:
        `birthDate` - date to compare.
      Returns:
        'false' if age read is later, 'true' otherwise.
      Throws:
        `java.security.KeyStoreException`

    - #### verifyAge

          public boolean verifyAge(java.lang.String birthDate)
                            throws java.security.KeyStoreException

      Verify if the age date read from DNIe is later than the one passed.
      Parameters:
        `birthDate` - date to compare in string format 'dd/MM/yyyy'.
      Returns:
        'false' if age read is later, 'true' otherwise.
      Throws:
        `java.security.KeyStoreException`