Skip to content
Snippets Groups Projects
ICryptoService.d.ts 830 B
Newer Older
  • Learn to ignore specific revisions
  • Igor Markin's avatar
    Igor Markin committed
    export interface AESGCMOutput {
        data: ArrayBuffer;
        key: ArrayBuffer;
        iv: ArrayBuffer;
    }
    
    Igor Markin's avatar
    Igor Markin committed
    export interface RSAKeys {
        publicKeyPEM: string;
        privateKeyPEM: string;
    }
    
    Igor Markin's avatar
    Igor Markin committed
    export interface ICryptoService {
    
    Igor Markin's avatar
    Igor Markin committed
        encryptAESGCM: (data: string) => Promise<AESGCMOutput>;
        decryptAESGCM: (data: ArrayBuffer, key: ArrayBuffer, iv: ArrayBuffer) => Promise<string>;
        generateRSAKeys: () => Promise<RSAKeys>;
        encryptRSA: (publicKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
        decryptRSA: (privateKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
        signRSA: (privateKeyPEM: string, data: ArrayBuffer) => Promise<ArrayBuffer>;
        verifyRSASignature: (publicKeyPEM: string, data: ArrayBuffer, signature: ArrayBuffer) => Promise<boolean>;
        SHA256: (string: string) => Promise<ArrayBuffer>;
    
    Igor Markin's avatar
    Igor Markin committed
    }