PyCryptodome - DSA.py has error with has_private()

I am following the PDF of v.3.4.7, on page 36/82. The code is encountered right on this line: f.write(key.publickey().exportKey(key))

I am running on a Windowos 7 machine, so I modify the previous line to: f = open("public_key.pem", "wb")

This is the error message: Traceback (most recent call last): File "C:\Users\Administrator\Documents\VS Projects\Sample\Cryptodome tutorial 3 - Key type, DSA.py", line 8, in f.write(key.publickey().exportKey(key)) File "C:\Program Files\Python36\lib\site-packages\pycryptodome-3.4.7-py3.6-win-amd64.egg\Crypto\PublicKey\DSA.py", line 272, in exportKey if format == 'OpenSSH': File "C:\Program Files\Python36\lib\site-packages\pycryptodome-3.4.7-py3.6-win-amd64.egg\Crypto\PublicKey\DSA.py", line 163, in eq if bool(self.has_private()) != bool(other.has_private()): AttributeError: 'str' object has no attribute 'has_private'

Any help would be appreciated. Thanks.

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image