EvotecIT / PSPGP

PSPGP is a PowerShell module that provides PGP functionality in PowerShell. It allows encrypting and decrypting files/folders and strings using PGP.
MIT License
57 stars 21 forks source link

Is it possible to implement a command to Sign and Encrypt #19

Closed mario-velazquez closed 1 month ago

mario-velazquez commented 1 month ago

Is it possible to implement a command to Sign and Encrypt

Sign with My Private key and Encrypt with the recipient Public key

Thanks!

PrzemyslawKlys commented 1 month ago

Protect-GPP has:

image

That means you can encrypt & sign.

mario-velazquez commented 1 month ago

That is great!

I just tried like this and it worked perfectly!

Protect-PGP -FilePathPublic C:\Scripts\xxxxxx\pgp\Keys\xxxxx-PublicPGP.asc -FolderPath "C:\Scripts\xxxxxx\pgp\Test-1.txt" -OutputFolderPath C:\Scripts\xxxxxx\pgp -SignKey C:\Scripts\xxxxxx\pgp\Keys\xx-xx-xx-2024-08-09_public.asc -SignPassword xxxxxxxxxx

Thank you!!

One more question: how can I change the encrypted file extension, I need to create the file with extension gpg instead of pgp?

I know I can create the file and then rename it, but I'm hoping to save one step

Thanks again!

PrzemyslawKlys commented 1 month ago

You can provide OutFilePath? which will let you control it per file, but you need to use FilePath then, not a FolderPath

mario-velazquez commented 1 month ago

Excellent, I ended up doing the following as recommended, Thanks!

Protect-PGP -FilePathPublic $pgp_public_key_path -FilePath $FullName -OutFilePath $encrypted_path -SignKey $SignKey -SignPassword $SignPassword