lacewing - v2.0.1
    Preparing search index...

    Function importKey

    • Import key material and bind it to algorithm. The returned LacewingKey can only ever be used with that algorithm.

      algorithm is a name from the default set ("EdDSA", "ES256", "PS256", "HS256", ...) or a legacy descriptor from lacewing/legacy/rsa: importKey(pem, LEGACY_RS256).

      Throws KEY_TYPE_MISMATCH when material and algorithm disagree, ENTROPY_CHECK_FAILED for weak HMAC secrets, and KEY_IMPORT_FAILED for anything else that goes wrong.

      Type Parameters

      • const Alg extends string

      Parameters

      Returns Promise<LacewingKey<Alg>>