RawSignedModel

@objc(VSSRawSignedModel)
public final class RawSignedModel : NSObject, Codable

Represents some model in binary form that can have signatures and corresponds to Virgil Cards Service model

  • Snapshot of RawCardContent

    Declaration

    Swift

    @objc
    public let contentSnapshot: Data
  • Array with RawSignatures of card

    Declaration

    Swift

    @objc
    public private(set) var signatures: [RawSignature] { get }
  • Initializes a new RawSignedModel with the provided contentSnapshot

    Declaration

    Swift

    @objc
    public init(contentSnapshot: Data)

    Parameters

    contentSnapshot

    data with snapshot of content

  • Initializes RawSignedModel from json dictionary

    Throws

    Rethrows from JSONDecoder and NSJSONSerialization

    Declaration

    Swift

    @objc
    public static func `import`(fromJson json: Any) throws -> RawSignedModel

    Parameters

    json

    Json-compatible dictionary

    Return Value

    RawSignedModel instance

  • Initializes RawSignedModel from base64 encoded string

    Throws

    Declaration

    Swift

    @objc
    public static func `import`(fromBase64Encoded base64EncodedString: String) throws -> RawSignedModel

    Parameters

    base64EncodedString

    Base64 encoded string with RawSignedModel

    Return Value

    RawSignedModel instance

  • Initializes RawSignedModel from Data

    Throws

    • Rethrows from JSONDecoder

    Declaration

    Swift

    @objc
    public static func `import`(fromData data: Data) throws -> RawSignedModel

    Parameters

    data

    Data with RawSignedModel

    Return Value

    RawSignedModel instance

  • Exports RawSignedModel as base64 encoded string

    Throws

    Rethrows from JSONEncoder

    Declaration

    Swift

    @objc
    public func exportAsBase64EncodedString() throws -> String

    Return Value

    Base64 encoded string with RawSignedModel

  • Exports RawSignedModel as Data

    Throws

    Rethrows from JSONEncoder

    Declaration

    Swift

    @objc
    public func exportAsData() throws -> Data

    Return Value

    Data with RawSignedModel

  • Exports RawSignedModel as json dictionary

    Throws

    Rethrows from JSONEncoder and JSONSerialization

    Declaration

    Swift

    @objc
    public func exportAsJson() throws -> Any

    Return Value

    Json-compatible dictionary with RawSignedModel

  • Adds new signature

    Throws

    RawSignedModelError.duplicateSignature if signature with same signer already exists

    Declaration

    Swift

    @objc
    public func addSignature(_ signature: RawSignature) throws

    Parameters

    signature

    signature to add