ModelSigner
@objc(VSSModelSigner)
public final class ModelSigner : NSObject
Class responsible for signing RawSignerModel
-
Signer identifier for self signatures
Declaration
Swift
@objc public static let selfSignerIdentifier: String
-
Crypto implementation instance for generating signatures
Declaration
Swift
@objc public let crypto: VirgilCrypto
-
Initializer
Declaration
Swift
@objc public init(crypto: VirgilCrypto)
Parameters
crypto
VirgilCrypto implementation instance for generating signatures
-
Adds signature to given RawSignedModel with provided signer, privateKey and additionalData
Throws
corresponding error id signature generation failsDeclaration
Swift
@objc public func sign(model: RawSignedModel, signer: String, privateKey: VirgilPrivateKey, additionalData: Data?) throws
Parameters
model
RawSignedModel to sign
signer
identifier of signer
privateKey
VirgilPrivateKey to sign with
additionalData
additionalData to sign with model
-
Adds owner’s signature to given RawSignedModel using provided VirgilPrivateKey
Throws
corresponding error id signature generation failsDeclaration
Swift
@objc public func selfSign(model: RawSignedModel, privateKey: VirgilPrivateKey, additionalData: Data?) throws
Parameters
model
RawSignedModel to sign
privateKey
VirgilPrivateKey to sign with
additionalData
additionalData to sign with model
-
Adds signature to given RawSignedModel with provided signer, privateKey and additionalData
Throws
corresponding error id signature generation failsDeclaration
Swift
@objc public func sign(model: RawSignedModel, signer: String, privateKey: VirgilPrivateKey, extraFields: [String: String]? = nil) throws
Parameters
model
RawSignedModel to sign
signer
identifier of signer
privateKey
VirgilPrivateKey to sign with
extraFields
Dictionary with extra data to sign with model
-
Adds owner’s signature to given RawSignedModel using provided VirgilPrivateKey
Throws
corresponding error id signature generation failsDeclaration
Swift
@objc public func selfSign(model: RawSignedModel, privateKey: VirgilPrivateKey, extraFields: [String: String]? = nil) throws
Parameters
model
RawSignedModel to sign
privateKey
VirgilPrivateKey to sign with
extraFields
Dictionary with extra data to sign with model