Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Dec 16, 2024
1 parent 453febb commit 3d9812a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nodeman/internal_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,21 @@ def __init__(

@classmethod
def load(
cls, ca_certificate_file: str, ca_private_key_file: str, validity: timedelta, w: timedelta | None = None
cls,
ca_certificate_file: str,
ca_private_key_file: str,
validity: timedelta | None = None,
time_skew: timedelta | None = None,
) -> Self:
with open(ca_private_key_file, "rb") as fp:
with open(ca_certificate_file, "rb") as fp:
ca_certificate = x509.load_pem_x509_certificate(fp.read())

with open(ca_private_key_file, "rb") as fp:
ca_private_key = load_pem_private_key(fp.read())
if not isinstance(ca_private_key, PrivateKey):
raise ValueError("Unsupported private key algorithm")

return cls(ca_certificate=ca_certificate, ca_private_key=ca_private_key, validity=validity)
return cls(ca_certificate=ca_certificate, ca_private_key=ca_private_key, validity=validity, time_skew=time_skew)

def sign_csr(self, csr: x509.CertificateSigningRequest, name: str) -> CertificateInformation:
"""Sign CSR with CA private key"""
Expand Down

0 comments on commit 3d9812a

Please sign in to comment.