SignedDocument

public struct SignedDocument<T: Signable>: Signable

A wrapper object around a given data type and its cryptographic signature. Note that document remains unchanged

  • A data type that conforms to the Signable protocol (i.e. it is deterministically serializable)

    Declaration

    Swift

    public let document: T
  • The cryptographic signature over the serialized document

    Declaration

    Swift

    public let signature: String
  • Initializer to manually create SignedDocument types.

    Declaration

    Swift

    public init(document: T, signature: String)

    Parameters

    document

    A data type that conforms to the Signable protocol

    signature

    The cryptographic signature over the serialized document

  • Declaration

    Swift

    public func serialized() -> String