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 contentSnapshotDeclaration
Swift
@objc public init(contentSnapshot: Data)
Parameters
contentSnapshot
data with snapshot of content
-
Initializes
RawSignedModel
from json dictionaryThrows
Rethrows fromJSONDecoder
andNSJSONSerialization
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 stringThrows
RawSignedModelError.invalidBase64String
if passed string is not base64 encoded data.- Rethrows from JSONDecoder
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 DataThrows
- 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 stringThrows
Rethrows fromJSONEncoder
Declaration
Swift
@objc public func exportAsBase64EncodedString() throws -> String
Return Value
Base64 encoded string with
RawSignedModel
-
Exports
RawSignedModel
as DataThrows
Rethrows fromJSONEncoder
Declaration
Swift
@objc public func exportAsData() throws -> Data
Return Value
Data with
RawSignedModel
-
Exports
RawSignedModel
as json dictionaryThrows
Rethrows fromJSONEncoder
andJSONSerialization
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 existsDeclaration
Swift
@objc public func addSignature(_ signature: RawSignature) throws
Parameters
signature
signature to add