Cinchoo / ChoPGP

PGP library for .NET / c#
MIT License
60 stars 29 forks source link

Signed a file only #24

Open Salmanferozkhan opened 4 years ago

Salmanferozkhan commented 4 years ago

Hello Is there possible to signed a file only not encryption because we have did encryption already we need to signed a file only?

Cinchoo commented 4 years ago

No, there is no support of sign file only.

Workaround is Decrypt -> EncryptWithSign.

Salmanferozkhan commented 4 years ago

Hello @Cinchoo , When decrypting and verifying stream via method DecryptAndVerify, it throws an exception "Failed to verify file" Expected Input parameters are inputStream, outputStream, publicKey(sender), privateKey(receiver), passPhrase Actual Input parameters inputStream, outputStream, publicKey(receiver), privateKey(receiver), passPhrase According to the rule of verifying the signature, it should accept the public key of the sender in order to verify the signature of the sender. Please pass your comments on it.

Cinchoo commented 4 years ago

Have you tried Decrypt or DecryptFile? If the file is encrypted, not signed, you have to use these methods.

Salmanferozkhan commented 4 years ago

@Cinchoo I have done encrypt and signed with the EncryptAndSigned method.. now from the decrypting and verifying from the DecryptAndVerify I was getting exception "Failed to verify file" so I check your condition so I found that I was passing (sender) public key when I changed sender public key to receiver public key so its worked. so I need to ask why it is taking receiver public key instead of sender public key?

According to the rule of verifying the signature, it should accept the public key of the sender in order to verify the signature of the sender. Please pass your comments on it.