我们从Python开源项目中,提取了以下19个代码示例,用于说明如何使用cryptography.x509.InvalidVersion()。
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 )