UNPKG

@fedify/fedify

Version:

An ActivityPub server framework

54 lines 2.05 kB
import * as dntShim from "../_dnt.shims.js"; /** * Imports a PEM-SPKI formatted public key. * @param pem The PEM-SPKI formatted public key. * @returns The imported public key. * @throws {TypeError} If the key is invalid or unsupported. * @since 0.5.0 */ export declare function importSpki(pem: string): Promise<dntShim.CryptoKey>; /** * Exports a public key in PEM-SPKI format. * @param key The public key to export. * @returns The exported public key in PEM-SPKI format. * @throws {TypeError} If the key is invalid or unsupported. * @since 0.5.0 */ export declare function exportSpki(key: dntShim.CryptoKey): Promise<string>; /** * Imports a PEM-PKCS#1 formatted public key. * @param pem The PEM-PKCS#1 formatted public key. * @returns The imported public key. * @throws {TypeError} If the key is invalid or unsupported. * @since 1.5.0 */ export declare function importPkcs1(pem: string): Promise<dntShim.CryptoKey>; /** * Imports a PEM formatted public key (SPKI or PKCS#1). * @param pem The PEM formatted public key to import (SPKI or PKCS#1). * @returns The imported public key. * @throws {TypeError} If the key is invalid or unsupported. * @since 1.5.0 */ export declare function importPem(pem: string): Promise<dntShim.CryptoKey>; /** * Imports a [Multibase]-encoded public key. * * [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0 * @param key The Multibase-encoded public key. * @returns The imported public key. * @throws {TypeError} If the key is invalid or unsupported. * @since 0.10.0 */ export declare function importMultibaseKey(key: string): Promise<dntShim.CryptoKey>; /** * Exports a public key in [Multibase] format. * * [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0 * @param key The public key to export. * @returns The exported public key in Multibase format. * @throws {TypeError} If the key is invalid or unsupported. * @since 0.10.0 */ export declare function exportMultibaseKey(key: dntShim.CryptoKey): Promise<string>; //# sourceMappingURL=key.d.ts.map