/** @typedef {import('node:crypto').KeyObject} KeyObject */ /** * @typedef {Object} ImportJWKOptions * @property {string} [alg] intended JOSE algorithm identifier — currently informational (Node ignores it in key import) */ /** * Convert a JWK into a `KeyObject`. JWKs with `d` (or `k` for `oct`) * yield a private / secret KeyObject; public JWKs yield a public one. * * @param {object} jwk * @param {ImportJWKOptions} [_options] * @returns {Promise} */ declare function importJWK(jwk: object, _options?: ImportJWKOptions): Promise; /** * @typedef {'spki' | 'pkcs8' | 'x509'} PemFormat */ /** * Import a PEM- or DER-encoded key. * * - `'spki'` → public key (SubjectPublicKeyInfo) * - `'pkcs8'` → private key (PrivateKeyInfo) * - `'x509'` → public key extracted from an X.509 certificate * * When `pemOrDer` is a `Buffer`, the input is treated as DER; strings * are PEM. * * @param {string | Buffer} pemOrDer * @param {PemFormat} [format='spki'] * @returns {Promise} */ declare function importPEM(pemOrDer: string | Buffer, format?: PemFormat): Promise; type KeyObject = any; type ImportJWKOptions = { /** * intended JOSE algorithm identifier — currently informational (Node ignores it in key import) */ alg?: string | undefined; }; type PemFormat = "spki" | "pkcs8" | "x509"; export { importJWK, importPEM }; export type { ImportJWKOptions, KeyObject, PemFormat };