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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protected
new DelegationIdentity(_inner
,_delegation
):DelegationIdentity
Defined in: packages/identity/src/identity/delegation.ts:276
Parameters
Section titled “Parameters”_inner
Section titled “_inner”Pick
<SignIdentity
, "sign"
>
_delegation
Section titled “_delegation”Returns
Section titled “Returns”DelegationIdentity
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_principal
Section titled “_principal”
protected
_principal:undefined
|Principal
Defined in: packages/agent/lib/esm/auth.d.ts:52
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”getDelegation()
Section titled “getDelegation()”getDelegation():
DelegationChain
Defined in: packages/identity/src/identity/delegation.ts:283
Returns
Section titled “Returns”getPrincipal()
Section titled “getPrincipal()”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()
.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”getPublicKey()
Section titled “getPublicKey()”getPublicKey():
PublicKey
Defined in: packages/identity/src/identity/delegation.ts:287
Returns the public key that would match this identity’s signature.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”sign()
Section titled “sign()”sign(
blob
):Promise
<Signature
>
Defined in: packages/identity/src/identity/delegation.ts:293
Signs a blob of data, with this identity’s private key.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”Promise
<Signature
>
Overrides
Section titled “Overrides”transformRequest()
Section titled “transformRequest()”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.
Parameters
Section titled “Parameters”request
Section titled “request”internet computer request to transform
Returns
Section titled “Returns”Promise
<unknown
>
Overrides
Section titled “Overrides”fromDelegation()
Section titled “fromDelegation()”
static
fromDelegation(key
,delegation
):DelegationIdentity
Defined in: packages/identity/src/identity/delegation.ts:269
Create a delegation without having access to delegateKey.
Parameters
Section titled “Parameters”Pick
<SignIdentity
, "sign"
>
The key used to sign the requests.
delegation
Section titled “delegation”A delegation object created using createDelegation
.
Returns
Section titled “Returns”DelegationIdentity