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

    Class XIDDocument

    Represents an XID document.

    Implements

    Index

    Methods

    • Add a resolution method.

      Parameters

      • method: string

      Returns void

    • Remove a resolution method.

      Parameters

      • method: string

      Returns boolean

    • Find a key by its public keys.

      Parameters

      • publicKeys: PublicKeys

      Returns Key | undefined

    • Find a key by its reference.

      Parameters

      • reference: Reference

      Returns Key | undefined

    • Remove a key.

      Parameters

      • publicKeys: PublicKeys

      Returns void

    • Check if the given signing public key is the inception signing key. Matches Rust: is_inception_signing_key(&self, signing_public_key: &SigningPublicKey) -> bool

      Parameters

      • signingPublicKey: SigningPublicKey

      Returns boolean

    • Get the inception private keys, if available.

      Returns PrivateKeys | undefined

    • Get the encryption key (encapsulation public key) for this document.

      Prefers the inception key for encryption. If no inception key is available, falls back to the first key in the document.

      Returns EncapsulationPublicKey | undefined

    • Set the name (nickname) for a key identified by its public keys.

      Parameters

      • publicKeys: PublicKeys
      • name: string

      Returns void

    • Get the inception signing public key, if it exists.

      Returns SigningPublicKey | undefined

    • Get the verification (signing) key for this document. Prefers the inception key. Falls back to the first key.

      Returns SigningPublicKey | undefined

    • Extract inception private keys from an envelope (convenience static method).

      Parameters

      • envelope: Envelope
      • password: Uint8Array

      Returns PrivateKeys | undefined

    • Get the private key envelope for a specific key, optionally decrypting it.

      Parameters

      • publicKeys: PublicKeys
      • Optionalpassword: string

      Returns Envelope | undefined

    • Check that the document contains a key with the given public keys. Throws if not found.

      Parameters

      • publicKeys: PublicKeys

      Returns void

    • Check that the document contains a delegate with the given XID. Throws if not found.

      Parameters

      Returns void

    • Add an attachment with the specified payload and metadata.

      Parameters

      • payload: EnvelopeEncodableValue
      • vendor: string
      • OptionalconformsTo: string

      Returns void

    • Get an attachment by its digest.

      Parameters

      • digest: Digest

      Returns Envelope | undefined

    • Remove an attachment by its digest.

      Parameters

      • digest: Digest

      Returns Envelope | undefined

    • Check if the document is empty (no keys, delegates, services, or provenance).

      Returns boolean

    • Check if any service references the given key.

      Parameters

      • publicKeys: PublicKeys

      Returns boolean

    • Check if any service references the given delegate.

      Parameters

      Returns boolean

    • Get the provenance mark.

      Returns ProvenanceMark | undefined

    • Get the provenance generator.

      Returns ProvenanceMarkGenerator | undefined

    • Set the provenance.

      Parameters

      • provenance: ProvenanceMark | undefined

      Returns void

    • Set provenance with generator.

      Parameters

      • generator: ProvenanceMarkGenerator
      • mark: ProvenanceMark

      Returns void

    • Advance the provenance mark using the embedded generator.

      Parameters

      • Optionalpassword: Uint8Array<ArrayBufferLike>
      • Optionaldate: Date
      • Optionalinfo: Cbor

      Returns void

    • Advance the provenance mark using a provided generator.

      Parameters

      • generator: ProvenanceMarkGenerator
      • Optionaldate: Date
      • Optionalinfo: Cbor

      Returns void

    • Create a signed envelope.

      Parameters

      • signingKey: Signer

      Returns Envelope