bothy-sdk
    Preparing search index...

    Function parseWebhookPublicKey

    • Reads a public key of getWebhookKeys: whpk_ plus the standard base64 of the DER-encoded SubjectPublicKeyInfo of an Ed25519 key (RFC 8410).

      Parameters

      • value: string

        The public_key of a WebhookKey.

      Returns KeyObject

      The Ed25519 public key.

      WebhookConfigError for another prefix, bad base64, bad DER or another key type; the message never repeats the value.

      const key = parseWebhookPublicKey("whpk_MCowBQYDK2VwAyEA6h3uZ0Q4i1Yv1o1Wg8bQq3c0o8bq9oQm3Kc8n3m3v0I=");
      key.asymmetricKeyType; // "ed25519"