@dfinity/vetkeys - v0.2.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]

    interface KeyManagerClient {
        get_accessible_shared_key_ids(): Promise<[Principal, ByteBuf][]>;
        get_encrypted_vetkey(
            keyOwner: Principal,
            vetkeyName: ByteBuf,
            transportKey: ByteBuf,
        ): Promise<{ Ok: ByteBuf } | { Err: string }>;
        get_user_rights(
            owner: Principal,
            vetkeyName: ByteBuf,
            user: Principal,
        ): Promise<{ Ok: [] | [AccessRights] } | { Err: string }>;
        get_vetkey_verification_key(): Promise<ByteBuf>;
        remove_user(
            owner: Principal,
            vetkeyName: ByteBuf,
            user: Principal,
        ): Promise<{ Ok: [] | [AccessRights] } | { Err: string }>;
        set_user_rights(
            owner: Principal,
            vetkeyName: ByteBuf,
            user: Principal,
            userRights: AccessRights,
        ): Promise<{ Ok: [] | [AccessRights] } | { Err: string }>;
    }

    Implemented by

    Index

    Methods

    • Retrieves a list of keys that were shared with the user and the user still has access to.

      Returns Promise<[Principal, ByteBuf][]>

      Promise resolving to an array of [Principal, ByteBuf] pairs representing accessible key identifiers.

    • 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

    • Retrieves the public verification key for validating encrypted VetKeys.

      Returns Promise<ByteBuf>

      Promise resolving to the verification key bytes

    • 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