Skip to content

DelegationIdentity

Defined in: packages/identity/src/identity/delegation.ts:263

An Identity that adds delegation to a request. Everywhere in this class, the name innerKey refers to the SignIdentity that is being used to sign the requests, while originalKey is the identity that is being borrowed. More identities can be used in the middle to delegate.

protected new DelegationIdentity(_inner, _delegation): DelegationIdentity

Defined in: packages/identity/src/identity/delegation.ts:276

Pick<SignIdentity, "sign">

DelegationChain

DelegationIdentity

SignIdentity.constructor

protected _principal: undefined | Principal

Defined in: packages/agent/lib/esm/auth.d.ts:52

SignIdentity._principal

getDelegation(): DelegationChain

Defined in: packages/identity/src/identity/delegation.ts:283

DelegationChain


getPrincipal(): Principal

Defined in: packages/agent/lib/esm/auth.d.ts:65

Get the principal represented by this identity. Normally should be a Principal.selfAuthenticating().

Principal

SignIdentity.getPrincipal


getPublicKey(): PublicKey

Defined in: packages/identity/src/identity/delegation.ts:287

Returns the public key that would match this identity’s signature.

PublicKey

SignIdentity.getPublicKey


sign(blob): Promise<Signature>

Defined in: packages/identity/src/identity/delegation.ts:293

Signs a blob of data, with this identity’s private key.

Uint8Array

Promise<Signature>

SignIdentity.sign


transformRequest(request): Promise<unknown>

Defined in: packages/identity/src/identity/delegation.ts:297

Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.

HttpAgentRequest

internet computer request to transform

Promise<unknown>

SignIdentity.transformRequest


static fromDelegation(key, delegation): DelegationIdentity

Defined in: packages/identity/src/identity/delegation.ts:269

Create a delegation without having access to delegateKey.

Pick<SignIdentity, "sign">

The key used to sign the requests.

DelegationChain

A delegation object created using createDelegation.

DelegationIdentity