Skip to content

writeTarget

writeTarget(grant, nodeKey, scope?): WriteTarget

Defined in: derive.ts:474

Everything a delegate needs to write a piece, taken from the grant that delegated it: the keyspace to record, the scope to label it with, and the key to derive its piece key from.

The grant decides what is allowed. A keyspace grant may write under any scope or none; a scope grant only under its own scope or a scope beneath it, and defaults to its own scope. A piece grant cannot write at all: its key belongs to one existing piece, and FEE needs a fresh key for every object. Anything else is refused here, before a piece is encrypted under a key its intended readers could never derive.

ParameterType
grantGrantDescriptor
nodeKeyUint8Array
scope?string

WriteTarget

If the grant is a piece grant, the scope lies outside the grant’s subtree, or the key is not 32 bytes.