From 7868a869fda3e28230c19abc492057cc91b84902 Mon Sep 17 00:00:00 2001 From: k clair Date: Tue, 9 Oct 2012 12:24:40 -0700 Subject: remove debian packaging files from master branch. master should only have the source files and the README --- gnutls-1.1.9/gnutls/crypto.py | 317 ------------------------------------------ 1 file changed, 317 deletions(-) delete mode 100644 gnutls-1.1.9/gnutls/crypto.py (limited to 'gnutls-1.1.9/gnutls/crypto.py') diff --git a/gnutls-1.1.9/gnutls/crypto.py b/gnutls-1.1.9/gnutls/crypto.py deleted file mode 100644 index d330144..0000000 --- a/gnutls-1.1.9/gnutls/crypto.py +++ /dev/null @@ -1,317 +0,0 @@ -# Copyright (C) 2007 AG Projects. See LICENSE for details. -# - -"""GNUTLS crypto support""" - -__all__ = ['X509Name', 'X509Certificate', 'X509PrivateKey', 'X509Identity', 'X509CRL', 'DHParams', 'RSAParams'] - -import re -from ctypes import * - -from gnutls.validators import method_args, one_of -from gnutls.constants import X509_FMT_DER, X509_FMT_PEM -from gnutls.errors import * - -from gnutls.library.constants import GNUTLS_SAN_DNSNAME, GNUTLS_SAN_RFC822NAME, GNUTLS_SAN_URI -from gnutls.library.constants import GNUTLS_SAN_IPADDRESS, GNUTLS_SAN_OTHERNAME, GNUTLS_SAN_DN -from gnutls.library.constants import GNUTLS_E_SHORT_MEMORY_BUFFER -from gnutls.library.types import * -from gnutls.library.functions import * - - -class X509NameMeta(type): - long_names = {'country': 'C', - 'state': 'ST', - 'locality': 'L', - 'common_name': 'CN', - 'organization': 'O', - 'organization_unit': 'OU', - 'email': 'EMAIL'} - def __new__(cls, name, bases, dic): - instance = type.__new__(cls, name, bases, dic) - instance.ids = X509NameMeta.long_names.values() - for long_name, short_name in X509NameMeta.long_names.items(): - ## Map a long_name property to the short_name attribute - cls.add_property(instance, long_name, short_name) - return instance - def add_property(instance, name, short_name): - setattr(instance, name, property(lambda self: getattr(self, short_name, None))) - - -class X509Name(str): - __metaclass__ = X509NameMeta - - def __init__(self, dname): - str.__init__(self) - pairs = [x.replace('\,', ',') for x in re.split(r'(?