Skip to content

Commit b6f2c96

Browse files
Merge pull request #66 from Venafi/ssh_certificates
Fixes to SSH key pair encoding
2 parents 4aad5e3 + ab58f62 commit b6f2c96

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

vcert/ssh_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from cryptography.hazmat.primitives.asymmetric import rsa
2121

2222

23-
from errors import ClientBadData
23+
from .errors import ClientBadData
2424

2525
PATH_SEPARATOR = "\\"
2626
CA_ROOT_PATH = PATH_SEPARATOR + "VED" + PATH_SEPARATOR + "Certificate Authority" + PATH_SEPARATOR + "SSH" \
@@ -175,7 +175,7 @@ def generate(self, key_size=DEFAULT_SSH_KEY_SIZE, passphrase=None):
175175
:return:
176176
"""
177177
if passphrase:
178-
encryption = serialization.BestAvailableEncryption(passphrase)
178+
encryption = serialization.BestAvailableEncryption(passphrase.encode())
179179
else:
180180
encryption = serialization.NoEncryption()
181181

@@ -192,8 +192,8 @@ def generate(self, key_size=DEFAULT_SSH_KEY_SIZE, passphrase=None):
192192
encoding=serialization.Encoding.OpenSSH,
193193
format=serialization.PublicFormat.OpenSSH
194194
)
195-
self._private_key = private_key
196-
self._public_key = public_key
195+
self._private_key = private_key.decode()
196+
self._public_key = public_key.decode()
197197

198198
def private_key(self):
199199
return self._private_key

0 commit comments

Comments
 (0)