import {HashCtor} from '@tios/hash'; import {Adsa, Asym} from './asym'; export interface ESA extends Asym { readonly native: number; readonly id: string; readonly type: string; readonly size: number; readonly bits: number; readonly hash: HashCtor; privateKeyGenerate(): Buffer; privateKeyVerify(key: Buffer): boolean; privateKeyExport(key: Buffer, compress?: boolean): Buffer; privateKeyImport(raw: Buffer): Buffer; privateKeyExportPKCS8(key: Buffer, compress?: boolean): Buffer; privateKeyImportPKCS8(raw: Buffer): Buffer; privateKeyExportJWK(key: Buffer): PrivateKeyJWK; privateKeyImportJWK(json: PrivateKeyJWK): Buffer; publicKeyCreate(key: Buffer, compress?: boolean): Buffer; publicKeyConvert(key: Buffer, compress?: boolean): Buffer; publicKeyVerify(key: Buffer): boolean; publicKeyExport(key: Buffer): Buffer; publicKeyImport(raw: Buffer, compress?: boolean): Buffer; publicKeyExportSPKI(raw: Buffer, compress?: boolean): Buffer; publicKeyImportSPKI(raw: Buffer, compress?: boolean): Buffer; publicKeyExportJWK(key: Buffer): PublicKeyJWK; publicKeyImportJWK(json: PublicKeyJWK, compress?: boolean): Buffer; /** * Creates and returns a Adsa object that uses the given algorithm * * @param hash RSA signing hash algorithm */ adsa(hash: HashCtor): Adsa; } export interface KeyJWK { kty: string; crv: string; x: string; y?: string; ext: boolean; } export interface PublicKeyJWK extends KeyJWK { } export interface PrivateKeyJWK extends KeyJWK { d: string; }