Skip to content

Commit

Permalink
Merge pull request #10 from scheibling:scheibling/issue8
Browse files Browse the repository at this point in the history
Certificate is now marked as signed when imported
  • Loading branch information
scheibling authored Jun 29, 2022
2 parents 4f41b20 + ed4ef7d commit 16ab894
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sshkey_tools/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,9 @@ def __init__(self, private_key: PrivateKey = None, signature: bytes = None):
self.private_key = private_key
self.is_signed = False
self.value = signature

if signature is not None and ensure_string(signature) not in ("", " "):
self.is_signed = True

@staticmethod
def from_object(private_key: PrivateKey):
Expand Down Expand Up @@ -1349,7 +1352,7 @@ def from_decode(cls, data: bytes) -> Tuple["RSASignatureField", bytes]:
cls(
private_key=None,
hash_alg=[alg for alg in RsaAlgs if alg.value[0] == signature[0]][0],
signature=signature[1],
signature=signature[1]
),
data,
)
Expand Down

0 comments on commit 16ab894

Please sign in to comment.