Skip to content

Commit

Permalink
Merge pull request #66 from Venafi/ssh_certificates
Browse files Browse the repository at this point in the history
Fixes to SSH key pair encoding
  • Loading branch information
marcos-albornoz authored Aug 17, 2021
2 parents 4aad5e3 + ab58f62 commit b6f2c96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vcert/ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from cryptography.hazmat.primitives.asymmetric import rsa


from errors import ClientBadData
from .errors import ClientBadData

PATH_SEPARATOR = "\\"
CA_ROOT_PATH = PATH_SEPARATOR + "VED" + PATH_SEPARATOR + "Certificate Authority" + PATH_SEPARATOR + "SSH" \
Expand Down Expand Up @@ -175,7 +175,7 @@ def generate(self, key_size=DEFAULT_SSH_KEY_SIZE, passphrase=None):
:return:
"""
if passphrase:
encryption = serialization.BestAvailableEncryption(passphrase)
encryption = serialization.BestAvailableEncryption(passphrase.encode())
else:
encryption = serialization.NoEncryption()

Expand All @@ -192,8 +192,8 @@ def generate(self, key_size=DEFAULT_SSH_KEY_SIZE, passphrase=None):
encoding=serialization.Encoding.OpenSSH,
format=serialization.PublicFormat.OpenSSH
)
self._private_key = private_key
self._public_key = public_key
self._private_key = private_key.decode()
self._public_key = public_key.decode()

def private_key(self):
return self._private_key
Expand Down

0 comments on commit b6f2c96

Please sign in to comment.