()
| 587 | |
| 588 | @pytest.fixture(scope='module') |
| 589 | def abe(): |
| 590 | uid = PGPUID.new('Abraham Lincoln', comment='Honest Abe', email='abraham.lincoln@whitehouse.gov') |
| 591 | with open('tests/testdata/abe.jpg', 'rb') as abef: |
| 592 | abebytes = bytearray(os.fstat(abef.fileno()).st_size) |
| 593 | abef.readinto(abebytes) |
| 594 | uphoto = PGPUID.new(abebytes) |
| 595 | |
| 596 | # Abe is pretty oldschool, so he uses a DSA primary key |
| 597 | # normally he uses an ElGamal subkey for encryption, but PGPy doesn't support that yet, so he's settled for RSA for now |
| 598 | key = PGPKey.new(PubKeyAlgorithm.DSA, 1024) |
| 599 | subkey = PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 1024) |
| 600 | |
| 601 | key.add_uid(uid, |
| 602 | usage={KeyFlags.Certify, KeyFlags.Sign}, |
| 603 | hashes=[HashAlgorithm.SHA224, HashAlgorithm.SHA1], |
| 604 | ciphers=[SymmetricKeyAlgorithm.AES128, SymmetricKeyAlgorithm.Camellia128, SymmetricKeyAlgorithm.CAST5], |
| 605 | compression=[CompressionAlgorithm.ZLIB]) |
| 606 | key.add_uid(uphoto) |
| 607 | key.add_subkey(subkey, usage={KeyFlags.EncryptCommunications, KeyFlags.EncryptStorage}) |
| 608 | return key |
| 609 | |
| 610 | |
| 611 | @pytest.fixture(scope='module') |
nothing calls this directly
no test coverage detected