Security Core
-
The
ObjectIdentifierstructure represents an Object Identifier (OID) commonly used in various encoding and security protocols.An OID is a sequence of integers separated by periods, used to uniquely identify objects in a hierarchical naming structure.
- Tip: The structure provides methods for creating, encoding, and working with OIDs. It also supports basic operations such as concatenation and checking if one OID starts with another.
Declaration
Swift
internal struct ObjectIdentifier : Hashableextension ObjectIdentifier: CustomStringConvertibleextension ObjectIdentifier: ExpressibleByStringLiteralextension ObjectIdentifier: Equatable -
The
SubjectPublicKeyInfoclass represents a data structure defined by the ASN.1 notation. It is used to encapsulate information related to a public key.According to the ASN.1 definition, a
SubjectPublicKeyInfoconsists of two components: anAlgorithmIdentifierand asubjectPublicKeyof typeBIT STRING.The data structures
SubjectPublicKeyInfoandAlgorithmIdentifierare defined as follows:SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING } AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }See moreNote
This class encapsulate just the public key. The algorithm data structure is not included here.Declaration
Swift
internal final class SubjectPublicKeyInfo -
A base class for representing security information contained in an ASN.1 structure.
The
SecurityInfoclass serves as a base class for various security information objects used in the ASN.1 structure. It provides the foundation for decoding and extracting security information. Subclasses should be created to handle specific types of security information.The ASN.1 data structure
SecurityInfosindicates supported security protocols and is provided by the eMRTD chip. The data structuresSecurityInfosandSecurityInfoare defined as follows:SecurityInfos ::= SET OF SecurityInfo SecurityInfo ::= SEQUENCE { protocol OBJECT IDENTIFIER, requiredData ANY DEFINED BY protocol, optionalData ANY DEFINED BY protocol OPTIONAL }The
SecurityInfocomponents represent:protocol: An object identifier that identifies the supported protocol.requiredData: An open type that contains protocol-specific mandatory data.optionalData: An open type that contains protocol-specific optional data.
Subclasses of
SecurityInfoshould override thedecode(_:)method to handle the specific decoding logic for their respective security information types.The
getInstance(node:)method is used to instantiate the appropriate subclass ofSecurityInfobased on theObjectIdentifier(OID) found in the ASN.1 structure.See moreSee also
SecurityInfoDecoder,SecurityProtocol,SecurityObjectIdentifiersChipAuthenticationInfo,ChipAuthenticationPublicKeyInfoandPACEInfoDeclaration
Swift
internal class SecurityInfo -
SecurityInfoDecoderis a class responsible for decoding security information based on the providedObjectIdentifier. It maps specific object identifiers to their correspondingSecurityInfotypes.See moreSee also
SecurityInfo,SecurityProtocol,SecurityObjectIdentifiers,ChipAuthenticationInfo,ChipAuthenticationPublicKeyInfoandPACEInfoDeclaration
Swift
internal final class SecurityInfoDecoder -
The
SecurityObjectIdentifiersstructure defines a set ofObjectIdentifier(OIDs) used to represent various security-related standards and specifications. These OIDs are commonly used in security protocols and digital certificates to uniquely identify security algorithms and features.The structure contains a set of private constants that define the components of OIDs and then constructs various OIDs based on those components.
The OIDs included in this structure are organized into different categories, such as ICAO ASN.1 Specifications and BSI TR 03111 ASN.1 Specifications, and are used to represent specific security protocols, algorithms, and identifiers.
See moreDeclaration
Swift
internal struct SecurityObjectIdentifiers -
The
SecurityProtocolprotocol defines a set of requirements for security protocol implementations.Implementations of this protocol must provide an
ObjectIdentifier(oid) value that represents the identifier of the security protocol.See moreSee also
SecurityInfo,SecurityInfoDecoder,SecurityObjectIdentifiersChipAuthenticationSecurityProtocol,CAPublicKeySecurityProtocolandPACESecurityProtocolDeclaration
Swift
internal protocol SecurityProtocol : CaseIterable
View on GitHub
Security Core Reference