import { Crypto, CryptoAsymmetricModels } from '@open-rights-exchange/chain-js'; import { AlgoEncryptionOptions, AlgorandGeneratedAccountStruct, AlgorandKeyPair, AlgorandPrivateKey, AlgorandPublicKey, AlgorandSignature } from './models'; /** Verifies that the value is a valid encrypted string */ export declare function isSymEncryptedDataString(value: string): value is Crypto.Ed25519Crypto.Ed25519EncryptedDataString; /** Ensures that the value confirms to a well-formed and encrypted string */ export declare function toSymEncryptedDataString(value: any): Crypto.Ed25519Crypto.Ed25519EncryptedDataString; /** Encrypts a string using a password and a nonce * Nacl requires password to be in a 32 byte array format. Hence we derive a key from the password string using the provided salt */ export declare function encryptWithPassword(unencrypted: string, password: string, options: AlgoEncryptionOptions): Crypto.Ed25519Crypto.Ed25519EncryptedDataString; /** Decrypts the encrypted value using nacl * Nacl requires password to be in a 32 byte array format */ export declare function decryptWithPassword(encrypted: Crypto.Ed25519Crypto.Ed25519EncryptedDataString | any, password: string, options: AlgoEncryptionOptions): string; /** Encrypts a string using a public key into a stringified JSON object * The encrypted result can be decrypted with the matching private key */ export declare function encryptWithPublicKey(unencrypted: string, publicKey: AlgorandPublicKey, options: Crypto.Asymmetric.EciesOptions): Promise; /** Decrypts the encrypted value using a private key * The encrypted value is a stringified JSON object * ... and must have been encrypted with the public key that matches the private ley provided */ export declare function decryptWithPrivateKey(encrypted: Crypto.Asymmetric.AsymmetricEncryptedDataString | Crypto.Asymmetric.AsymmetricEncryptedData, privateKey: AlgorandPrivateKey, options: Crypto.Asymmetric.EciesOptions): Promise; /** Encrypts a string using multiple assymmetric encryptions with multiple public keys - one after the other * calls a helper function to perform the iterative wrapping * the first parameter of the helper is a chain-specific function (in this file) to encryptWithPublicKey * The result is stringified JSON object including an array of encryption results with the last one including the final cipertext * Encrypts using publicKeys in the order they appear in the array */ export declare function encryptWithPublicKeys(unencrypted: string, publicKeys: AlgorandPublicKey[], options?: Crypto.Asymmetric.EciesOptions): Promise; /** Unwraps an object produced by encryptWithPublicKeys() - resulting in the original ecrypted string * calls a helper function to perform the iterative unwrapping * the first parameter of the helper is a chain-specific function (in this file) to decryptWithPrivateKey * Decrypts using privateKeys that match the publicKeys provided in encryptWithPublicKeys() - provide the privateKeys in same order * The result is the decrypted string */ export declare function decryptWithPrivateKeys(encrypted: Crypto.Asymmetric.AsymmetricEncryptedDataString, privateKeys: AlgorandPrivateKey[], options?: any): Promise<{ decrypted: string; remaining: CryptoAsymmetricModels.AsymmetricEncryptedData[]; }>; /** Signs a string with a private key * Returns signature as a Buffer from a UInt8Array */ export declare function sign(data: string, privateKey: AlgorandPrivateKey | string): AlgorandSignature; /** Gets the algorand keypair (public and private keys) for the account */ export declare function getAlgorandKeyPairFromAccount(account: AlgorandGeneratedAccountStruct): AlgorandKeyPair; /** Generates and returns a new public/private key pair */ export declare function generateKeyPair(): Promise; /** Gets the algorand keypair (public and private keys) for the privateKey */ export declare function getAlgorandKeyPairFromPrivateKey(privateKey: AlgorandPrivateKey): AlgorandKeyPair; /** Gets the algorand keypair (public and private keys) for the privateKey */ export declare function getAlgorandPublicKeyFromPrivateKey(privateKey: AlgorandPrivateKey): AlgorandPublicKey; /** Generates new public and private key pair * Encrypts the private key using password */ export declare function generateNewAccountKeysAndEncryptPrivateKeys(password: string, options: AlgoEncryptionOptions): Promise; /** Verify that the signed data was signed using the given key (signed with the private key for the provided public key) */ export declare function verifySignedWithPublicKey(data: string, publicKey: AlgorandPublicKey, signature: AlgorandSignature): boolean; /** Signs data as a message using private key (Algorand does not append additional fields for a message) */ export declare function signMessage(data: string, privateKey: AlgorandPrivateKey | string): AlgorandSignature; /** Verify that a 'personal message' was signed using the given key (Algorand does not append additional fields for a message) */ export declare function verifySignedMessage(data: string, publicKey: AlgorandPublicKey, signature: AlgorandSignature): boolean;