Blockchain Commons XID TypeScript Library - v1.0.0-alpha.20
    Preparing search index...

    Class Provenance

    Represents provenance information in an XID document.

    Implements

    • EnvelopeEncodable
    Index

    Methods

    • Create a new Provenance with a generator and mark.

      Parameters

      • generator: ProvenanceMarkGenerator
      • mark: ProvenanceMark

      Returns Provenance

    • Get the generator, if available and decrypted.

      Returns ProvenanceMarkGenerator | undefined

    • Check if this provenance has a decrypted generator.

      Returns boolean

    • Check if this provenance has an encrypted generator.

      Returns boolean

    • Get the salt used for generator decorrelation.

      Returns Salt | undefined

    • Update the provenance mark.

      Parameters

      • mark: ProvenanceMark

      Returns void

    • Set or replace the generator.

      Parameters

      • generator: ProvenanceMarkGenerator

      Returns void

    • Get a mutable reference to the generator, decrypting if necessary.

      Parameters

      • Optionalpassword: Uint8Array<ArrayBufferLike>

      Returns ProvenanceMarkGenerator | undefined

    • Get the generator envelope, optionally decrypting it.

      Returns:

      • undefined if no generator
      • An envelope containing the generator if unencrypted
      • The decrypted envelope if encrypted + correct password
      • The encrypted envelope as-is if encrypted + no password
      • Throws on wrong password

      Parameters

      • Optionalpassword: string

      Returns Envelope | undefined

    • Try to extract a Provenance from an envelope, optionally with password for decryption.

      Parameters

      • envelope: Envelope
      • Optionalpassword: Uint8Array<ArrayBufferLike>

      Returns Provenance