@dfinity/vetkeys - v0.1.0
    Preparing search index...

    An interface that maps KeyManager calls to IC canister calls that will call the respective method of the backend KeyManager. For example, get_user_rights will call the get_user_rights method of the backend KeyManager. See the [Password Manager with Metadata Example]

    Implements

    Index

    Constructors

    Properties

    actor: ActorSubclass<_SERVICE>
    canisterId: string
    verificationKey: ByteBuf = undefined

    Methods

    • Fetches an encrypted VetKey.

      Parameters

      • keyOwner: Principal

        The principal of the key owner

      • vetkeyName: ByteBuf

        The name/identifier of the VetKey

      • transportKey: ByteBuf

        The public transport key to use for encryption

      Returns Promise<{ Ok: ByteBuf } | { Err: string }>

      Promise resolving to the encrypted VetKey bytes, or an error if the operation fails

    • Checks a user's access rights.

      Parameters

      • owner: Principal

        The principal of the key owner

      • vetkeyName: ByteBuf

        The name/identifier of the VetKey

      • user: Principal

        The principal of the user to check rights for

      Returns Promise<{ Ok: [] | [AccessRights] } | { Err: string }>

      Promise resolving to the user's access rights if they exist, or an error if the operation fails

    • Revokes a user's access.

      Parameters

      • owner: Principal

        The principal of the key owner

      • vetkeyName: ByteBuf

        The name/identifier of the VetKey

      • user: Principal

        The principal of the user to remove

      Returns Promise<{ Ok: [] | [AccessRights] } | { Err: string }>

      Promise resolving to the previous access rights if they existed, or an error if the operation fails

    • Grants or modifies access rights for a user.

      Parameters

      • owner: Principal

        The principal of the key owner

      • vetkeyName: ByteBuf

        The name/identifier of the VetKey

      • user: Principal

        The principal of the user to grant/modify rights for

      • userRights: AccessRights

        The access rights to grant

      Returns Promise<{ Ok: [] | [AccessRights] } | { Err: string }>

      Promise resolving to the previous access rights if they existed, or an error if the operation fails