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

    An interface that maps EncryptedMaps calls to IC canister calls that will call the respective method of the backend EncryptedMaps. For example, get_user_rights will call the get_user_rights method of the backend EncryptedMaps.

    Implements

    Index

    Constructors

    Properties

    actor: ActorSubclass<_SERVICE>

    Methods

    • Retrieves an encrypted value from a map.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • mapKey: ByteBuf

        The key to retrieve

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

      Promise resolving to the encrypted value if it exists, or an error if the operation fails

    • Retrieves all encrypted values from a specific map.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

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

      Promise resolving to an array of key-value pairs, or an error if the operation fails

    • Fetches an encrypted VetKey.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • 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

    • Gets all users that have access to a map and their access rights.

      Parameters

      • owner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

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

      Promise resolving to an array of user-access rights pairs, or an error if the operation fails

    • Checks a user's access rights.

      Parameters

      • owner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • 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

    • Stores an encrypted value in a map.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • mapKey: ByteBuf

        The key to store

      • data: ByteBuf

        The encrypted value to store

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

      Promise resolving to the previous value if it existed, or an error if the operation fails

    • Removes a value from a map.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • mapKey: ByteBuf

        The key to remove

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

      Promise resolving to the removed value if it existed, or an error if the operation fails

    • Removes all values from a map.

      Parameters

      • mapOwner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

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

      Promise resolving to an array of removed keys, or an error if the operation fails

    • Revokes a user's access.

      Parameters

      • owner: Principal

        The principal of the map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • 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 map owner

      • mapName: ByteBuf

        The name/identifier of the map

      • 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