/** * @typedef {Object} ExportJWKOptions * @property {string} [kid] * @property {'sig' | 'enc'} [use] * @property {string} [alg] * @property {string[]} [key_ops] */ /** * KeyObject → JWK. For asymmetric public / private keys and for `oct` * secret keys alike. Decorator fields override anything Node put in * `asymmetricKeyDetails`. * * @param {KeyObject} key * @param {ExportJWKOptions} [options] * @returns {Promise} */ declare function exportJWK(key: KeyObject, options?: ExportJWKOptions): Promise; /** * @typedef {'spki' | 'pkcs8'} PemExportFormat */ /** * KeyObject → PEM. Format defaults to SPKI for public keys and PKCS#8 * for private keys — the sensible choice unless a specific interop * target demands otherwise. * * @param {KeyObject} key * @param {PemExportFormat} [format] * @returns {Promise} */ declare function exportPEM(key: KeyObject, format?: PemExportFormat): Promise; /** * Strip every private / secret member from a JWK, returning a defensive * shallow copy that is safe to publish (e.g. via a JWKS endpoint). * * Convenience over hand-stripping — callers don't have to remember * which `kty` stores the secret material in which member. * * @param {object} jwk * @returns {object} */ declare function toPublic(jwk: object): object; type ExportJWKOptions = { kid?: string | undefined; use?: "sig" | "enc" | undefined; alg?: string | undefined; key_ops?: string[] | undefined; }; type PemExportFormat = "spki" | "pkcs8"; export { exportJWK, exportPEM, toPublic }; export type { ExportJWKOptions, PemExportFormat };