예제 #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())
예제 #2
0
파일: storage.py 프로젝트: miigotu/certbot
    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()))
예제 #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())
예제 #4
0
파일: storage.py 프로젝트: bmw/letsencrypt
    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())
예제 #5
0
 def _call(cls, *args, **kwargs):
     from certbot.crypto_util import get_names_from_cert
     return get_names_from_cert(*args, **kwargs)
예제 #6
0
 def _call(cls, *args, **kwargs):
     from certbot.crypto_util import get_names_from_cert
     return get_names_from_cert(*args, **kwargs)