Package org.jmrtd.lds

Class 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
    • 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 key
        keyId - 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 identifier
        publicKey - appropriate public key
      • ChipAuthenticationPublicKeyInfo

        public ChipAuthenticationPublicKeyInfo​(String oid,
                                               PublicKey publicKey,
                                               BigInteger keyId)
        Creates a public key info structure.
        Parameters:
        oid - a proper public key identifier
        publicKey - appropriate public key
        keyId - the key identifier or null 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 class SecurityInfo
        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 class SecurityInfo
        Returns:
        this protocol object identifier
      • getProtocolOIDString

        public String getProtocolOIDString()
        Gets the protocol object identifier as a human readable string.
        Specified by:
        getProtocolOIDString in class SecurityInfo
        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 of SecurityInfo.
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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