Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace did

Index

References

ucan

Renames and exports write

Functions

didToPublicKey

  • didToPublicKey(did: string): { publicKey: string; type: KeyType }
  • Convert a DID (did:key) to a base64 public key.

    Parameters

    • did: string

    Returns { publicKey: string; type: KeyType }

exchange

  • exchange(): Promise<string>
  • Create a DID based on the exchange key-pair.

    Returns Promise<string>

publicKeyToDid

  • publicKeyToDid(publicKey: string, type: KeyType): string
  • Convert a base64 public key to a DID (did:key).

    Parameters

    Returns string

root

  • root(username: string): Promise<string>
  • Get the root write-key DID for a user. Stored at _did.${username}.${endpoints.user}

    Parameters

    • username: string

    Returns Promise<string>

verifySignedData

  • verifySignedData(__namedParameters: { charSize?: number; data: string; did: string; signature: string }): Promise<boolean>
  • Verify the signature of some data (string, ArrayBuffer or Uint8Array), given a DID.

    Parameters

    • __namedParameters: { charSize?: number; data: string; did: string; signature: string }
      • Optional charSize?: number
      • data: string
      • did: string
      • signature: string

    Returns Promise<boolean>

write

  • write(): Promise<string>
  • Create a DID based on the write key-pair.

    Returns Promise<string>

Generated using TypeDoc