bentonstark / starksoft-aspen

.net / mono security and cryptography library that provides client support for ftps, gnupg, smartcard, and socks / http proxies
106 stars 49 forks source link

Add support for --local-user switch. #9

Closed csowa closed 8 years ago

csowa commented 9 years ago

Support --local-user switch for GPG decrypt, sign and verify.

Add GPG.LocalUser property and overloads for the GPG.Decrypt, GPG.Sign and GPG.Verify methods with localUser parameter.

GPG.Encrypt with the signAndEncrypt parameter = true will use LocalUser if specified. Additional overloads for GPG.Encrypt were not defined, since there are dependencies between SignAndEncrypt and LocalUser that complicate the semantics.

I had a need to be able to select which private key to use for decryption and signing, so I'm passing this on in case you're interested.