Merge branch 'cnfvar-deprecations'
[pyi2ncommon] / src / cnfline / build_key.py
diff --git a/src/cnfline/build_key.py b/src/cnfline/build_key.py
deleted file mode 100644 (file)
index bf471dc..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# The software in this package is distributed under the GNU General
-# Public License version 2 (with a special exception described below).
-#
-# A copy of GNU General Public License (GPL) is included in this distribution,
-# in the file COPYING.GPL.
-#
-# As a special exception, if other files instantiate templates or use macros
-# or inline functions from this file, or you compile this file and link it
-# with other works to produce a work based on this file, this file
-# does not by itself cause the resulting work to be covered
-# by the GNU General Public License.
-#
-# However the source code for this file must still be made available
-# in accordance with section (3) of the GNU General Public License.
-#
-# This exception does not invalidate any other reasons why a work based
-# on this file might be covered by the GNU General Public License.
-#
-# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-
-from .build_cnfvar import BuildCnfVar
-"""Class to create own keys cnfvar on the fly """
-
-
-class BuildKey(BuildCnfVar):
-    def __init__(self, data='sample key', instance=0, line_no=1):
-        BuildCnfVar.__init__(self, 'KEY_OWN', instance, data, line_no)
-
-        # set some dummy data for cnf_check
-        defaults = {
-            'KEY_OWN_FINGERPRINT_MD5': '76:3B:CF:8E:CB:BF:A5:7D:CC:87:39:FA:CE:99:2E:96',
-            'KEY_OWN_FINGERPRINT_SHA1': 'ED:5A:C6:D9:5B:BE:47:1F:B9:4F:CF:A3:80:3B:42:08:F4:00:16:96',
-            'KEY_OWN_ID_X509': 'CN=some.net.lan',
-            'KEY_OWN_ISSUER': 'CN=ab, C=fd, L=ab, ST=ab, O=ab, OU=ab/emailAddress=ab@ab.com',
-            'KEY_OWN_KEYSIZE': '2048',
-            'KEY_OWN_HASH_ALGO': 'SHA2_256',
-            'KEY_OWN_PRIVATE_KEY': '-----BEGIN PRIVATE KEY-----\\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKk' +
-                                   'ZTzqHXg41RZMiY+ywRZ037pBq8J3BkH\\n-----END PRIVATE KEY-----\\n',
-            'KEY_OWN_PUBLIC_KEY': '-----BEGIN CERTIFICATE-----\\nMIIFCTCCAvGgAwIBAgIEVBGDuTANBgkqhkiG' +
-                                  '9w0BAQsFADCBgTEPMA0GA1UEAwwG\\n-----END CERTIFICATE-----\\n',
-            'KEY_OWN_REQUEST': '-----BEGIN CERTIFICATE REQUEST-----\\nMIIDCzCCAfMCAQAwIjEgMB4GA1UEAww' +
-                               'XaW50cmFkZXYtYWllc\\n-----END CERTIFICATE REQUEST-----\\n',
-            'KEY_OWN_SUBJECT': 'CN=some.net.lan',
-            'KEY_OWN_VALIDFROM': '20140911T111257',
-            'KEY_OWN_VALIDTILL': '20160731T134608',
-            'KEY_OWN_TYPE': 'SELF',
-
-            # the ones bellow should be set when using 'generate' to create the key
-            'KEY_OWN_CREATE_CN': 'somehost',
-            'KEY_OWN_CREATE_EMAIL': 'default@intra2net.com'
-        }
-
-        self.add_defaults(defaults)
-
-    def country(self, country):
-        self.update_cnf('KEY_OWN_CREATE_C', 0, country)
-        return self
-
-    def state(self, state):
-        self.update_cnf('KEY_OWN_CREATE_ST', 0, state)
-        return self
-
-    def city(self, city):
-        self.update_cnf('KEY_OWN_CREATE_L', 0, city)
-        return self
-
-    def company(self, company):
-        self.update_cnf('KEY_OWN_CREATE_O', 0, company)
-        return self
-
-    def department(self, department):
-        self.update_cnf('KEY_OWN_CREATE_OU', 0, department)
-        return self
-
-    def computer_name(self, computer_name):
-        self.update_cnf('KEY_OWN_CREATE_CN', 0, computer_name)
-        return self
-
-    def email(self, email):
-        self.update_cnf('KEY_OWN_CREATE_EMAIL', 0, email)
-        return self
-
-    def days(self, days):
-        self.update_cnf('KEY_OWN_CREATE_DAYS', 0, days)
-        return self
-
-    def keysize(self, keysize):
-        self.update_cnf('KEY_OWN_KEYSIZE', 0, keysize)
-        return self
-
-    def hash_algo(self, hash_algo):
-        self.update_cnf('KEY_OWN_HASH_ALGO', 0, hash_algo)
-        return self
-
-    def certchain(self, certchain):
-        self.update_cnf('KEY_OWN_CERTCHAIN', 0, certchain)
-        return self
-
-    def cerchain_count(self, cerchain_count):
-        self.update_cnf('KEY_OWN_CERTCHAIN_CERTCOUNT', 0, cerchain_count)
-        return self
-
-    def create_subjalt(self, create_subjalt):
-        self.update_cnf('KEY_OWN_CREATE_SUBJALT', 0, create_subjalt)
-        return self
-
-    def create_subjalt_type(self, create_subjalt_type):
-        self.update_cnf('KEY_OWN_CREATE_SUBJALT_TYPE', 0, create_subjalt_type)
-        return self
-
-    def fingerprint_md5(self, fingerprint_md5):
-        self.update_cnf('KEY_OWN_FINGERPRINT_MD5', 0, fingerprint_md5)
-        return self
-
-    def fingerprint_sha1(self, fingerprint_sha1):
-        self.update_cnf('KEY_OWN_FINGERPRINT_SHA1', 0, fingerprint_sha1)
-        return self
-
-    def id_x509(self, id_x509):
-        self.update_cnf('KEY_OWN_ID_X509', 0, id_x509)
-        return self
-
-    def issuer(self, issuer):
-        self.update_cnf('KEY_OWN_ISSUER', 0, issuer)
-        return self
-
-    def private_key(self, private_key):
-        self.update_cnf('KEY_OWN_PRIVATE_KEY', 0, private_key)
-        return self
-
-    def public_key(self, public_key):
-        self.update_cnf('KEY_OWN_PUBLIC_KEY', 0, public_key)
-        return self
-
-    def request(self, request):
-        self.update_cnf('KEY_OWN_REQUEST', 0, request)
-        return self
-
-    def subject(self, subject):
-        self.update_cnf('KEY_OWN_SUBJECT', 0, subject)
-        return self
-
-    def subject_alt(self, subject_alt):
-        self.update_cnf('KEY_OWN_SUBJECT_ALT', 0, subject_alt)
-        return self
-
-    def key_type(self, key_type):
-        self.update_cnf('KEY_OWN_TYPE', 0, key_type)
-        return self
-
-    def valid_from(self, valid_from):
-        self.update_cnf('KEY_OWN_VALIDFROM', 0, valid_from)
-        return self
-
-    def valid_till(self, valid_till):
-        self.update_cnf('KEY_OWN_VALIDTILL', 0, valid_till)
-        return self