-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Let's talk about what an X509 certificate looks like. Here's a strawman I built in 10 minutes. It does not attempt to define what a distinguished name object or the extensions objects would look like at this time.
@six.add_metaclass(abc.ABCMeta)
class X509Certificate(object):
@abc.abstractproperty
def extensions(self):
"""
Returns a list of extension objects
"""
@abc.abstractproperty
def fingerprint(algorithm):
"""
Returns bytes using digest passed.
"""
@abc.abstractproperty
def serial(self):
"""
Returns certificate serial number
"""
@abc.abstractproperty
def version(self):
"""
Returns certificate version
"""
@abc.abstractmethod
def subject(self):
"""
Returns the subject distinguished name object
"""
@abc.abstractmethod
def issuer(self):
"""
Returns the issuer distinguished name object
"""
@abc.abstractproperty
def signature_algorithm(self):
"""
Returns signature algorithm data. This will be some mapping of the OID.
"""
@abc.abstractmethod
def public_key(self):
"""
Returns the public key
"""
@abc.abstractproperty
def not_before(self):
"""
Not before time (represented as UTC time object)
"""
@abc.abstractproperty
def not_after(self):
"""
Not after time (represented as UTC time object)
"""