Package org.jmrtd.lds
Class ChipAuthenticationPublicKeyInfo
- java.lang.Object
-
- org.jmrtd.lds.AbstractLDSInfo
-
- org.jmrtd.lds.SecurityInfo
-
- org.jmrtd.lds.ChipAuthenticationPublicKeyInfo
-
- All Implemented Interfaces:
Serializable
,LDSElement
public class ChipAuthenticationPublicKeyInfo extends SecurityInfo
A concrete SecurityInfo structure that stores chip authentication public key info, see EAC TR 03110 1.11 specification. This data structure provides a Chip Authentication Public Key of the MRTD chip.- The object identifier
protocol
SHALL identify the type of the public key (i.e. DH or ECDH). - The sequence
chipAuthenticationPublicKey
SHALL contain the public key in encoded form. - 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: 1799 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
-
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 ChipAuthenticationPublicKeyInfo(String oid, PublicKey publicKey)
Creates a public key info structure with implicit key identifier.ChipAuthenticationPublicKeyInfo(String oid, PublicKey publicKey, BigInteger keyId)
Creates a public key info structure.ChipAuthenticationPublicKeyInfo(PublicKey publicKey)
Creates a public key info structure with implicit key identifier.ChipAuthenticationPublicKeyInfo(PublicKey publicKey, BigInteger keyId)
Creates a public key info structure.
-
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 ofSecurityInfo
.static boolean
checkRequiredIdentifier(String oid)
Checks whether the given object identifier identifies a ChipAuthenticationPublicKeyInfo structure.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 ChipAuthenticationPublicKeyInfo structure,null
if not present.String
getObjectIdentifier()
Returns the protocol object identifier of this SecurityInfo.String
getProtocolOIDString()
Gets the protocol object identifier as a human readable string.PublicKey
getSubjectPublicKey()
Returns a SubjectPublicKeyInfo contained in this ChipAuthenticationPublicKeyInfo structure.int
hashCode()
static String
toKeyAgreementAlgorithm(String oid)
Returns the key agreement algorithm ("DH"
or"ECDH"
for the given Chip Authentication Public Key info object identifier.String
toString()
-
Methods inherited from class org.jmrtd.lds.AbstractLDSInfo
getEncoded
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class org.jmrtd.lds.SecurityInfo
getInstance, writeObject
-
-
-
-
Constructor Detail
-
ChipAuthenticationPublicKeyInfo
public ChipAuthenticationPublicKeyInfo(PublicKey publicKey)
Creates a public key info structure with implicit key identifier.- Parameters:
publicKey
- Either a DH public key or an EC public key
-
ChipAuthenticationPublicKeyInfo
public ChipAuthenticationPublicKeyInfo(PublicKey publicKey, BigInteger keyId)
Creates a public key info structure.- Parameters:
publicKey
- Either a DH public key or an EC public keykeyId
- key identifier
-
ChipAuthenticationPublicKeyInfo
public ChipAuthenticationPublicKeyInfo(String oid, PublicKey publicKey)
Creates a public key info structure with implicit key identifier.- Parameters:
oid
- a proper public key identifierpublicKey
- appropriate public key
-
ChipAuthenticationPublicKeyInfo
public ChipAuthenticationPublicKeyInfo(String oid, PublicKey publicKey, BigInteger keyId)
Creates a public key info structure.- Parameters:
oid
- a proper public key identifierpublicKey
- appropriate public keykeyId
- the key identifier ornull
if not present
-
-
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()
Description copied from class:SecurityInfo
Returns the protocol object identifier of this SecurityInfo.- Specified by:
getObjectIdentifier
in classSecurityInfo
- Returns:
- this protocol object identifier
-
getProtocolOIDString
public String getProtocolOIDString()
Gets 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 ChipAuthenticationPublicKeyInfo structure,null
if not present.- Returns:
- key identifier stored in this ChipAuthenticationPublicKeyInfo structure
-
getSubjectPublicKey
public PublicKey getSubjectPublicKey()
Returns a SubjectPublicKeyInfo contained in this ChipAuthenticationPublicKeyInfo structure.- Returns:
- SubjectPublicKeyInfo contained in this ChipAuthenticationPublicKeyInfo structure
-
checkFields
protected void checkFields()
Checks the correctness of the data for this instance ofSecurityInfo
.
-
checkRequiredIdentifier
public static boolean checkRequiredIdentifier(String oid)
Checks whether the given object identifier identifies a ChipAuthenticationPublicKeyInfo structure.- Parameters:
oid
- object identifier- Returns:
- true if the match is positive
-
toKeyAgreementAlgorithm
public static String toKeyAgreementAlgorithm(String oid)
Returns the key agreement algorithm ("DH"
or"ECDH"
for the given Chip Authentication Public Key info object identifier. This may throw an unchecked exception if the given object identifier not a known Chip Authentication Public Key info object identifier.- Parameters:
oid
- a EAC-CA public key info object identifier- Returns:
- the key agreement algorithm
-
-