ASN1Data

public enum ASN1Data
extension ASN1Data: CustomStringConvertible
extension ASN1Data: CustomDebugStringConvertible

ASN1 Data/Content type

  • Primitive that holds (encoded) octets/bytes

    Declaration

    Swift

    case primitive(Data)
  • Constructed type holding its set/sequence

    Declaration

    Swift

    case constructed([ASN1Object])
  • Number of bytes needed for the primitive or nested objects/tags (including their resp. tag and length sizes)

    Declaration

    Swift

    public var length: Int { get }
  • When case is .constructed the containing ASN1Objects are returned, nil when .primitive

    Declaration

    Swift

    public var items: [ASN1Object]? { get }
  • When case is .primitive the data value is returned, nil when .constructed

    Declaration

    Swift

    public var primitive: Data? { get }
  • Fold over a ASN1 Data object

    Throws

    Rethrows errors from the passed in block parameters

    Declaration

    Swift

    public func fold<T>(
            _ primitive: @escaping (Data) throws -> T,
            _ constructed: ([ASN1Object]) throws -> T
    ) rethrows -> T

    Parameters

    primitive

    Block that gets invoked when self is primitive

    constructed

    Block that gets invoked when self is constructed

    Return Value

    The resulting T from given block

  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public var debugDescription: String { get }