Hierarchy

  • SignIdentity
    • Secp256k1KeyIdentity

Constructors

Properties

_principal: undefined | Principal
_privateKey: ArrayBuffer
_publicKey: Secp256k1PublicKey

Methods

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

    Returns Principal

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

    Parameters

    • challenge: ArrayBuffer

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

    Returns Promise<Signature>

    signature

  • 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

    • request: HttpAgentRequest

      internet computer request to transform

    Returns Promise<unknown>

  • Generates an identity from a seed phrase. Use carefully - seed phrases should only be used in secure contexts, and you should avoid having users copying and pasting seed phrases as much as possible.

    Parameters

    • seedPhrase: string | string[]

      either an array of words or a string of words separated by spaces.

    • Optional password: string

      optional password to be used by bip39

    Returns Secp256k1KeyIdentity

    Secp256k1KeyIdentity

  • Generates an identity. If a seed is provided, the keys are generated from the seed according to BIP 0032. Otherwise, the key pair is randomly generated. This method throws an error in case the seed is not 32 bytes long or invalid for use as a private key.

    Parameters

    • Optional seed: Uint8Array

      the optional seed

    Returns Secp256k1KeyIdentity

Generated using TypeDoc