ObjectIdentifier
public struct ObjectIdentifier : Equatable, Hashable
extension ObjectIdentifier: ASN1CodableType
Undocumented
-
Undocumented
Declaration
Swift
public let rawValue: String
-
Parse ASN.1 OID from String
Supports OID formats: ASN.1 notation (http://oid-info.com/faq.htm#17) and dot notation (http://oid-info.com/faq.htm#14)
Note
does not support OID-IRI notation (http://oid-info.com/faq.htm#iri)
Throws
ASN1Error when string is malformed
Declaration
Swift
public static func from(string: String) throws -> ObjectIdentifier
Parameters
string
OID encoded string e.g. “1.3.6.1.4.1 ”, “{1 3 6 1 4 1}”, “urn:oid:1.3.6.1.4.1” or even “{iso(1) identified-organisation(3) dod(6) internet(1) private(4) enterprise(1)}”
Return Value
The parsed ObjectIdentifier as OID
-
ASN.1 Encode the OID
Throws
ASN1Error when SIDs are not Int ParsableDeclaration
Swift
public func asn1encode(tag: ASN1DecodedTag? = nil) throws -> ASN1Object
Parameters
tag
ignored and set to
.universal(.objectIdentifier)
Return Value
The ASN1Primitive from ASN1 serializing
-
Initialize an OID from Decoded ASN1 encoding
Declaration
Swift
public init(from asn1: ASN1Object) throws
Parameters
asn1
The (de-serialized) ASN1 Tag