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

Method new

pgpy/packet/packets.py:893–903  ·  view source on GitHub ↗
(cls, key_algorithm, key_size, created=None)

Source from the content-addressed store, hash-verified

891
892 @classmethod
893 def new(cls, key_algorithm, key_size, created=None):
894 # build a key packet
895 pk = PrivKeyV4()
896 pk.pkalg = key_algorithm
897 if pk.keymaterial is None:
898 raise NotImplementedError(key_algorithm)
899 pk.keymaterial._generate(key_size)
900 if created is not None:
901 pk.created = created
902 pk.update_hlen()
903 return pk
904
905 def pubkey(self):
906 # return a copy of ourselves, but just the public half

Callers 5

encrypt_keyblobMethod · 0.45
decrypt_keyblobMethod · 0.45
fingerprintMethod · 0.45
encryptMethod · 0.45
decryptMethod · 0.45

Calls 3

PrivKeyV4Class · 0.85
_generateMethod · 0.45
update_hlenMethod · 0.45

Tested by

no test coverage detected