@safient/core
Version:
JavaScript SDK to manage safes and interact with Safient protocol.
37 lines (36 loc) • 1.52 kB
TypeScript
import { Connection, SafeEncrypted, RecoveryMessage, Share, User, SafeStore } from "../../lib/types";
export declare class Crypto {
/**
*
* @param safeData - Data that is stored on the safe
* @param beneficiaryDid - DID of the beneficiary
* @param creatorDid - DID of the creator
* @param creator - Connection Object of the creator
* @param guardians - Array of Guardian DIDs
* @param signature - Signature of the message by creator
* @param recoveryMessage - RecoveryMessage created for guardians
* @param secrets - Array of secrets for guardians
* @returns Encrypted Safe Data
*/
encryptSafeData: (safeData: SafeStore, creatorDid: any, creator: Connection, guardians: string[], signature: string, recoveryMessage: string, secrets: string[], beneficiaryDid?: string | undefined) => Promise<SafeEncrypted>;
/**
*
* @param encKey - Encrypted AES key
* @param connection - Connection object of the user
* @param encryptedData - Encrypted Safe Data
* @returns Decrypted Data
*/
decryptSafeData: (encKey: any, connection: Connection, encryptedData: any) => Promise<any>;
/**
*
* @param shards - Recovered shards of the guardians
* @returns Share pf the data
*/
reconstructSafeData: (shards: any) => Promise<Share>;
/**
*
* @param guardians - Array of Guardians of the Safes
* @returns - Recovery message
*/
generateSecrets: (guardians: User[]) => RecoveryMessage;
}