/**
 * 签名提供者接口
 * 定义签名操作的抽象契约
 */

import { SignatureResult, PacificaSignData } from '../../shared/credential-types'

export interface ISignatureProvider {
  /**
   * 平台标识
   */
  readonly platformId: string

  /**
   * 签名算法
   */
  readonly algorithm: string

  /**
   * 执行签名
   */
  sign(data: PacificaSignData, credentials: any): Promise<SignatureResult>

  /**
   * 验证签名（可选）
   */
  verify?(signature: string, data: PacificaSignData, publicKey: string): Promise<boolean>

  /**
   * 派生公钥
   */
  derivePublicKey?(privateKey: string): string

  /**
   * 获取提供者信息
   */
  getInfo(): {
    platformId: string
    algorithm: string
    supportedOperations: string[]
    performance: {
      maxSigningTime: string
    }
  }
}
