Esempio n. 1
0
    def _generate_private_and_public_keys(self):
        """"""
        private_key, public_key = KeysGen.gen_private_and_public_keys()

        private_key_str = Converter.binary_to_string(
            private_key.exportKey(format="DER"))
        public_key_str = Converter.binary_to_string(
            public_key.exportKey(format="DER"))

        return private_key_str, public_key_str
Esempio n. 2
0
    def sign_transaction(self):

        signer = PKCS1_v1_5.new(
            RSA.importKey(Converter.string_to_binary(self.private_key)))

        self._create_payload_hash()

        signature = signer.sign(self.payload_hash)

        return Converter.binary_to_string(signature)