23 lines
664 B
Python
23 lines
664 B
Python
class Pki:
|
|
"""
|
|
Represent a Public Key Infrastructure
|
|
"""
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
class Certificate:
|
|
"""
|
|
Represent a Certificate
|
|
"""
|
|
|
|
def __init__(self):
|
|
# create a builder for the certificate
|
|
builder = x509.CertificateBuilder(
|
|
issuer_name=x509.Name([x509.NameAttribute(x509.oid.NameOID.COMMON_NAME, issuer)]),
|
|
subject_name=x509.Name([x509.NameAttribute(x509.oid.NameOID.COMMON_NAME, subject)]),
|
|
serial_number=x509.random_serial_number(),
|
|
public_key=self.public_key,
|
|
not_valid_before=valid_start,
|
|
not_valid_after=valid_end,
|
|
)
|