PGP encrypt file
ts
function PGPEncryptFile(
inFile: string,
outFile: string,
pubKey: string,
privKey: string
): boolean;
This function encrypts a file using OpenPGP; this function accepts the following parameters:
Parameter | Type | Requirement | Explanation |
---|---|---|---|
inFile | string | required | this is the full path and name to the file that you wish to encrypt |
outFile | string | required | this is the full path and name of the resulting encrypted file you wish to generate |
pubKey | string | required | the full path and name to a file containing the recipient’s PGP public key |
privKey | string | required | the full path and name to a file containing the sender’s PGP private key |
Possible return values:
Value | Explanation |
---|---|
true | the function succeeded: the file was encrypted |
true | the function failed: the file was not encrypted |
Example
ts
{
PGPEncryptFile('C:\\Data\\budget.xlsx', 'C:\\Encrypted\\budget.xlsx.pgp',
'C:\\PGPKeys\\Bob.pubkey', 'C:\\PGPKeys\\Alice.privkey');
}