public abstract class Dnie extends BaseCard
SecureCard.CHANNEL_TYPE
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATR_DNIE |
static java.lang.String |
ATR_RESID |
protected static java.lang.String |
AUTH_CERT_ALIAS |
protected static java.lang.String |
AUTH_KEY_LABEL |
protected java.security.cert.X509Certificate |
authCert |
protected Location |
authCertPath |
protected PrivateKeyReference |
authKeyRef |
protected static java.lang.String |
INTERMEDIATE_CA_CERT_ALIAS |
protected java.security.cert.X509Certificate |
intermediateCaCert |
protected byte[] |
serialID |
protected static java.lang.String |
SIGN_CERT_ALIAS |
protected static java.lang.String |
SIGN_KEY_LABEL |
protected java.security.cert.X509Certificate |
signCert |
protected Location |
signCertPath |
protected PrivateKeyReference |
signKeyRef |
_connection, _signatureNotification, CDF_LOCATION, CERT_ICC_FILE_ID, cryptoHelper, DODF_LOCATION, EF_ATR_2F03, ESIGN_FILE, FAST_MODE_PROPERTY, intermediateCaCerICC, logger, m_channelEstablished, MASTER_FILE_NAME, PRKDF_LOCATION, REF_RCA_ICC_PUBLIC_KEY, TEST_VERSION
Constructor and Description |
---|
Dnie(ApduConnection conn,
CryptoHelper cryptoHelper,
SignatureNotification signatureNotification)
Construye una clase que representa un DNIe.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getAliases()
CryptoCard interface methods
|
java.security.cert.X509Certificate[] |
getCACertificates()
Obtiene todos los certificados que pueden ser CA (no tienen clave privada asociada).
|
java.security.cert.X509Certificate |
getCertificate(java.lang.String alias)
Obtiene el certificado correspondiente al alias proporcionado.
|
protected void |
getCertificateObjects(Cdf cdf,
boolean readBinaryFromPath) |
PrivateKeyReference |
getPrivateKey(java.lang.String alias)
Obtiene una referencia a la clave privada correspondiente al alias proporcionado.
|
protected void |
getPrivateKeyObjects(PrKdf prKdf)
BaseCard parent class methods
|
byte[] |
getRefIccPrivateKey()
Cwa14890Card interface methods
|
protected boolean |
isSecurityChannelOpen() |
byte[] |
sign(byte[] digestInfo,
PrivateKeyReference keyRef)
Realiza una firma electrónica.
|
deflate, establishChannel, externalAuthentication, getChallenge, getConnection, getIccCertEncoded, getInternalAuthenticateMessage, getSCardType, getSerialNumber, initialize, readBinary, readBinaryComplete, selectCompressedFileByLocationAndRead, selectFileById, selectFileByIdAndRead, selectFileByLocationAndRead, selectFileByName, selectMasterFile, setKeysToAuthentication, setPublicKeyToVerification, signOperation, verifyAge, verifyCertificate, verifyCertificate, verifyIcc, verifyPin
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChrCCvIfd, getIfdPrivateKey, getSerialNumber, verifyCaIntermediateIcc, verifyIfdCertificateChain
public static final java.lang.String ATR_DNIE
public static final java.lang.String ATR_RESID
protected static final java.lang.String AUTH_CERT_ALIAS
protected static final java.lang.String SIGN_CERT_ALIAS
protected static final java.lang.String INTERMEDIATE_CA_CERT_ALIAS
protected static final java.lang.String AUTH_KEY_LABEL
protected static final java.lang.String SIGN_KEY_LABEL
protected java.security.cert.X509Certificate authCert
protected java.security.cert.X509Certificate signCert
protected java.security.cert.X509Certificate intermediateCaCert
protected Location authCertPath
protected Location signCertPath
protected PrivateKeyReference authKeyRef
protected PrivateKeyReference signKeyRef
protected byte[] serialID
public Dnie(ApduConnection conn, CryptoHelper cryptoHelper, SignatureNotification signatureNotification)
conn
- Conexión con la tarjetacryptoHelper
- Funcionalidades criptográficas de utilidad que pueden variar entre máquinas virtualesprotected void getPrivateKeyObjects(PrKdf prKdf)
getPrivateKeyObjects
in class BaseCard
protected void getCertificateObjects(Cdf cdf, boolean readBinaryFromPath) throws java.lang.RuntimeException
getCertificateObjects
in class BaseCard
cdf
- java.lang.RuntimeException
protected boolean isSecurityChannelOpen()
isSecurityChannelOpen
in class BaseCard
public java.lang.String[] getAliases()
getAliases
in interface CryptoCard
getAliases
in class BaseCard
public java.security.cert.X509Certificate getCertificate(java.lang.String alias)
CryptoCard
alias
- Alias del certificadonull
si no
existe ningún certificado con ese aliaspublic java.security.cert.X509Certificate[] getCACertificates()
CryptoCard
public PrivateKeyReference getPrivateKey(java.lang.String alias) throws CryptoCardException
CryptoCard
alias
- Alias del certificadonull
si no existe ninguna clave privada con ese aliasCryptoCardException
- Si ocurre algún problema al recuperar la clave privada.public byte[] sign(byte[] digestInfo, PrivateKeyReference keyRef) throws CryptoCardException
CryptoCard
digestInfo
- Información para la firmakeyRef
- Referencia a la clave privada de firmaCryptoCardException
- Si ocurre algún problema durante la firma.public byte[] getRefIccPrivateKey()