Python cryptography.x509.InvalidVersion() Examples

The following are 9 code examples of cryptography.x509.InvalidVersion(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module cryptography.x509 , or try the search function .
Example #1
Source File: x509.py    From oss-ftp with MIT License 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{0} is not a valid X509 version".format(version), version
            ) 
Example #2
Source File: x509.py    From Safejumper-for-Desktop with GNU General Public License v2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{0} is not a valid X509 version".format(version), version
            ) 
Example #3
Source File: x509.py    From teleport with Apache License 2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{0} is not a valid X509 version".format(version), version
            ) 
Example #4
Source File: x509.py    From teleport with Apache License 2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{} is not a valid X509 version".format(version), version
            ) 
Example #5
Source File: x509.py    From teleport with Apache License 2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{} is not a valid X509 version".format(version), version
            ) 
Example #6
Source File: x509.py    From learn_python3_spider with MIT License 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{} is not a valid X509 version".format(version), version
            ) 
Example #7
Source File: x509.py    From quickstart-git2s3 with Apache License 2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{0} is not a valid X509 version".format(version), version
            ) 
Example #8
Source File: x509.py    From quickstart-redhat-openshift with Apache License 2.0 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{} is not a valid X509 version".format(version), version
            ) 
Example #9
Source File: x509.py    From Carnets with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def version(self):
        version = self._backend._lib.X509_get_version(self._x509)
        if version == 0:
            return x509.Version.v1
        elif version == 2:
            return x509.Version.v3
        else:
            raise x509.InvalidVersion(
                "{} is not a valid X509 version".format(version), version
            )