Ejemplo n.º 1
0
    def names(self):
        """What are the subject names of this certificate?

        :returns: the subject names
        :rtype: `list` of `str`
        :raises .CertStorageError: if could not find cert file.

        """
        target = self.current_target("cert")
        if target is None:
            raise errors.CertStorageError("could not find cert file")
        with open(target) as f:
            return crypto_util.get_names_from_cert(f.read())
Ejemplo n.º 2
0
    def names(self):
        """What are the subject names of this certificate?

        :returns: the subject names
        :rtype: `list` of `str`
        :raises .CertStorageError: if could not find cert file.

        """
        target = self.current_target("cert")
        if target is None:
            raise errors.CertStorageError(
                "could not find the certificate file")
        with open(target) as f:
            # TODO: Remove the cast once certbot package is fully typed
            return crypto_util.get_names_from_cert(cast(bytes, f.read()))
Ejemplo n.º 3
0
    def names(self, version=None):
        """What are the subject names of this certificate?

        (If no version is specified, use the current version.)

        :param int version: the desired version number
        :returns: the subject names
        :rtype: `list` of `str`
        :raises .CertStorageError: if could not find cert file.

        """
        if version is None:
            target = self.current_target("cert")
        else:
            target = self.version("cert", version)
        if target is None:
            raise errors.CertStorageError("could not find cert file")
        with open(target) as f:
            return crypto_util.get_names_from_cert(f.read())
Ejemplo n.º 4
0
    def names(self, version=None):
        """What are the subject names of this certificate?

        (If no version is specified, use the current version.)

        :param int version: the desired version number
        :returns: the subject names
        :rtype: `list` of `str`
        :raises .CertStorageError: if could not find cert file.

        """
        if version is None:
            target = self.current_target("cert")
        else:
            target = self.version("cert", version)
        if target is None:
            raise errors.CertStorageError("could not find cert file")
        with open(target) as f:
            return crypto_util.get_names_from_cert(f.read())
Ejemplo n.º 5
0
 def _call(cls, *args, **kwargs):
     from certbot.crypto_util import get_names_from_cert
     return get_names_from_cert(*args, **kwargs)
Ejemplo n.º 6
0
 def _call(cls, *args, **kwargs):
     from certbot.crypto_util import get_names_from_cert
     return get_names_from_cert(*args, **kwargs)