Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Secp256k1KeyIdentity

Hierarchy

  • SignIdentity
    • Secp256k1KeyIdentity

Index

Constructors

Properties

_principal: undefined | Principal
_privateKey: ArrayBuffer
_publicKey: Secp256k1PublicKey

Methods

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

    Returns Principal

  • sign(challenge: ArrayBuffer): Promise<Signature>
  • 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

  • toJSON(): JsonableSecp256k1Identity
  • transformRequest(request: HttpAgentRequest): Promise<unknown>
  • 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. 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