• SignIdentity
    • Secp256k1KeyIdentity



_principal: undefined | Principal
_privateKey: ArrayBuffer
_publicKey: Secp256k1PublicKey


  • 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.


    • challenge: ArrayBuffer

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

    Returns Promise<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.


    • 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.


    • 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


  • 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.


    • Optional seed: Uint8Array

      the optional seed

    Returns Secp256k1KeyIdentity

Generated using TypeDoc