MCPcopy Create free account
hub / github.com/SecurityInnovation/PGPy / abe

Function abe

tests/test_05_actions.py:589–608  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

587
588@pytest.fixture(scope='module')
589def 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')

Callers

nothing calls this directly

Calls 3

add_uidMethod · 0.80
add_subkeyMethod · 0.80
newMethod · 0.45

Tested by

no test coverage detected