Hierarchy

  • LDKeyPair
    • Sr25519VerificationKey2020

Constructors

  • An implementation of the Sr25519VerificationKey spec, for use with Linked Data Proofs.

    Parameters

    • options: {
          controller?: string;
          id?: string;
          privateKeyBase58?: string;
          publicKeyBase58: string;
          revoked?: string;
      }

      Options hashmap.

      • Optional controller?: string

        Controller DID or document url.

      • Optional id?: string

        The key ID.

      • Optional privateKeyBase58?: string

        Base58btc Private Key.

      • publicKeyBase58: string

        Base58btc encoded Public Key.

      • Optional revoked?: string

        Timestamp of when the key has been revoked, in RFC3339 format. If not present, the key itself is considered not revoked. Note that this mechanism is slightly different than DID Document key revocation, where a DID controller can revoke a key from that DID by removing it from the DID Document.

    Returns Sr25519VerificationKey2020

Properties

controller?: string
id?: string
privateKeyBase58?: string
publicKeyBase58: string
revoked?: string
type: string
SUITE_CONTEXT: "https://www.kilt.io/contexts/credentials" = KiltCredentialV1.CONTEXT_URL
suite: "Sr25519VerificationKey2020" = SUITE_ID

Methods

  • Exports the serialized representation of the KeyPair and other information that json-ld Signatures can use to form a proof.

    Parameters

    • options: {
          includeContext: undefined | boolean;
          privateKey: undefined | boolean;
          publicKey: undefined | boolean;
      } = {}

      Options hashmap.

      • includeContext: undefined | boolean

        Include JSON-LD context?

      • privateKey: undefined | boolean

        Export private key material?

      • publicKey: undefined | boolean

        Export public key material?

    Returns ExportedKey

    A public key object information used in verification methods by signatures.

  • Returns a verifier object for use with signature suites.

    Returns JSigsVerifier

    Used to verify jsonld-signatures.

    Example

    > const verifier = keyPair.verifier();
    > verifier
    { verify: [AsyncFunction: verify] }
    > verifier.verify(key);
  • Tests whether the fingerprint was generated from a given key pair.

    Parameters

    • publicKey: {
          fingerprint?: string;
      } = {}

      A Base58 public key.

      • Optional fingerprint?: string

        The key's fingerprint.

    Returns object

    An object indicating valid is true or false.

    Example

    > srKeyPair.verifyFingerprint({fingerprint: 'z2S2Q6MkaFJewa'});
    {valid: true};
  • Generates a KeyPair with an optional deterministic seed.

    Parameters

    • options: {
          controller?: string;
          id?: string;
          revoked?: string;
          seed?: string | Uint8Array;
      } = {}

      See LDKeyPair docstring for full list.

      • Optional controller?: string
      • Optional id?: string
      • Optional revoked?: string
      • Optional seed?: string | Uint8Array

        a 32-byte array seed for a deterministic key.

    Returns Promise<Sr25519VerificationKey2020>

    Generates a key pair.