Open spartacruz opened 2 years ago
I already try to fetch pgpy on this gihub and it still not running at all
Hi @spartacruz,
Could you put your sample code and error messages in code blocks please? This is better than screenshots as it would make it easier to test your code and read the errors.
Thanks!
Just confirming that this is still an issue.
import pgpy
from pgpy.constants import PubKeyAlgorithm, KeyFlags, HashAlgorithm, SymmetricKeyAlgorithm, CompressionAlgorithm
#Generate key using documentation, but comment out EncryptCommunications and EncryptStorage
key = pgpy.PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 4096)
uid = pgpy.PGPUID.new('Abraham Lincoln', comment='Honest Abe', email='abraham.lincoln@whitehouse.gov')
key.add_uid(uid, usage={KeyFlags.Sign
# , KeyFlags.EncryptCommunications, KeyFlags.EncryptStorage
},
hashes=[HashAlgorithm.SHA256, HashAlgorithm.SHA384, HashAlgorithm.SHA512, HashAlgorithm.SHA224],
ciphers=[SymmetricKeyAlgorithm.AES256, SymmetricKeyAlgorithm.AES192, SymmetricKeyAlgorithm.AES128],
compression=[CompressionAlgorithm.ZLIB, CompressionAlgorithm.BZ2, CompressionAlgorithm.ZIP, CompressionAlgorithm.Uncompressed])
#Attempt to encrypt new message without requiring usage flags
text_message = pgpy.PGPMessage.new("This is a brand spankin' new message!")
key._require_usage_flags = False
encrypted_message = key.encrypt(text_message)
This is still an issue as of 2022-07-13. Inspecting the code I see that the commit for this feature was 12 months ago. The release on PyPi is from 15 months ago => this feature is currently not available unless installing from source.
Hi, as title says I cannot use as it mention on documentation
Here is my sample code:
and still, pgpy reject my key..
Could somebody assist me how to bypass flag checking?
Thanks. -Yuri