key.d.ts 689 B

123456789101112131415161718192021
  1. import { Signable } from './base';
  2. import { JSONObject, JSONValue } from './utils';
  3. export interface KeyOptions {
  4. keyID: string;
  5. keyType: string;
  6. scheme: string;
  7. keyVal: Record<string, string>;
  8. unrecognizedFields?: Record<string, JSONValue>;
  9. }
  10. export declare class Key {
  11. readonly keyID: string;
  12. readonly keyType: string;
  13. readonly scheme: string;
  14. readonly keyVal: Record<string, string>;
  15. readonly unrecognizedFields?: Record<string, JSONValue>;
  16. constructor(options: KeyOptions);
  17. verifySignature(metadata: Signable): void;
  18. equals(other: Key): boolean;
  19. toJSON(): JSONObject;
  20. static fromJSON(keyID: string, data: JSONObject): Key;
  21. }