ChipAuthenticationPublicKeyInfo

internal final class ChipAuthenticationPublicKeyInfo : SecurityInfo

A class representing the public key information used in Chip Authentication or PACE with Chip Authentication Mapping.

The ASN.1 data structure ChipAuthenticationPublicKeyInfo is defined as follows:

 ChipAuthenticationPublicKeyInfo ::= SEQUENCE {
    protocol OBJECT IDENTIFIER(id-PK-DH | id-PK-ECDH),
    chipAuthenticationPublicKey SubjectPublicKeyInfo,
    keyId INTEGER OPTIONAL
 }

This data structure provides a public key for Chip Authentication or PACE with Chip Authentication Mapping of the eMRTD chip and its components represent.

  • protocol: An object identifier that identifies the type of the public key (i.e. DH or ECDH).

  • chipAuthenticationPublicKey: A SubjectPublicKeyInfo data structure that contains the public key in encoded form.

An integer that identifies the version of the protocol. Currently, only version 1 is supported by this specification..

  • keyId: An integer that may indicate the local key identifier (optional).

Important

KeyId must be used if the eMRTD chip provides multiple public keys for Chip Authentication or if this key is used for PACE with Chip Authentication Mapping.

Note

It inherits from the SecurityInfo class.

  • Declaration

    Swift

    internal typealias KeyIdentifier = Int
  • The SecurityProtocol associated with this public key.

    Declaration

    Swift

    private(set) var securityProtocol: CAPublicKeySecurityProtocol { get }
  • The subject public key information.

    Declaration

    Swift

    private(set) var subjectPublicKeyInfo: SubjectPublicKeyInfo! { get }
  • The key identifier, if available.

    Declaration

    Swift

    private(set) var keyId: KeyIdentifier? { get }
  • Check if the provided ObjectIdentifier (OID) is valid for Chip Authentication Public Key.

    Declaration

    Swift

    internal static func checkRequiredIdentifier(_ oid: ObjectIdentifier) -> Bool

    Parameters

    oid

    The OID to check.

    Return Value

    true if the OID is valid for Chip Authentication Public Key, false otherwise.

  • Initialize a ChipAuthenticationPublicKeyInfo instance with the given OID and ASN.1 data.

    Throws

    An error if the security protocol cannot be decoded from the OID.

    Declaration

    Swift

    internal required init(oid: ObjectIdentifier, data: ASN1NodeCollection) throws

    Parameters

    oid

    The ObjectIdentifier associated with the security protocol.

    data

    The ASN.1 data containing the public key information.

  • Decodes the ASN.1 data, extracting the SubjectPublicKeyInfo and key identifier, if available.

    Throws

    An error if the data cannot be decoded successfully.

    Declaration

    Swift

    override internal func decode(_ data: ASN1NodeCollection) throws

    Parameters

    data

    The ASN.1 data to decode.