Skip to content

X509 Certificate Interface Discussion #1036

@reaperhulk

Description

@reaperhulk

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)
        """

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions