Skip to content

ECDSAKeyIdentity

Defined in: packages/identity/src/identity/ecdsa.ts:52

An identity interface that wraps an ECDSA keypair using the P-256 named curve. Supports DER-encoding and decoding for agent calls

protected new ECDSAKeyIdentity(keyPair, derKey, subtleCrypto): ECDSAKeyIdentity

Defined in: packages/identity/src/identity/ecdsa.ts:108

CryptoKeyPair

DerEncodedPublicKey

SubtleCrypto

ECDSAKeyIdentity

SignIdentity.constructor

protected _derKey: DerEncodedPublicKey

Defined in: packages/identity/src/identity/ecdsa.ts:103


protected _keyPair: CryptoKeyPair

Defined in: packages/identity/src/identity/ecdsa.ts:104


protected _principal: undefined | Principal

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

SignIdentity._principal


protected _subtleCrypto: SubtleCrypto

Defined in: packages/identity/src/identity/ecdsa.ts:105

getKeyPair(): CryptoKeyPair

Defined in: packages/identity/src/identity/ecdsa.ts:123

Return the internally-used key pair.

CryptoKeyPair

a CryptoKeyPair


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 & DerCryptoKey

Defined in: packages/identity/src/identity/ecdsa.ts:131

Return the public key.

PublicKey & DerCryptoKey

an & DerCryptoKey

SignIdentity.getPublicKey


sign(challenge): Promise<Signature>

Defined in: packages/identity/src/identity/ecdsa.ts:146

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

Uint8Array

challenge to sign with this identity’s secretKey, producing a signature

Promise<Signature>

signature

SignIdentity.sign


transformRequest(request): Promise<unknown>

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

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 fromKeyPair(keyPair, subtleCrypto?): Promise<ECDSAKeyIdentity>

Defined in: packages/identity/src/identity/ecdsa.ts:89

generates an identity from a public and private key. Please ensure that you are generating these keys securely and protect the user’s private key

a CryptoKeyPair

CryptoKeyPair | { privateKey: CryptoKey; publicKey: CryptoKey; }

SubtleCrypto

a SubtleCrypto interface in case one is not available globally

Promise<ECDSAKeyIdentity>

an ECDSAKeyIdentity


static generate(options?): Promise<ECDSAKeyIdentity>

Defined in: packages/identity/src/identity/ecdsa.ts:61

Generates a randomly generated identity for use in calls to the Internet Computer.

CryptoKeyOptions

optional settings

Promise<ECDSAKeyIdentity>

a ECDSAKeyIdentity