Package org.jmrtd.lds
Class ChipAuthenticationInfo
- java.lang.Object
-
- org.jmrtd.lds.AbstractLDSInfo
-
- org.jmrtd.lds.SecurityInfo
-
- org.jmrtd.lds.ChipAuthenticationInfo
-
- All Implemented Interfaces:
Serializable
,LDSElement
public class ChipAuthenticationInfo extends SecurityInfo
A concrete SecurityInfo structure that stores chip authentication info, see EAC 1.11 specification. This data structure provides detailed information on an implementation of Chip Authentication.- The object identifier
protocol
SHALL identify the algorithms to be used (i.e. key agreement, symmetric cipher and MAC). - The integer
version
SHALL identify the version of the protocol. Currently, versions 1 and 2 are supported. - The integer
keyId
MAY be used to indicate the local key identifier. It MUST be used if the MRTD chip provides multiple public keys for Chip Authentication.
- Version:
- $Revision: 1850 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
VERSION_1
Chip Authentication version 1.static int
VERSION_2
Chip Authentication version 2.-
Fields inherited from class org.jmrtd.lds.SecurityInfo
ID_AA, ID_CA_DH_3DES_CBC_CBC, ID_CA_DH_AES_CBC_CMAC_128, ID_CA_DH_AES_CBC_CMAC_192, ID_CA_DH_AES_CBC_CMAC_256, ID_CA_ECDH_3DES_CBC_CBC, ID_CA_ECDH_AES_CBC_CMAC_128, ID_CA_ECDH_AES_CBC_CMAC_192, ID_CA_ECDH_AES_CBC_CMAC_256, ID_EC_PUBLIC_KEY, ID_EC_PUBLIC_KEY_TYPE, ID_PACE, ID_PACE_DH_GM, ID_PACE_DH_GM_3DES_CBC_CBC, ID_PACE_DH_GM_AES_CBC_CMAC_128, ID_PACE_DH_GM_AES_CBC_CMAC_192, ID_PACE_DH_GM_AES_CBC_CMAC_256, ID_PACE_DH_IM, ID_PACE_DH_IM_3DES_CBC_CBC, ID_PACE_DH_IM_AES_CBC_CMAC_128, ID_PACE_DH_IM_AES_CBC_CMAC_192, ID_PACE_DH_IM_AES_CBC_CMAC_256, ID_PACE_ECDH_CAM, ID_PACE_ECDH_CAM_AES_CBC_CMAC_128, ID_PACE_ECDH_CAM_AES_CBC_CMAC_192, ID_PACE_ECDH_CAM_AES_CBC_CMAC_256, ID_PACE_ECDH_GM, ID_PACE_ECDH_GM_3DES_CBC_CBC, ID_PACE_ECDH_GM_AES_CBC_CMAC_128, ID_PACE_ECDH_GM_AES_CBC_CMAC_192, ID_PACE_ECDH_GM_AES_CBC_CMAC_256, ID_PACE_ECDH_IM, ID_PACE_ECDH_IM_3DES_CBC_CBC, ID_PACE_ECDH_IM_AES_CBC_CMAC_128, ID_PACE_ECDH_IM_AES_CBC_CMAC_192, ID_PACE_ECDH_IM_AES_CBC_CMAC_256, ID_PK_DH, ID_PK_ECDH, ID_TA, ID_TA_ECDSA, ID_TA_ECDSA_SHA_1, ID_TA_ECDSA_SHA_224, ID_TA_ECDSA_SHA_256, ID_TA_RSA, ID_TA_RSA_PSS_SHA_1, ID_TA_RSA_PSS_SHA_256, ID_TA_RSA_V1_5_SHA_1, ID_TA_RSA_V1_5_SHA_256
-
-
Constructor Summary
Constructors Constructor Description ChipAuthenticationInfo(String oid, int version)
Constructs a new object.ChipAuthenticationInfo(String oid, int version, BigInteger keyId)
Constructs a new object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
checkFields()
Checks the correctness of the data for this instance of SecurityInfo.boolean
equals(Object other)
ASN1Primitive
getDERObject()
Deprecated.Remove this method from visible interface (because of dependency on BC API)BigInteger
getKeyId()
Returns a key identifier stored in this ChipAuthenticationInfo structure,null
if not present.String
getObjectIdentifier()
Returns the protocol object identifier.String
getProtocolOIDString()
Returns the protocol object identifier as a human readable string.int
getVersion()
Returns the Chip Authentication version (either 1 or 2).int
hashCode()
static String
toCipherAlgorithm(String oid)
Returns the encryption algorithm ("DESede"
or"AES"
) for the given EAC-CA info object identifier.static String
toDigestAlgorithm(String oid)
Returns the digest algorithm ("SHA-1"
or"SHA-256"
) for the given EAC-CA protocol object identifier.static String
toKeyAgreementAlgorithm(String oid)
Returns the key agreement algorithm ("DH"
or"ECDH"
for the given Chip Authentication info object identifier.static int
toKeyLength(String oid)
Returns the key length in bits (128, 192, or 256) for the given EAC-CA protocol object identifier.String
toString()
-
Methods inherited from class org.jmrtd.lds.SecurityInfo
getInstance, writeObject
-
Methods inherited from class org.jmrtd.lds.AbstractLDSInfo
getEncoded
-
-
-
-
Field Detail
-
VERSION_1
public static final int VERSION_1
Chip Authentication version 1.- See Also:
- Constant Field Values
-
VERSION_2
public static final int VERSION_2
Chip Authentication version 2.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChipAuthenticationInfo
public ChipAuthenticationInfo(String oid, int version)
Constructs a new object.- Parameters:
oid
- a proper EAC identifierversion
- has to be 1 or 2
-
ChipAuthenticationInfo
public ChipAuthenticationInfo(String oid, int version, BigInteger keyId)
Constructs a new object.- Parameters:
oid
- a proper EAC identifierversion
- has to be 1 or 2keyId
- the key identifier
-
-
Method Detail
-
getDERObject
@Deprecated public ASN1Primitive getDERObject()
Deprecated.Remove this method from visible interface (because of dependency on BC API)Returns a DER object with this SecurityInfo data (DER sequence).- Specified by:
getDERObject
in classSecurityInfo
- Returns:
- a DER object with this SecurityInfo data
-
getObjectIdentifier
public String getObjectIdentifier()
Returns the protocol object identifier.- Specified by:
getObjectIdentifier
in classSecurityInfo
- Returns:
- the
ID_CA_
object identifier indicating the Chip Authentication protocol
-
getVersion
public int getVersion()
Returns the Chip Authentication version (either 1 or 2).- Returns:
- the Chip Authentication version
-
getProtocolOIDString
public String getProtocolOIDString()
Returns the protocol object identifier as a human readable string.- Specified by:
getProtocolOIDString
in classSecurityInfo
- Returns:
- a string
-
getKeyId
public BigInteger getKeyId()
Returns a key identifier stored in this ChipAuthenticationInfo structure,null
if not present.- Returns:
- key identifier stored in this ChipAuthenticationInfo structure
-
checkFields
protected void checkFields()
Checks the correctness of the data for this instance of SecurityInfo. Throws anIllegalArgumentException
when not correct.
-
toKeyAgreementAlgorithm
public static String toKeyAgreementAlgorithm(String oid)
Returns the key agreement algorithm ("DH"
or"ECDH"
for the given Chip Authentication info object identifier.- Parameters:
oid
- a EAC-CA protocol object identifier- Returns:
- the key agreement algorithm
-
toCipherAlgorithm
public static String toCipherAlgorithm(String oid)
Returns the encryption algorithm ("DESede"
or"AES"
) for the given EAC-CA info object identifier.- Parameters:
oid
- a EAC-CA protocol object identifier- Returns:
- a JCE mnemonic cipher algorithm string
-
toDigestAlgorithm
public static String toDigestAlgorithm(String oid)
Returns the digest algorithm ("SHA-1"
or"SHA-256"
) for the given EAC-CA protocol object identifier.- Parameters:
oid
- a EAC-CA protocol object identifier- Returns:
- a JCE mnemonic digest algorithm string
-
toKeyLength
public static int toKeyLength(String oid)
Returns the key length in bits (128, 192, or 256) for the given EAC-CA protocol object identifier.- Parameters:
oid
- a EAC-CA protocol object identifier- Returns:
- a key length in bits
-
-