1 import type { PrivateKeyReference, PublicKeyReference } from '@proton/crypto';
3 import type { RequireSome } from './utils';
5 export interface KeyWithRecoverySecret extends Key {
6 RecoverySecret: string;
7 RecoverySecretSignature: string;
10 export interface Key {
14 Flags?: number; // Only available for address keys
16 Fingerprints: string[];
17 PublicKey: string; // armored key
20 PrivateKey: string; // armored key
22 Signature?: string; // Only available for address keys
23 RecoverySecret?: string | null; // Only available for user keys
24 RecoverySecretSignature?: string | null; // Only available for user keys
25 AddressForwardingID?: string | null; // Only available for address keys
28 export type AddressKey = RequireSome<Key, 'Flags' | 'Signature' | 'AddressForwardingID'>;
29 export type UserKey = RequireSome<Key, 'RecoverySecret' | 'RecoverySecretSignature'>;
31 export interface KeyPair {
32 privateKey: PrivateKeyReference;
33 publicKey: PublicKeyReference;
36 export interface KeysPair {
37 privateKeys: PrivateKeyReference[];
38 publicKeys: PublicKeyReference[];
41 export interface DecryptedKey extends KeyPair {
45 export interface DecryptedAddressKey extends KeyPair {
51 export interface InactiveKey {
56 export interface ActiveKey extends DecryptedKey {
60 sha256Fingerprints: string[];