From 28008a746a31abb7909dd86cb0cd413ac8943b0b Mon Sep 17 00:00:00 2001 From: jmpoep Date: Thu, 7 Dec 2023 16:51:07 +0800 Subject: first commit --- utils/arm-32bit.py | 121 + utils/arm-thumb.py | 122 + utils/intel-x86.py | 283 +++ utils/ipn_sqlclr/LogItem.cs | 11 + utils/ipn_sqlclr/Taggant.cs | 274 +++ utils/ipn_sqlclr/TaggantWebService.cs | 159 ++ utils/ipn_sqlclr/VmpLicenseKey.cs | 36 + ...UpdateCertificateStatusResponseType1.datasource | 10 + .../CertificateManagementService.wsdl | 94 + .../CertificateManagementService.xsd | 187 ++ .../certificateManagementService/Reference.cs | 1639 +++++++++++++ .../certificateManagementService/Reference.map | 7 + ...questKeyRecoveryResponseMessageType1.datasource | 10 + .../SearchCertificateResponseType1.datasource | 10 + ...UpdateCertificateStatusResponseType1.datasource | 10 + .../policyService/CertificateEnrollmentPolicy.wsdl | 37 + .../policyService/CertificateEnrollmentPolicy.xsd | 388 +++ .../Web References/policyService/Reference.cs | 2512 ++++++++++++++++++++ .../Web References/policyService/Reference.map | 7 + .../policyService/getPoliciesResponse.datasource | 10 + .../PrepSignDataResponse.datasource | 10 + .../Web References/signDataService/Reference.cs | 793 ++++++ .../Web References/signDataService/Reference.map | 7 + .../Web References/signDataService/SignerAPI.wsdl | 75 + .../Web References/signDataService/SignerAPI.xsd | 127 + .../ToBeSignedClientPKCS7BlobType.datasource | 10 + .../VerifySignedDataResponse.datasource | 10 + .../userManagementService/Reference.map | 7 + .../UserManagementService.wsdl | 126 + .../UserManagementService.xsd | 198 ++ .../veriSignCertIssuingService/Reference.cs | 1045 ++++++++ .../veriSignCertIssuingService/Reference.map | 16 + ...tSecurityTokenResponseCollectionType.datasource | 10 + .../RequestSecurityTokenResponseType.datasource | 10 + .../veriSignCertIssuingService/VS_WSTEP.xsd | 83 + .../certificateService.wsdl | 38 + .../oasis-200401-wss-wssecurity-secext-1.xsd | 187 ++ .../oasis-200401-wss-wssecurity-utility-1.xsd | 90 + .../veriSignCertIssuingService/ws-addr.xsd | 101 + .../ws-authorization.xsd | 30 + .../veriSignCertIssuingService/ws-policy.xsd | 64 + .../veriSignCertIssuingService/ws-trust-1.wsdl | 54 + .../veriSignCertIssuingService/ws-trust-1.xsd | 359 +++ .../veriSignCertIssuingService/xml.xsd | 270 +++ .../xmldsig-core-schema.xsd | 213 ++ utils/ipn_sqlclr/XmlReaderSpy.cs | 280 +++ utils/ipn_sqlclr/ipn_sqlclr.sqlproj | 130 + utils/ipn_sqlclr/keygen.cs | 212 ++ utils/ipn_tool/App.config | 6 + utils/ipn_tool/CheckSsvTest.cs | 170 ++ utils/ipn_tool/Program.cs | 301 +++ utils/ipn_tool/Properties/AssemblyInfo.cs | 35 + utils/ipn_tool/Watermarks.cs | 111 + utils/ipn_tool/ipn_tool.csproj | 63 + utils/ipn_tool/ipn_tool.sln | 22 + utils/x86disasm/Sconstruct-x86disasm | 93 + utils/x86disasm/disasm.cc | 295 +++ utils/x86disasm/disasm.h | 15 + utils/x86disasm/main.cc | 24 + utils/x86disasm/make-x86disasm.py | 59 + utils/x86disasm/x86disasm.sln | 26 + utils/x86disasm/x86disasm.vcxproj | 169 ++ utils/x86disasm/x86disasm.vcxproj.filters | 75 + 63 files changed, 11946 insertions(+) create mode 100644 utils/arm-32bit.py create mode 100644 utils/arm-thumb.py create mode 100644 utils/intel-x86.py create mode 100644 utils/ipn_sqlclr/LogItem.cs create mode 100644 utils/ipn_sqlclr/Taggant.cs create mode 100644 utils/ipn_sqlclr/TaggantWebService.cs create mode 100644 utils/ipn_sqlclr/VmpLicenseKey.cs create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/BulkUpdateCertificateStatusResponseType1.datasource create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.wsdl create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.xsd create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/Reference.cs create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/Reference.map create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/RequestKeyRecoveryResponseMessageType1.datasource create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/SearchCertificateResponseType1.datasource create mode 100644 utils/ipn_sqlclr/Web References/certificateManagementService/UpdateCertificateStatusResponseType1.datasource create mode 100644 utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.wsdl create mode 100644 utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.xsd create mode 100644 utils/ipn_sqlclr/Web References/policyService/Reference.cs create mode 100644 utils/ipn_sqlclr/Web References/policyService/Reference.map create mode 100644 utils/ipn_sqlclr/Web References/policyService/getPoliciesResponse.datasource create mode 100644 utils/ipn_sqlclr/Web References/signDataService/PrepSignDataResponse.datasource create mode 100644 utils/ipn_sqlclr/Web References/signDataService/Reference.cs create mode 100644 utils/ipn_sqlclr/Web References/signDataService/Reference.map create mode 100644 utils/ipn_sqlclr/Web References/signDataService/SignerAPI.wsdl create mode 100644 utils/ipn_sqlclr/Web References/signDataService/SignerAPI.xsd create mode 100644 utils/ipn_sqlclr/Web References/signDataService/ToBeSignedClientPKCS7BlobType.datasource create mode 100644 utils/ipn_sqlclr/Web References/signDataService/VerifySignedDataResponse.datasource create mode 100644 utils/ipn_sqlclr/Web References/userManagementService/Reference.map create mode 100644 utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.wsdl create mode 100644 utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.cs create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.map create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseCollectionType.datasource create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseType.datasource create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/VS_WSTEP.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/certificateService.wsdl create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-secext-1.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-utility-1.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-addr.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-authorization.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-policy.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.wsdl create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xml.xsd create mode 100644 utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xmldsig-core-schema.xsd create mode 100644 utils/ipn_sqlclr/XmlReaderSpy.cs create mode 100644 utils/ipn_sqlclr/ipn_sqlclr.sqlproj create mode 100644 utils/ipn_sqlclr/keygen.cs create mode 100644 utils/ipn_tool/App.config create mode 100644 utils/ipn_tool/CheckSsvTest.cs create mode 100644 utils/ipn_tool/Program.cs create mode 100644 utils/ipn_tool/Properties/AssemblyInfo.cs create mode 100644 utils/ipn_tool/Watermarks.cs create mode 100644 utils/ipn_tool/ipn_tool.csproj create mode 100644 utils/ipn_tool/ipn_tool.sln create mode 100644 utils/x86disasm/Sconstruct-x86disasm create mode 100644 utils/x86disasm/disasm.cc create mode 100644 utils/x86disasm/disasm.h create mode 100644 utils/x86disasm/main.cc create mode 100644 utils/x86disasm/make-x86disasm.py create mode 100644 utils/x86disasm/x86disasm.sln create mode 100644 utils/x86disasm/x86disasm.vcxproj create mode 100644 utils/x86disasm/x86disasm.vcxproj.filters (limited to 'utils') diff --git a/utils/arm-32bit.py b/utils/arm-32bit.py new file mode 100644 index 0000000..3be04be --- /dev/null +++ b/utils/arm-32bit.py @@ -0,0 +1,121 @@ +from idc import * +import sys +import binascii +from sets import Set +import sys +import re + +p_spaces = re.compile(r'(\s+)') + +# Apply fixes to IDA opcode +def ida_disasm_fix(insn_binary, insn_str): + # Remove extra spaces and tabs. Replace tabs with spaces + insn_str = p_spaces.sub(r' ', insn_str) + return insn_str + +def get_insn(ea, sz): + s = '' + for i in range(0, sz): + s += chr(Byte(ea + i)) + return s + +def insn_write(f, insn_binary, insn_str, header): + assert len(insn_binary) != 0 + s = '' + sz = len(insn_binary) + if header: + s += '{%d, "' % sz + for i in range(0, sz): + s += '\\x%02x' % ord(insn_binary[i]) + s += '", "' + insn_str + '"},\n' + else: + s += binascii.hexlify(insn_binary) + s += (' %s\n' % insn_str) + f.write(s) + f.flush() + +# Normalize operand (replace numeric operands with -1) +def normalize_operand(op_type, op_str): + if op_type in [o_mem, o_displ, o_imm, o_near, o_far]: + return "-1" + else: + return op_str + +def is_unique(set, ea): + ot1 = GetOpType(ea, 0) + ot2 = GetOpType(ea, 1) + ot3 = GetOpType(ea, 2) + v1 = GetOpnd(ea, 0) + v2 = GetOpnd(ea, 1) + v3 = GetOpnd(ea, 2) + mnem = GetMnem(ea) + hashstr = "%s|%s|%s|%s" % (mnem, + normalize_operand(ot1, v1), + normalize_operand(ot2, v2), + normalize_operand(ot3, v3)) + if hashstr in set: + return False + else: + set.add(hashstr) + return True + +def iteration(f, set, ea, n, data, prev_mnem): + PatchDword(ea, data) + sz = MakeCode(ea) + if sz == 0: + return (prev_mnem, n) + str = GetDisasm(ea) + mnem = GetMnem(ea) +# if prev_mnem != mnem: + # Opcode changed, purge cache set +# set.clear() + prev_mnem = mnem + # Now we got disasm + # Remove comments + pos = str.find(';') + if pos != -1: + str = str[0:pos] + # Remove spaces at start and end + str = str.strip(' ') + if str == '': + return (prev_mnem, n) + if not is_unique(set, ea): + return (prev_mnem, n) + insn_binary = get_insn(ea, sz) + # Add unique disasms to file + str = ida_disasm_fix(insn_binary, str) + insn_write(f, insn_binary, str, False) + n += 1 + if n % 10000 == 0: + print '%d opcodes processed' % n + return (prev_mnem, n) + +def generate_arm32(filename): + set = Set() + ea = GetEntryPoint(GetEntryOrdinal(0)) + for i in range(0, 20): + PatchByte(ea + i, i) + f = open(filename, 'wt') + n = 0 + data = 0L + mnem = '' + # Do not enumerate highest 4 bits. + # Use only 0b1110 (AL) and 0b1111 (extended opcode encoding) + while data <= 0x1fffffff: + data2 = (data & 0xfffffff) + if (data & 0x10000000) == 0: + data2 |= 0xe0000000 + else: + data2 |= 0xf0000000 + (mnem, n) = iteration(f, set, ea, n, data2, mnem) + data += 1 + f.close() + print 'Finished' + +def main(): + generate_arm32("./arm32-opcodes.txt") + +if __name__ == "__main__": + main() + + diff --git a/utils/arm-thumb.py b/utils/arm-thumb.py new file mode 100644 index 0000000..fed9386 --- /dev/null +++ b/utils/arm-thumb.py @@ -0,0 +1,122 @@ +from idc import * +import sys +import binascii +from sets import Set +import sys +import re + +p_spaces = re.compile(r'(\s+)') + +# Apply fixes to IDA opcode +def ida_disasm_fix(insn_binary, insn_str): + # Remove extra spaces and tabs. Replace tabs with spaces + insn_str = p_spaces.sub(r' ', insn_str) + return insn_str + +def get_insn(ea, sz): + s = '' + for i in range(0, sz): + s += chr(Byte(ea + i)) + return s + +def insn_write(f, insn_binary, insn_str, header): + assert len(insn_binary) != 0 + s = '' + sz = len(insn_binary) + if header: + s += '{%d, "' % sz + for i in range(0, sz): + s += '\\x%02x' % ord(insn_binary[i]) + s += '", "' + insn_str + '"},\n' + else: + s += binascii.hexlify(insn_binary) + s += (' %s\n' % insn_str) + f.write(s) + f.flush() + +# Normalize operand (replace numeric operands with -1) +def normalize_operand(op_type, op_str): + if op_type in [o_mem, o_displ, o_imm, o_near, o_far]: + return "-1" + else: + return op_str + +def is_unique(set, ea): + ot1 = GetOpType(ea, 0) + ot2 = GetOpType(ea, 1) + ot3 = GetOpType(ea, 2) + v1 = GetOpnd(ea, 0) + v2 = GetOpnd(ea, 1) + v3 = GetOpnd(ea, 2) + mnem = GetMnem(ea) + hashstr = "%s|%s|%s|%s" % (mnem, + normalize_operand(ot1, v1), + normalize_operand(ot2, v2), + normalize_operand(ot3, v3)) + if hashstr in set: + return False + else: + set.add(hashstr) + return True + +def iteration(f, set, ea, n, data, prev_mnem): + PatchDword(ea, data) + sz = MakeCode(ea) + if sz == 0: + return (prev_mnem, n) + str = GetDisasm(ea) + mnem = GetMnem(ea) + if prev_mnem != mnem: + # Opcode changed, purge cache set + set.clear() + prev_mnem = mnem + # Now we got disasm + # Remove comments + pos = str.find(';') + if pos != -1: + str = str[0:pos] + # Remove spaces at start and end + str = str.strip(' ') + if str == '': + return (prev_mnem, n) + if not is_unique(set, ea): + return (prev_mnem, n) + insn_binary = get_insn(ea, sz) + # Add unique disasms to file + str = ida_disasm_fix(insn_binary, str) + insn_write(f, insn_binary, str, False) + n += 1 + if n % 1000 == 0: + print '%d opcodes processed' % n + return (prev_mnem, n) + +def generate_arm_thumb(filename): + set = Set() + ea = GetEntryPoint(GetEntryOrdinal(0)) + for i in range(0, 20): + PatchByte(ea + i, i) + f = open(filename, 'wt') + data = 0L + mnem = '' + data = 0 + n = 0 + while data <= 0xffff: + prefix = data >> (32 - 5) + if prefix in [0x1d, 0x1e, 0x1f]: + data2 = 0 + while data2 <= 0xffff: + (mnem, n) = iteration(f, set, ea, n, data | (data2 << 16), mnem) + data2 += 1 + else: + mnem = iteration(f, set, ea, n, data | 0xffff0000, mnem) + data += 1 + f.close() + print 'Finished' + +def main(): + generate_arm_thumb("./thumb-opcodes.txt") + +if __name__ == "__main__": + main() + + diff --git a/utils/intel-x86.py b/utils/intel-x86.py new file mode 100644 index 0000000..a9a3a66 --- /dev/null +++ b/utils/intel-x86.py @@ -0,0 +1,283 @@ +from idc import * +import sys +import binascii +from sets import Set +import sys +import re + +def replace_farptr(matchobj): + s1 = matchobj.group() + return s1.replace('far ptr ', '') + +def replace_ptr(matchobj): + s1 = matchobj.group() + pos = s1.rfind(' ') + assert pos != -1 + return s1[0:pos] + ' [' + s1[pos+1:] + ']' + +def replace_ptr2(matchobj): + s1 = matchobj.group() + pos = s1.rfind(':') + assert pos != -1 + return s1[0:pos+1] + '[' + s1[pos+1:] + ']' + +def replace_hex(matchobj): + nstr = matchobj.group() + assert not (nstr in ['ah', 'bh', 'ch', 'dh']) + nstr = nstr.replace('h', '') + return nstr + +def repl(matchobj): + s1 = matchobj.group() + s2 = s1.replace(' ', '') + pos1 = s2.find('[') + pos2 = s2.find(']') + if pos1 == -1 or pos2 == -1: + return s1 + nstr = s2[0:pos1] + nstr = nstr.replace('h', '') + num = int(nstr, 16) + hex = "%08x" % num + s3 = s2[pos1:pos2] + '+' + hex + ']' + return s3 + +p_seg = re.compile(r'(es:|ds:|cs:|fs:|gs:|ss:)') +p_seg_abs = re.compile(r'(es:|ds:|cs:|fs:|gs:|ss:)[0-9][0-9a-fA-F]*h') +p_farptr = re.compile(r'far\sptr\s[0-9a-fA-F]+:[0-9a-fA-F]+') +p_ptr = re.compile(r'(byte|word|dword|qword|oword|fword)\sptr\s[0-9][0-9a-fA-F]*') +p_ptr2 = re.compile(r'(byte|word|dword|qword|oword|fword)\sptr\s(es:|ds:|cs:|fs:|gs:|ss:)[0-9][0-9a-fA-F]*') +p_hex = re.compile(r'([0-9][0-9a-fA-F]*)(h|H)') +p_spaces = re.compile(r'(\s+)') +p_repl = re.compile(r'[0-9][0-9a-fA-F]*(h|H)\s*\[[^\]]+\]') + +replacements = [('retn', 'ret'), ('retnw', 'ret'), ('iretw', 'iret'), ('retfw', 'retf'), + ('pushfw', 'pushf'), ('popfw', 'popf'), ('pushaw', 'pusha'), + ('popaw', 'popa'), ('enterw', 'enter'), ('enterw', 'enter'), + ('cmova', 'cmovnbe'), ('cmovg', 'cmovnle'), ('cmovge', 'cmovnl'), + ('leavew', 'leave'), + ('int 3', 'int 03')] + +def is_invalid_insn(insn_binary): + k = 0 + while True: + b = ord(insn_binary[k]) + if not(b == 0x26 or b == 0x2e or b == 0x36 or b == 0x3e or b == 0x64 or b == 0x65): + break + k += 1 + if k >= len(insn_binary) - 1: + return True + b = ord(insn_binary[k]) + b2 = ord(insn_binary[k + 1]) + if b == 0x0f and (b2 == 0x19 or b2 == 0x24 or b2 == 0x26 or b2 == 0xa6 or b2 == 0xa7): + return True + if b == 0xcd and b2 == 0x20: #vxdcall + return True + if b == 0xd6: #setalc + return True + if b == 0x0f and b2 == 0x0d: + if k > len(insn_binary) - 2: + return True + if ord(insn_binary[k + 2]) == 0x13: + return True + return False + +# Miscellaneous replacements +def misc_replacements(opcode_str): + for r_from, r_to in replacements: + if opcode_str == r_from: + opcode_str = r_to + return opcode_str + +def remove_ds_prefix(insn_binary, rest_str): + pos = insn_binary.find('\x3e') + # No prefix - remove ds: + if -1 == pos: + return -1 != rest_str.find('ds:') + if pos == 0: + return True + ds_prefix = True + for i in range(0, pos): + if not (ord(insn_binary[i]) in [0x66, 0x67, 0xF0, 0xF2, 0xF3]): + ds_prefix = False + break + if ds_prefix: + return True + else: + # No prefix - remove ds + return -1 != rest_str.find('ds:') + +def replace_ds_seg(matchobj): + nstr = matchobj.group() + if nstr[0:2].lower() == 'ds': + return '[' + nstr[3:] + ']' + else: + return nstr[0:3] + '[' + nstr[3:] + ']' + +def replace_seg(matchobj): + nstr = matchobj.group() + if nstr[0:2].lower() == 'ds': + return '[' + nstr[3:] + ']' + else: + return nstr[0:3] + '[' + nstr[3:] + ']' + +def replace_lea_seg(matchobj): + nstr = matchobj.group() + return '[' + nstr[3:] + ']' + +def replace_segments(insn_binary, opcode_str, rest_str): + # Remove segments from LEA (for absolute and relative offsets) + if opcode_str.lower() == 'lea': + tmp = p_seg_abs.sub(replace_lea_seg, rest_str) + if tmp == rest_str: + return p_seg.sub('', rest_str) + else: + return tmp + # Now search for ?s:01020304, replace to ?s:[01020304] except of ds: -> [01020304] + if remove_ds_prefix(insn_binary, rest_str): + return p_seg_abs.sub(replace_ds_seg, rest_str) + else: + return p_seg_abs.sub(replace_seg, rest_str) + +# Apply fixes to IDA opcode +def ida_disasm_fix(insn_binary, insn_str): + # Remove extra spaces and tabs. Replace tabs with spaces + insn_str = p_spaces.sub(r' ', insn_str) + # Avoid opcode changing + pos = insn_str.find(' ') + if pos == -1: + return misc_replacements(insn_str) # This is opcode like 'cli' + opcode_str = insn_str[0:pos] + rest_str = insn_str[pos+1:] + # remove 'small' + rest_str = rest_str.replace('small ', '') + # Transform '6050403[eax], al' to '[eax+6050403], al' + rest_str = p_repl.sub(repl, rest_str) + rest_str = replace_segments(insn_binary, opcode_str, rest_str) + # Remove 'ds:' if no 3Eh prefix found + if remove_ds_prefix(insn_binary, rest_str): + rest_str = rest_str.replace('ds:', '') + # Replace 'xmmword' to 'oword' + rest_str = rest_str.replace('xmmword', 'oword') + # Remove 'h' after hex constants + rest_str = p_hex.sub(replace_hex, rest_str) + # Transform 'ptr 012345' -> 'ptr [012345]' + rest_str = p_ptr.sub(replace_ptr, rest_str) + rest_str = p_ptr2.sub(replace_ptr2, rest_str) + # Transform 'call far ptr 1817:16151413' -> 'call 1817:16151413' + rest_str = p_farptr.sub(replace_farptr, rest_str) + opcode_str = misc_replacements(opcode_str) + return opcode_str + ' ' + rest_str + +def get_insn(ea, len): + s = '' + for i in range(0, len): + s += chr(Byte(ea + i)) + return s + +def insn_write(f, insn_binary, insn_str, header): + assert len(insn_binary) != 0 + s = '' + sz = len(insn_binary) + if header: + s += '{%d, "' % sz + for i in range(0, sz): + s += '\\x%02x' % ord(insn_binary[i]) + s += '", "' + insn_str + '"},\n' + else: + s += binascii.hexlify(insn_binary) + s += (' %s\n' % insn_str) + f.write(s) + f.flush() + +# Normalize operand (replace numeric operands with -1) +def normalize_operand(op_type, op_str): + if op_type in [o_mem, o_displ, o_imm, o_near, o_far]: + return "-1" + else: + return op_str + +def is_unique(set, ea, insn_str, mnem): + # Consider undisassemblable opcodes as unique + if insn_str[0:2].lower() == 'db': + return True + ot1 = GetOpType(ea, 0) + ot2 = GetOpType(ea, 1) + ot3 = GetOpType(ea, 2) + v1 = GetOpnd(ea, 0) + v2 = GetOpnd(ea, 1) + v3 = GetOpnd(ea, 2) + hashstr = "%s|%s|%s|%s" % (mnem, + normalize_operand(ot1, v1), + normalize_operand(ot2, v2), + normalize_operand(ot3, v3)) + if hashstr in set: + return False + else: + set.add(hashstr) + return True + +def generate_x86(filename): + set = Set() + ea = GetEntryPoint(GetEntryOrdinal(0)) + for i in range(0, 20): + PatchByte(ea + i, i + 0x10) + flog = open(filename + '.log', 'wt') + f = open(filename, 'wt') + n = 0 + len = 0 + for p0 in range(0x10, 0x110): + q0 = p0 & 0xff + set.clear() # Clear cached of opcodes (they become unrelevant) + PatchByte(ea, q0) + for p1 in range(0x10, 0x110): + q1 = p1 & 0xff + PatchByte(ea + 1, q1) + for p2 in range(0x10, 0x110): + q2 = p2 & 0xff + PatchByte(ea + 2, q2) + len = MakeCode(ea) + str = GetDisasm(ea) + mnem = GetMnem(ea) + # Now we got disasm + # Remove comments + pos = str.find(';') + if pos != -1: + str = str[0:pos] + # Remove spaces at start and end + str = str.strip(' ') + if str[0:2] == 'db' or str == '' or len == 0: + insn_binary = get_insn(ea, 10) + flog.write('INPUT hex: %20s; disasm: "%s"\n' % (binascii.hexlify(insn_binary), str)) + insn_write(f, insn_binary, 'db', False) + flog.write('\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOUTPUT disasm: "db"\n') + continue + if not is_unique(set, ea, str, mnem): + continue + insn_binary = get_insn(ea, len) + flog.write('INPUT hex: %20s; disasm: "%s"\n' % (binascii.hexlify(insn_binary), str)) + if is_invalid_insn(insn_binary): + flog.write('*** Skipping invalid opcode ***') + continue + # Add unique disasms to file + str = ida_disasm_fix(insn_binary, str) + flog.write('\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOUTPUT disasm: "%s"\n' % str) + flog.flush() + insn_write(f, insn_binary, str, False) + n += 1 + if n % 1000 == 0: + print '%d opcodes processed' % n + if len == 2 or len == 1: + break # Optimization: break if third byte does not matter + if len == 1: + break # Optimization: break if second byte does not matter + f.close() + flog.write('Finished\n') + flog.close() + +def main(): + generate_x86("./intel-x86-opcodes.txt") + +if __name__ == "__main__": + main() + + diff --git a/utils/ipn_sqlclr/LogItem.cs b/utils/ipn_sqlclr/LogItem.cs new file mode 100644 index 0000000..d6fbcf9 --- /dev/null +++ b/utils/ipn_sqlclr/LogItem.cs @@ -0,0 +1,11 @@ +using System.Xml; + +namespace ipn_sqlclr +{ + public class LogItem + { + public int MsgId { get; set; } + public XmlDocument[] Xml { get; set; } + public string[] P { get; set; } + } +} diff --git a/utils/ipn_sqlclr/Taggant.cs b/utils/ipn_sqlclr/Taggant.cs new file mode 100644 index 0000000..c989252 --- /dev/null +++ b/utils/ipn_sqlclr/Taggant.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Data.SqlTypes; +using System.IO; +using System.Security.Cryptography.X509Certificates; +using System.Xml; +using Microsoft.SqlServer.Server; +using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto.Generators; +using Org.BouncyCastle.OpenSsl; +using Org.BouncyCastle.Security; +using System.Linq; + +namespace ipn_sqlclr +{ + public class TaggantConfig : Dictionary + { + public X509Certificate ClientCertificate { get; set; } + } + public partial class UserDefinedFunctions + { + public static X509Certificate LocateCertificate(string subjectName) + { + var certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine); + certStore.Open(OpenFlags.ReadOnly); + X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindBySubjectName, subjectName, true); + certStore.Close(); + + if (0 == certCollection.Count) + { + throw new ArgumentException(string.Format("No valid client certificate found at LocalMachine.My by SubjectName '{0}'", subjectName), "subjectName"); + } + if (1 == certCollection.Count) + { + return certCollection[0]; + } + throw new ArgumentException(string.Format("More than one client certificate found at LocalMachine.My by SubjectName '{0}'", subjectName), "subjectName"); + + } + public static TaggantConfig GetTaggantConfig(SqlInt32 taggantConfigId) + { + var config = new TaggantConfig(); + using (var conn = new SqlConnection("context connection=true")) + { + conn.Open(); + var readConfigCmd = conn.CreateCommand(); + readConfigCmd.Parameters.Add(new SqlParameter("@taggantConfigId", taggantConfigId.Value)); + readConfigCmd.CommandText = + "SELECT Name, Value FROM dbo.TaggantConfig WHERE ID=@taggantConfigId"; + using (var reader = readConfigCmd.ExecuteReader()) + { + while(reader.Read()) + { + config[reader.GetString(0)] = reader[1] as string; + } + } + } + config.ClientCertificate = LocateCertificate(config["ClientCertificate"]); + return config; + } + + [SqlFunction] + public static SqlString TaggantPrivateKeyGenerateNew() + { + var g = new RsaKeyPairGenerator(); + g.Init(new KeyGenerationParameters(new SecureRandom(), 2048)); + var pair = g.GenerateKeyPair(); + + using (var sw = new StringWriter()) + { + new PemWriter(sw).WriteObject(pair); + sw.Flush(); + return new SqlString(sw.ToString()); + } + } + + [SqlProcedure] + public static int TaggantCertRevoke(SqlInt32 taggantConfigId, SqlInt32 customerId) + { + var tc = GetTaggantConfig(taggantConfigId); + var log = new List(); + try + { + string mail; + using (var conn = new SqlConnection("context connection=true")) + { + conn.Open(); + var readCustomerCmd = conn.CreateCommand(); + readCustomerCmd.Parameters.Add(new SqlParameter("@CustomerID", customerId.Value)); + readCustomerCmd.CommandText = + "SELECT EMail FROM dbo.Customer WHERE ID=@CustomerID"; + using (var reader = readCustomerCmd.ExecuteReader()) + { + if (reader.Read()) + { + mail = reader[0] as string; + } + else + { + throw new ArgumentException("Customer not found", "customerId"); + } + if (string.IsNullOrWhiteSpace(mail)) + throw new InvalidOperationException("Customer EMail is not set"); + } + } + log.Add(new LogItem { MsgId = 1033, P = new[] { customerId.ToString(), tc["CertificateProfileOid"] } }); + + TaggantWebService.CertRevoke(tc, mail, log); + return 0; + } + catch (Exception ex) + { + log.Add(new LogItem { MsgId = 15, P = new[] { ex.Source, ex.Message, ex.StackTrace } }); + throw; + } + finally + { + FlushLog("TaggantCertRevoke", new SqlInt32(2), customerId, log); + } + } + + [SqlProcedure] + public static int TaggantCertEnsure(SqlInt32 taggantConfigId, SqlInt32 customerId) + { + var tc = GetTaggantConfig(taggantConfigId); + var log = new List(); + var id = "ipn" + customerId.Value; + string taggantCert = null; + try + { + string mail; + string privateKey; + using (var conn = new SqlConnection("context connection=true")) + { + conn.Open(); + var readCustomerCmd = conn.CreateCommand(); + readCustomerCmd.Parameters.Add(new SqlParameter("@CustomerID", customerId.Value)); + readCustomerCmd.CommandText = + "SELECT EMail, PrivateKeyCert, TaggantCert FROM dbo.Customer WHERE ID=@CustomerID"; + using (var reader = readCustomerCmd.ExecuteReader()) + { + if (reader.Read()) + { + mail = reader[0] as string; + privateKey = reader[1] as string; + taggantCert = reader[2] as string; + } + else + { + throw new ArgumentException("Customer not found", "customerId"); + } + if (string.IsNullOrWhiteSpace(mail)) + throw new InvalidOperationException("Customer EMail is not set"); + if (string.IsNullOrWhiteSpace(privateKey)) + throw new InvalidOperationException("Customer PrivateKeyCert is not set"); + if (!string.IsNullOrWhiteSpace(taggantCert)) + return 0; // ensured + } + } + log.Add(new LogItem { MsgId = 14, P = new[] { customerId.ToString(), mail, tc["CertificateProfileOid"] } }); + + taggantCert = TaggantWebService.CertRequestNew(tc, id, mail, privateKey, log); + using (var conn = new SqlConnection("context connection=true")) + { + conn.Open(); + var writeCustomerCmd = conn.CreateCommand(); + writeCustomerCmd.Parameters.Add(new SqlParameter("@CustomerID", customerId.Value)); + writeCustomerCmd.Parameters.Add(new SqlParameter("@TaggantCert", taggantCert)); + writeCustomerCmd.CommandText = + "UPDATE dbo.Customer SET TaggantCert=@TaggantCert WHERE ID=@CustomerID"; + writeCustomerCmd.ExecuteNonQuery(); + } + return 1; // created new + } + catch (Exception ex) + { + log.Add(new LogItem { MsgId = 15, P = new[] { ex.Source, ex.Message, ex.StackTrace, taggantCert } }); + throw; + } + finally + { + FlushLog("TaggantCertEnsure", new SqlInt32(2), customerId, log); + } + } + + private static void FlushLog(string src, SqlInt32 refKindId, SqlInt32 refId, IEnumerable log) + { + using (var conn = new SqlConnection("context connection=true")) + { + conn.Open(); + foreach (var li in log) + { + var insLogCmd = conn.CreateCommand(); + insLogCmd.Parameters.Add(new SqlParameter("@RefKindID", refKindId)); + insLogCmd.Parameters.Add(new SqlParameter("@RefID", refId)); + insLogCmd.Parameters.Add(new SqlParameter("@MsgID", li.MsgId)); + int i; + for (i = 0; i < 2; i++) + { + insLogCmd.Parameters.Add( + new SqlParameter(string.Format("@xml{0}", i), SqlDbType.Xml) + { + Value = (li.Xml == null || li.Xml[i] == null) + ? DBNull.Value + : (object)new SqlXml(new XmlTextReader(li.Xml[i].InnerXml, XmlNodeType.Document, null)) + }); + } + insLogCmd.Parameters.Add(new SqlParameter("@P0", src)); + i = 1; + foreach (var p in li.P) + { + insLogCmd.Parameters.Add(new SqlParameter(string.Format("@P{0}", i++), p)); + } + for (; i <= 8; i++) + { + insLogCmd.Parameters.Add(new SqlParameter(string.Format("@P{0}", i), DBNull.Value)); + } + + insLogCmd.CommandText = + "INSERT dbo.Log(RefID, RefKindID, MsgID, xml, xml2, P0, P1, P2, P3, P4, P5, P6, P7, P8)" + + " VALUES(@RefID, @RefKindID, @MsgID, @xml0, @xml1, @P0, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8)"; + + insLogCmd.ExecuteNonQuery(); + } + } + } + + [SqlProcedure] + public static SqlInt32 TaggantGetPolicies(SqlInt32 taggantConfigId) + { + var tc = GetTaggantConfig(taggantConfigId); + var log = new List(); + try + { + var meta = new[] + { + new SqlMetaData("defaultName", SqlDbType.NVarChar, -1), + new SqlMetaData("groupId", SqlDbType.Int), + new SqlMetaData("oIdReferenceId", SqlDbType.Int), + new SqlMetaData("certificateProfileId", SqlDbType.NVarChar, -1) + }; + SqlDataRecord[] records = TaggantWebService.GetPolicies(tc, log).Select(x => + { + var r = new SqlDataRecord(meta); + r.SetSqlString(0, x.defaultName); + r.SetSqlInt32(1, (int)x.group); + r.SetSqlInt32(2, x.oIDReferenceID); + r.SetSqlString(3, x.value); + return r; + }).ToArray(); + + if (SqlContext.Pipe != null) + { + SqlContext.Pipe.SendResultsStart(new SqlDataRecord(meta)); + foreach (var r in records) + SqlContext.Pipe.SendResultsRow(r); + SqlContext.Pipe.SendResultsEnd(); + } + return records.Length; + } + catch (Exception ex) + { + log.Add(new LogItem { MsgId = 15, P = new[] { ex.Source, ex.Message, ex.StackTrace } }); + throw; + } + finally + { + FlushLog("TaggantGetPolicies", new SqlInt32(), new SqlInt32(), log); + } + } + } +} diff --git a/utils/ipn_sqlclr/TaggantWebService.cs b/utils/ipn_sqlclr/TaggantWebService.cs new file mode 100644 index 0000000..e4157e7 --- /dev/null +++ b/utils/ipn_sqlclr/TaggantWebService.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using certificateManagementService; +using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.OpenSsl; +using Org.BouncyCastle.Pkcs; +using Org.BouncyCastle.Security; +using Org.BouncyCastle.X509; +using policyService; +using veriSignCertIssuingService; +using ItemChoiceType = certificateManagementService.ItemChoiceType; + +namespace ipn_sqlclr +{ + public static class TaggantWebService + { + public static void CertRevoke(TaggantConfig tc, string id, List log) + { + var es = new certificateManagementService.certificateManagementService(tc.ClientCertificate, tc["ManagementUrl"]); + try + { + var updateCertificateStatusRequest = new UpdateCertificateStatusRequestType + { + clientTransactionID = "ipn_sqlclr " + new SecureRandom().Next(), + operationType = OperationTypeEnum.Revoke, + revocationReasonSpecified = false, + ItemElementName = ItemChoiceType.seatId, + Item = id, + //certificateIssuer = "?", + //challenge = "?", + //comment = "?", + version = tc["ManagementVersion"] + }; + /*var updateResponse =*/ es.updateCertificateStatus(updateCertificateStatusRequest); + } + finally + { + LogXml("updateCertificateStatus", es, log); + } + } + public static string CertRequestNew(TaggantConfig tc, string id, string mail, string privateKey, List log) + { + var csr = CreateCsr(tc, privateKey); + log.Add(new LogItem {MsgId = 16, P = new[] {csr}}); + + var es = new veriSignCertIssuingService.veriSignCertIssuingService(tc.ClientCertificate, tc["EnrollmentUrl"]); + try + { + var requestSecurityTokenType = new RequestSecurityTokenType + { + Item = new RequestVSSecurityTokenEnrollmentType + { + clientTransactionID = "ipn_sqlclr " + new SecureRandom().Next(), + certificateProfileID = tc["CertificateProfileOid"], + requestType = RequestTypeEnum.httpdocsoasisopenorgwssxwstrust200512Issue, + version = tc["EnrollVersion"], + tokenType = TokenType.httpdocsoasisopenorgwss200401oasis200401wssx509tokenprofile10PKCS7, + binarySecurityToken = new[] + { + new BinarySecurityTokenType + { + ValueType = "http://schemas.verisign.com/pkiservices/2009/07/PKCS10", + EncodingType = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#base64binary", + Value = csr + } + }, + nameValuePair = new[] + { + new NameValueType {name = "seat_id", value = mail}, + new NameValueType {name = "common_name", value = string.Format("VMProtect Client {0}", id)}, + new NameValueType {name = "mail_lastName", value = "Client"}, + new NameValueType {name = "mail_firstName", value = string.Format("{0} VMProtect", id)}, + new NameValueType {name = "emailAddress", value = mail}, + new NameValueType {name = "mail_email", value = mail}, + new NameValueType {name = "country", value = "ru"} + } + } + }; + var enrollmentResponse = es.RequestSecurityToken(requestSecurityTokenType); + var certs = ((AttributedString)(enrollmentResponse.Item.requestedVSSecurityToken.Items[0])).Value; + var certPkcs7 = Convert.FromBase64String(certs); + var parser = new X509CertificateParser(); + var cert = parser.ReadCertificate(certPkcs7); + using (var pw = new StringWriter()) + { + new PemWriter(pw).WriteObject(cert); + pw.Flush(); + return pw.ToString(); + } + } + finally + { + LogXml("RequestSecurityToken", es, log); + } + } + + private static string CreateCsr(TaggantConfig tc, string privateKey) + { + AsymmetricCipherKeyPair pair; + using (var reader = new StringReader(privateKey)) + pair = (AsymmetricCipherKeyPair) new PemReader(reader).ReadObject(); + + var csr = new Pkcs10CertificationRequest(tc["CsrAlgorithm"], new X509Name(tc["CsrSubject"]), pair.Public, null, pair.Private); + using (var pw = new StringWriter()) + { + new PemWriter(pw).WriteObject(csr); + pw.Flush(); + return pw.ToString(); + } + } + + public static IEnumerable GetPolicies(TaggantConfig tc, List log) + { + var ps = new policyService.policyService(tc.ClientCertificate, tc["PolicyUrl"]); + try + { + var rp = ps.requestPolicies(new getPolicies {version = tc["PolicyVersion"]}); + return rp.oIDs; + } + finally + { + LogXml("requestPolicies", ps, log); + } + } + + private static void LogXml(string src, XmlReaderSpyService ss, ICollection log) + { + var req = new XmlDocument(); + var resp = new XmlDocument(); + var reqs = ss.GetRequestXml(); + var resps = ss.GetResponseXml(); + try + { + req.LoadXml(reqs); + } + catch (Exception) + { + req = null; + } + try + { + resp.LoadXml(resps); + } + catch (Exception) + { + resp = null; + } + if (req != null && string.IsNullOrWhiteSpace(req.InnerXml)) + req = null; + if (resp != null && string.IsNullOrWhiteSpace(resp.InnerXml)) + resp = null; + if (!string.IsNullOrWhiteSpace(reqs) || !string.IsNullOrWhiteSpace(resps)) + log.Add(new LogItem {MsgId = 17, P = new[] {src, reqs, resps}, Xml = new[] {req, resp}}); + } + } +} diff --git a/utils/ipn_sqlclr/VmpLicenseKey.cs b/utils/ipn_sqlclr/VmpLicenseKey.cs new file mode 100644 index 0000000..2b0ec8a --- /dev/null +++ b/utils/ipn_sqlclr/VmpLicenseKey.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections; +using System.Data.SqlTypes; +using Microsoft.SqlServer.Server; + +namespace ipn_sqlclr +{ + public partial class UserDefinedFunctions + { + [SqlFunction] + public static SqlString VmpLicenseKeyGenerateNew(SqlInt32 productId, SqlString customerName, SqlString eMail, SqlDateTime maxBuildDt) + { + return new SqlString (Keygen.GenerateKey(productId.Value, customerName.Value, eMail.Value, maxBuildDt.Value)); + } + + [SqlFunction(FillRowMethodName = "FillRowVmpLicenseParseKey", + TableDefinition = "[productId] int,[customerName] nvarchar(max),[eMail] nvarchar(max),maxBuildDT datetime")] + public static IEnumerable VmpLicenseParseKey(String key) + { + yield return key; + } + + public static void FillRowVmpLicenseParseKey(Object obj, out SqlInt32 productId, out SqlString customerName, out SqlString eMail, out SqlDateTime maxBuildDt) + { + var key = (string)obj; + int productIdTmp; + string customerNameTmp, eMailTmp; + DateTime maxBuildDtTmp; + Keygen.ParseKey(key, out productIdTmp, out customerNameTmp, out eMailTmp, out maxBuildDtTmp); + productId = productIdTmp; + customerName = customerNameTmp; + eMail = eMailTmp; + maxBuildDt = maxBuildDtTmp; + } + } +} diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/BulkUpdateCertificateStatusResponseType1.datasource b/utils/ipn_sqlclr/Web References/certificateManagementService/BulkUpdateCertificateStatusResponseType1.datasource new file mode 100644 index 0000000..239ee25 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/BulkUpdateCertificateStatusResponseType1.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.certificateManagementService.BulkUpdateCertificateStatusResponseType, Web References.certificateManagementService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.wsdl b/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.wsdl new file mode 100644 index 0000000..6c27b2a --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.wsdl @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.xsd b/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.xsd new file mode 100644 index 0000000..d38f2f8 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/CertificateManagementService.xsd @@ -0,0 +1,187 @@ + + + + + XML Schema for + certificateManagementService Web Services + version 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.cs b/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.cs new file mode 100644 index 0000000..25ef2d8 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.cs @@ -0,0 +1,1639 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.34014. +// + +using System.Security.Cryptography.X509Certificates; +using ipn_sqlclr; + +#pragma warning disable 1591 + +namespace certificateManagementService { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="certificateManagementServiceSOAP", Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class certificateManagementService : XmlReaderSpyService + { + + private System.Threading.SendOrPostCallback updateCertificateStatusOperationCompleted; + + private System.Threading.SendOrPostCallback bulkUpdateCertificateStatusOperationCompleted; + + private System.Threading.SendOrPostCallback keyRecoveryOperationCompleted; + + private System.Threading.SendOrPostCallback searchCertificateOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public certificateManagementService(X509Certificate clientCert, string url) + : base(clientCert, url) + { + this.Url = url; + ClientCertificates.Add(clientCert); + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event updateCertificateStatusCompletedEventHandler updateCertificateStatusCompleted; + + /// + public event bulkUpdateCertificateStatusCompletedEventHandler bulkUpdateCertificateStatusCompleted; + + /// + public event keyRecoveryCompletedEventHandler keyRecoveryCompleted; + + /// + public event searchCertificateCompletedEventHandler searchCertificateCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/management/updateCertificateStatu" + + "s", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("updateCertificateStatusResponse", Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public UpdateCertificateStatusResponseType updateCertificateStatus([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] UpdateCertificateStatusRequestType updateCertificateStatusRequest) { + object[] results = this.Invoke("updateCertificateStatus", new object[] { + updateCertificateStatusRequest}); + return ((UpdateCertificateStatusResponseType)(results[0])); + } + + /// + public void updateCertificateStatusAsync(UpdateCertificateStatusRequestType updateCertificateStatusRequest) { + this.updateCertificateStatusAsync(updateCertificateStatusRequest, null); + } + + /// + public void updateCertificateStatusAsync(UpdateCertificateStatusRequestType updateCertificateStatusRequest, object userState) { + if ((this.updateCertificateStatusOperationCompleted == null)) { + this.updateCertificateStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnupdateCertificateStatusOperationCompleted); + } + this.InvokeAsync("updateCertificateStatus", new object[] { + updateCertificateStatusRequest}, this.updateCertificateStatusOperationCompleted, userState); + } + + private void OnupdateCertificateStatusOperationCompleted(object arg) { + if ((this.updateCertificateStatusCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.updateCertificateStatusCompleted(this, new updateCertificateStatusCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/management/bulkUpdateCertificateS" + + "tatus", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("bulkUpdateCertificateStatusResponse", Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public BulkUpdateCertificateStatusResponseType bulkUpdateCertificateStatus([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] BulkUpdateCertificateStatusRequestType bulkUpdateCertificateStatusRequest) { + object[] results = this.Invoke("bulkUpdateCertificateStatus", new object[] { + bulkUpdateCertificateStatusRequest}); + return ((BulkUpdateCertificateStatusResponseType)(results[0])); + } + + /// + public void bulkUpdateCertificateStatusAsync(BulkUpdateCertificateStatusRequestType bulkUpdateCertificateStatusRequest) { + this.bulkUpdateCertificateStatusAsync(bulkUpdateCertificateStatusRequest, null); + } + + /// + public void bulkUpdateCertificateStatusAsync(BulkUpdateCertificateStatusRequestType bulkUpdateCertificateStatusRequest, object userState) { + if ((this.bulkUpdateCertificateStatusOperationCompleted == null)) { + this.bulkUpdateCertificateStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnbulkUpdateCertificateStatusOperationCompleted); + } + this.InvokeAsync("bulkUpdateCertificateStatus", new object[] { + bulkUpdateCertificateStatusRequest}, this.bulkUpdateCertificateStatusOperationCompleted, userState); + } + + private void OnbulkUpdateCertificateStatusOperationCompleted(object arg) { + if ((this.bulkUpdateCertificateStatusCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.bulkUpdateCertificateStatusCompleted(this, new bulkUpdateCertificateStatusCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/management/keyRecovery", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("requestKeyRecoveryResponseMessage", Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public RequestKeyRecoveryResponseMessageType keyRecovery([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] RequestKeyRecoveryMessageType requestKeyRecoveryMessage) { + object[] results = this.Invoke("keyRecovery", new object[] { + requestKeyRecoveryMessage}); + return ((RequestKeyRecoveryResponseMessageType)(results[0])); + } + + /// + public void keyRecoveryAsync(RequestKeyRecoveryMessageType requestKeyRecoveryMessage) { + this.keyRecoveryAsync(requestKeyRecoveryMessage, null); + } + + /// + public void keyRecoveryAsync(RequestKeyRecoveryMessageType requestKeyRecoveryMessage, object userState) { + if ((this.keyRecoveryOperationCompleted == null)) { + this.keyRecoveryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnkeyRecoveryOperationCompleted); + } + this.InvokeAsync("keyRecovery", new object[] { + requestKeyRecoveryMessage}, this.keyRecoveryOperationCompleted, userState); + } + + private void OnkeyRecoveryOperationCompleted(object arg) { + if ((this.keyRecoveryCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.keyRecoveryCompleted(this, new keyRecoveryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/management/searchCertificate", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("searchCertificateResponse", Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public SearchCertificateResponseType searchCertificate([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] SearchCertificateRequestType searchCertificateRequest) { + object[] results = this.Invoke("searchCertificate", new object[] { + searchCertificateRequest}); + return ((SearchCertificateResponseType)(results[0])); + } + + /// + public void searchCertificateAsync(SearchCertificateRequestType searchCertificateRequest) { + this.searchCertificateAsync(searchCertificateRequest, null); + } + + /// + public void searchCertificateAsync(SearchCertificateRequestType searchCertificateRequest, object userState) { + if ((this.searchCertificateOperationCompleted == null)) { + this.searchCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsearchCertificateOperationCompleted); + } + this.InvokeAsync("searchCertificate", new object[] { + searchCertificateRequest}, this.searchCertificateOperationCompleted, userState); + } + + private void OnsearchCertificateOperationCompleted(object arg) { + if ((this.searchCertificateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.searchCertificateCompleted(this, new searchCertificateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class UpdateCertificateStatusRequestType { + + private string clientTransactionIDField; + + private string versionField; + + private string certificateIssuerField; + + private RevokeReasonCodeEnum revocationReasonField; + + private bool revocationReasonFieldSpecified; + + private string challengeField; + + private string commentField; + + private string itemField; + + private ItemChoiceType itemElementNameField; + + private OperationTypeEnum operationTypeField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + public string certificateIssuer { + get { + return this.certificateIssuerField; + } + set { + this.certificateIssuerField = value; + } + } + + /// + public RevokeReasonCodeEnum revocationReason { + get { + return this.revocationReasonField; + } + set { + this.revocationReasonField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool revocationReasonSpecified { + get { + return this.revocationReasonFieldSpecified; + } + set { + this.revocationReasonFieldSpecified = value; + } + } + + /// + public string challenge { + get { + return this.challengeField; + } + set { + this.challengeField = value; + } + } + + /// + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("certificateSerialNumber", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("seatId", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public string Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType ItemElementName { + get { + return this.itemElementNameField; + } + set { + this.itemElementNameField = value; + } + } + + /// + public OperationTypeEnum operationType { + get { + return this.operationTypeField; + } + set { + this.operationTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public enum RevokeReasonCodeEnum { + + /// + Unspecified, + + /// + KeyCompromise, + + /// + CACompromise, + + /// + AffiliationChanged, + + /// + CessationOfOperation, + + /// + PrivilegeWithdrawn, + + /// + AACompromise, + + /// + Superseded, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management", IncludeInSchema=false)] + public enum ItemChoiceType { + + /// + certificateSerialNumber, + + /// + seatId, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public enum OperationTypeEnum { + + /// + Revoke, + + /// + Suspend, + + /// + Resume, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class CertificateSearchResultType { + + private byte[] certificateField; + + private string seatIdField; + + private string commonNameField; + + private string accountIdField; + + private string profileOIDField; + + private string emailAddressField; + + private CertificateStatusEnum statusField; + + private long revokeAtField; + + private bool revokeAtFieldSpecified; + + private RevokeReasonCodeEnum revokeReasonField; + + private bool revokeReasonFieldSpecified; + + private long validFromField; + + private long validToField; + + private string serialNumberField; + + private bool isEscrowedField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] certificate { + get { + return this.certificateField; + } + set { + this.certificateField = value; + } + } + + /// + public string seatId { + get { + return this.seatIdField; + } + set { + this.seatIdField = value; + } + } + + /// + public string commonName { + get { + return this.commonNameField; + } + set { + this.commonNameField = value; + } + } + + /// + public string accountId { + get { + return this.accountIdField; + } + set { + this.accountIdField = value; + } + } + + /// + public string profileOID { + get { + return this.profileOIDField; + } + set { + this.profileOIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string emailAddress { + get { + return this.emailAddressField; + } + set { + this.emailAddressField = value; + } + } + + /// + public CertificateStatusEnum status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + public long revokeAt { + get { + return this.revokeAtField; + } + set { + this.revokeAtField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool revokeAtSpecified { + get { + return this.revokeAtFieldSpecified; + } + set { + this.revokeAtFieldSpecified = value; + } + } + + /// + public RevokeReasonCodeEnum revokeReason { + get { + return this.revokeReasonField; + } + set { + this.revokeReasonField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool revokeReasonSpecified { + get { + return this.revokeReasonFieldSpecified; + } + set { + this.revokeReasonFieldSpecified = value; + } + } + + /// + public long validFrom { + get { + return this.validFromField; + } + set { + this.validFromField = value; + } + } + + /// + public long validTo { + get { + return this.validToField; + } + set { + this.validToField = value; + } + } + + /// + public string serialNumber { + get { + return this.serialNumberField; + } + set { + this.serialNumberField = value; + } + } + + /// + public bool isEscrowed { + get { + return this.isEscrowedField; + } + set { + this.isEscrowedField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public enum CertificateStatusEnum { + + /// + VALID, + + /// + EXPIRED, + + /// + REVOKED, + + /// + SUSPENDED, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class SearchCertificateResponseType { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private int certificateCountField; + + private CertificateSearchResultType[] certificateListField; + + private bool moreCertificateAvailableField; + + private bool moreCertificateAvailableFieldSpecified; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public int certificateCount { + get { + return this.certificateCountField; + } + set { + this.certificateCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("certificateInformation", IsNullable=false)] + public CertificateSearchResultType[] certificateList { + get { + return this.certificateListField; + } + set { + this.certificateListField = value; + } + } + + /// + public bool moreCertificateAvailable { + get { + return this.moreCertificateAvailableField; + } + set { + this.moreCertificateAvailableField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool moreCertificateAvailableSpecified { + get { + return this.moreCertificateAvailableFieldSpecified; + } + set { + this.moreCertificateAvailableFieldSpecified = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class SearchCertificateRequestType { + + private string clientTransactionIDField; + + private string seatIdField; + + private string accountIdField; + + private string profileOIDField; + + private string commonNameField; + + private CertificateStatusEnum statusField; + + private bool statusFieldSpecified; + + private string emailAddressField; + + private string serialNumberField; + + private byte[] issuingCAField; + + private long validFromField; + + private bool validFromFieldSpecified; + + private long validToField; + + private bool validToFieldSpecified; + + private int startIndexField; + + private bool startIndexFieldSpecified; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string seatId { + get { + return this.seatIdField; + } + set { + this.seatIdField = value; + } + } + + /// + public string accountId { + get { + return this.accountIdField; + } + set { + this.accountIdField = value; + } + } + + /// + public string profileOID { + get { + return this.profileOIDField; + } + set { + this.profileOIDField = value; + } + } + + /// + public string commonName { + get { + return this.commonNameField; + } + set { + this.commonNameField = value; + } + } + + /// + public CertificateStatusEnum status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool statusSpecified { + get { + return this.statusFieldSpecified; + } + set { + this.statusFieldSpecified = value; + } + } + + /// + public string emailAddress { + get { + return this.emailAddressField; + } + set { + this.emailAddressField = value; + } + } + + /// + public string serialNumber { + get { + return this.serialNumberField; + } + set { + this.serialNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] issuingCA { + get { + return this.issuingCAField; + } + set { + this.issuingCAField = value; + } + } + + /// + public long validFrom { + get { + return this.validFromField; + } + set { + this.validFromField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool validFromSpecified { + get { + return this.validFromFieldSpecified; + } + set { + this.validFromFieldSpecified = value; + } + } + + /// + public long validTo { + get { + return this.validToField; + } + set { + this.validToField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool validToSpecified { + get { + return this.validToFieldSpecified; + } + set { + this.validToFieldSpecified = value; + } + } + + /// + public int startIndex { + get { + return this.startIndexField; + } + set { + this.startIndexField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool startIndexSpecified { + get { + return this.startIndexFieldSpecified; + } + set { + this.startIndexFieldSpecified = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class RequestKeyRecoveryResponseMessageType { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private int adminApprovalPendingCountField; + + private bool adminApprovalPendingCountFieldSpecified; + + private string pKCS12PasswordField; + + private string[] pKCS12MessageField; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public int adminApprovalPendingCount { + get { + return this.adminApprovalPendingCountField; + } + set { + this.adminApprovalPendingCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool adminApprovalPendingCountSpecified { + get { + return this.adminApprovalPendingCountFieldSpecified; + } + set { + this.adminApprovalPendingCountFieldSpecified = value; + } + } + + /// + public string pKCS12Password { + get { + return this.pKCS12PasswordField; + } + set { + this.pKCS12PasswordField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("pKCS12Message")] + public string[] pKCS12Message { + get { + return this.pKCS12MessageField; + } + set { + this.pKCS12MessageField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class RequestKeyRecoveryMessageType { + + private string clientTransactionIDField; + + private string pKCS12PasswordField; + + private string certificateSerialNumberField; + + private string certificateIssuerField; + + private string adminIDField; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string pKCS12Password { + get { + return this.pKCS12PasswordField; + } + set { + this.pKCS12PasswordField = value; + } + } + + /// + public string certificateSerialNumber { + get { + return this.certificateSerialNumberField; + } + set { + this.certificateSerialNumberField = value; + } + } + + /// + public string certificateIssuer { + get { + return this.certificateIssuerField; + } + set { + this.certificateIssuerField = value; + } + } + + /// + public string adminID { + get { + return this.adminIDField; + } + set { + this.adminIDField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class BulkUpdateCertificateStatusResponseType { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private string versionField; + + private int successCodeField; + + private string successMsgField; + + private int revocationCountField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + public int successCode { + get { + return this.successCodeField; + } + set { + this.successCodeField = value; + } + } + + /// + public string successMsg { + get { + return this.successMsgField; + } + set { + this.successMsgField = value; + } + } + + /// + public int revocationCount { + get { + return this.revocationCountField; + } + set { + this.revocationCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class BulkUpdateCertificateStatusRequestType { + + private string clientTransactionIDField; + + private string versionField; + + private RevokeReasonCodeEnum revocationReasonField; + + private bool revocationReasonFieldSpecified; + + private string commentField; + + private string[] itemsField; + + private ItemsChoiceType[] itemsElementNameField; + + private OperationTypeEnum operationTypeField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + public RevokeReasonCodeEnum revocationReason { + get { + return this.revocationReasonField; + } + set { + this.revocationReasonField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool revocationReasonSpecified { + get { + return this.revocationReasonFieldSpecified; + } + set { + this.revocationReasonFieldSpecified = value; + } + } + + /// + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("certificateSerialNumber", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("profileOID", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("seatId", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public string[] Items { + get { + return this.itemsField; + } + set { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType[] ItemsElementName { + get { + return this.itemsElementNameField; + } + set { + this.itemsElementNameField = value; + } + } + + /// + public OperationTypeEnum operationType { + get { + return this.operationTypeField; + } + set { + this.operationTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management", IncludeInSchema=false)] + public enum ItemsChoiceType { + + /// + certificateSerialNumber, + + /// + profileOID, + + /// + seatId, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/management")] + public partial class UpdateCertificateStatusResponseType { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private string versionField; + + private int successCodeField; + + private string successMsgField; + + private int revocationCountField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + public int successCode { + get { + return this.successCodeField; + } + set { + this.successCodeField = value; + } + } + + /// + public string successMsg { + get { + return this.successMsgField; + } + set { + this.successMsgField = value; + } + } + + /// + public int revocationCount { + get { + return this.revocationCountField; + } + set { + this.revocationCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void updateCertificateStatusCompletedEventHandler(object sender, updateCertificateStatusCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class updateCertificateStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal updateCertificateStatusCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public UpdateCertificateStatusResponseType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((UpdateCertificateStatusResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void bulkUpdateCertificateStatusCompletedEventHandler(object sender, bulkUpdateCertificateStatusCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class bulkUpdateCertificateStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal bulkUpdateCertificateStatusCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public BulkUpdateCertificateStatusResponseType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((BulkUpdateCertificateStatusResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void keyRecoveryCompletedEventHandler(object sender, keyRecoveryCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class keyRecoveryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal keyRecoveryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RequestKeyRecoveryResponseMessageType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RequestKeyRecoveryResponseMessageType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void searchCertificateCompletedEventHandler(object sender, searchCertificateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class searchCertificateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal searchCertificateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SearchCertificateResponseType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SearchCertificateResponseType)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.map b/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.map new file mode 100644 index 0000000..fea64f8 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/RequestKeyRecoveryResponseMessageType1.datasource b/utils/ipn_sqlclr/Web References/certificateManagementService/RequestKeyRecoveryResponseMessageType1.datasource new file mode 100644 index 0000000..d971d87 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/RequestKeyRecoveryResponseMessageType1.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.certificateManagementService.RequestKeyRecoveryResponseMessageType, Web References.certificateManagementService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/SearchCertificateResponseType1.datasource b/utils/ipn_sqlclr/Web References/certificateManagementService/SearchCertificateResponseType1.datasource new file mode 100644 index 0000000..128e0e4 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/SearchCertificateResponseType1.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.certificateManagementService.SearchCertificateResponseType, Web References.certificateManagementService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/certificateManagementService/UpdateCertificateStatusResponseType1.datasource b/utils/ipn_sqlclr/Web References/certificateManagementService/UpdateCertificateStatusResponseType1.datasource new file mode 100644 index 0000000..53bc7ff --- /dev/null +++ b/utils/ipn_sqlclr/Web References/certificateManagementService/UpdateCertificateStatusResponseType1.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.certificateManagementService.UpdateCertificateStatusResponseType, Web References.certificateManagementService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.wsdl b/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.wsdl new file mode 100644 index 0000000..2c51dd3 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.wsdl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.xsd b/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.xsd new file mode 100644 index 0000000..6e58e09 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/policyService/CertificateEnrollmentPolicy.xsd @@ -0,0 +1,388 @@ + + + + + XML Schema for policyService Web Services + version 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/policyService/Reference.cs b/utils/ipn_sqlclr/Web References/policyService/Reference.cs new file mode 100644 index 0000000..a6973d8 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/policyService/Reference.cs @@ -0,0 +1,2512 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.34014. +// + +using System.Security.Cryptography.X509Certificates; +using System.Xml; +using ipn_sqlclr; + +#pragma warning disable 1591 + +namespace policyService { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="requestPoliciesServiceSOAP", Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class policyService : XmlReaderSpyService + { + + private System.Threading.SendOrPostCallback requestPoliciesOperationCompleted; + + /// + public policyService(X509Certificate clientCert, string url) : base(clientCert, url) + { + } + + /// + public event requestPoliciesCompletedEventHandler requestPoliciesCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/policy/requestPolicies", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("getPoliciesResponse", Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public getPoliciesResponse requestPolicies([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] getPolicies getPolicies) { + object[] results = this.Invoke("requestPolicies", new object[] { + getPolicies}); + return ((getPoliciesResponse)(results[0])); + } + + /// + public void requestPoliciesAsync(getPolicies getPolicies) { + this.requestPoliciesAsync(getPolicies, null); + } + + /// + public void requestPoliciesAsync(getPolicies getPolicies, object userState) { + if ((this.requestPoliciesOperationCompleted == null)) { + this.requestPoliciesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnrequestPoliciesOperationCompleted); + } + this.InvokeAsync("requestPolicies", new object[] { + getPolicies}, this.requestPoliciesOperationCompleted, userState); + } + + private void OnrequestPoliciesOperationCompleted(object arg) { + if ((this.requestPoliciesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.requestPoliciesCompleted(this, new requestPoliciesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class getPolicies { + + private string versionField; + + private string clientTransactionIDField; + + private Client clientField; + + private RequestFilter requestFilterField; + + private bool signResponseField; + + private bool signResponseFieldSpecified; + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public Client client { + get { + return this.clientField; + } + set { + this.clientField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public RequestFilter requestFilter { + get { + return this.requestFilterField; + } + set { + this.requestFilterField = value; + } + } + + /// + public bool signResponse { + get { + return this.signResponseField; + } + set { + this.signResponseField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool signResponseSpecified { + get { + return this.signResponseFieldSpecified; + } + set { + this.signResponseFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class Client { + + private System.Nullable lastUpdatetimeField; + + private string preferredLanguageField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable lastUpdatetime { + get { + return this.lastUpdatetimeField; + } + set { + this.lastUpdatetimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="language", IsNullable=true)] + public string preferredLanguage { + get { + return this.preferredLanguageField; + } + set { + this.preferredLanguageField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class OID { + + private string valueField; + + private int oIDReferenceIDField; + + private uint groupField; + + private string defaultNameField; + + private System.Xml.XmlElement[] anyField; + + /// + public string value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + + /// + public int oIDReferenceID { + get { + return this.oIDReferenceIDField; + } + set { + this.oIDReferenceIDField = value; + } + } + + /// + public uint group { + get { + return this.groupField; + } + set { + this.groupField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string defaultName { + get { + return this.defaultNameField; + } + set { + this.defaultNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class CA { + + private string[] urisField; + + private byte[] certificateField; + + private string cAIssuerNameField; + + private int cAReferenceIDField; + + private System.Nullable cATypeField; + + private byte[][] intermediateCACertificatesField; + + private byte[] rootCACertificateField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute("uris", DataType="anyURI")] + public string[] uris { + get { + return this.urisField; + } + set { + this.urisField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] certificate { + get { + return this.certificateField; + } + set { + this.certificateField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string cAIssuerName { + get { + return this.cAIssuerNameField; + } + set { + this.cAIssuerNameField = value; + } + } + + /// + public int cAReferenceID { + get { + return this.cAReferenceIDField; + } + set { + this.cAReferenceIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable cAType { + get { + return this.cATypeField; + } + set { + this.cATypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("intermediateCACertificates", DataType="base64Binary")] + public byte[][] intermediateCACertificates { + get { + return this.intermediateCACertificatesField; + } + set { + this.intermediateCACertificatesField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] rootCACertificate { + get { + return this.rootCACertificateField; + } + set { + this.rootCACertificateField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public enum CAType { + + /// + @public, + + /// + @private, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class MigrationOIDCollection { + + private string[] migratedFromOIDField; + + private string migratedToOIDField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute("migratedFromOID")] + public string[] migratedFromOID { + get { + return this.migratedFromOIDField; + } + set { + this.migratedFromOIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string migratedToOID { + get { + return this.migratedToOIDField; + } + set { + this.migratedToOIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class ApplicationInstructionsType { + + private string fileContentTypeField; + + private string urlField; + + private System.Xml.XmlElement[] anyField; + + /// + public string fileContentType { + get { + return this.fileContentTypeField; + } + set { + this.fileContentTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] + public string url { + get { + return this.urlField; + } + set { + this.urlField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class SeatInfoType { + + private AttributeValueType attributeNameValueField; + + private AttributeNameValuePropertyType attributeNameValuePropertyField; + + private System.Xml.XmlElement[] anyField; + + /// + public AttributeValueType attributeNameValue { + get { + return this.attributeNameValueField; + } + set { + this.attributeNameValueField = value; + } + } + + /// + public AttributeNameValuePropertyType attributeNameValueProperty { + get { + return this.attributeNameValuePropertyField; + } + set { + this.attributeNameValuePropertyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class AttributeValueType { + + private bool mandatoryField; + + private bool mandatoryFieldSpecified; + + private string typeField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool mandatory { + get { + return this.mandatoryField; + } + set { + this.mandatoryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mandatorySpecified { + get { + return this.mandatoryFieldSpecified; + } + set { + this.mandatoryFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class AttributeNameValuePropertyType { + + private string valueField; + + private string sourceField; + + private string sourceAttributeNameField; + + private System.Nullable mandatoryField; + + private System.Nullable overridableField; + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + + /// + public string source { + get { + return this.sourceField; + } + set { + this.sourceField = value; + } + } + + /// + public string sourceAttributeName { + get { + return this.sourceAttributeNameField; + } + set { + this.sourceAttributeNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable mandatory { + get { + return this.mandatoryField; + } + set { + this.mandatoryField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable overridable { + get { + return this.overridableField; + } + set { + this.overridableField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class PollingTimeType { + + private int nextUpdateHoursField; + + /// + public int nextUpdateHours { + get { + return this.nextUpdateHoursField; + } + set { + this.nextUpdateHoursField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class PollingPolicyType { + + private PollingTimeType gatewayPollingTimeField; + + private System.Xml.XmlElement[] anyField; + + /// + public PollingTimeType gatewayPollingTime { + get { + return this.gatewayPollingTimeField; + } + set { + this.gatewayPollingTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class DirectoryInfoType { + + private string directoryTypeField; + + private string domainNameField; + + private string itemField; + + private ItemChoiceType itemElementNameField; + + private System.Xml.XmlElement[] anyField; + + /// + public string directoryType { + get { + return this.directoryTypeField; + } + set { + this.directoryTypeField = value; + } + } + + /// + public string domainName { + get { + return this.domainNameField; + } + set { + this.domainNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("hostName", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("ipAddress", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public string Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType ItemElementName { + get { + return this.itemElementNameField; + } + set { + this.itemElementNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy", IncludeInSchema=false)] + public enum ItemChoiceType { + + /// + hostName, + + /// + ipAddress, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class AuthorizationInfoType { + + private string[] userAuthorizationCollectionField; + + private DirectoryInfoType directoryInfoField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("authorizedGroup", IsNullable=false)] + public string[] userAuthorizationCollection { + get { + return this.userAuthorizationCollectionField; + } + set { + this.userAuthorizationCollectionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public DirectoryInfoType directoryInfo { + get { + return this.directoryInfoField; + } + set { + this.directoryInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class RAPolicy { + + private bool registerUserField; + + private bool verifyUserField; + + private PublishCert publishCertField; + + private AuthorizationInfoType[] authorizationInfoField; + + private PollingPolicyType pollingPolicyField; + + private System.Xml.XmlElement[] anyField; + + /// + public bool registerUser { + get { + return this.registerUserField; + } + set { + this.registerUserField = value; + } + } + + /// + public bool verifyUser { + get { + return this.verifyUserField; + } + set { + this.verifyUserField = value; + } + } + + /// + public PublishCert publishCert { + get { + return this.publishCertField; + } + set { + this.publishCertField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("authorizationInfo")] + public AuthorizationInfoType[] authorizationInfo { + get { + return this.authorizationInfoField; + } + set { + this.authorizationInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public PollingPolicyType pollingPolicy { + get { + return this.pollingPolicyField; + } + set { + this.pollingPolicyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public enum PublishCert { + + /// + yes, + + /// + no, + + /// + clientProvided, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class ServiceEndpointType { + + private string typeField; + + private string endpointURIField; + + private System.Xml.XmlElement[] anyField; + + /// + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] + public string endpointURI { + get { + return this.endpointURIField; + } + set { + this.endpointURIField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class PersonalInfoType { + + private string nameField; + + private string emailField; + + private string phoneField; + + private System.Xml.XmlElement[] anyField; + + /// + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + public string email { + get { + return this.emailField; + } + set { + this.emailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string phone { + get { + return this.phoneField; + } + set { + this.phoneField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class SystemInformation { + + private AttributeNameValuePairType[] searchCertificateDataField; + + private PublishCert cACertPublishField; + + private bool cACertPublishFieldSpecified; + + private CACertPublishNameValuePair cACertPublishNameValuePairField; + + private bool cACertPublishNameValuePairFieldSpecified; + + private DeliveryFormat certificateDeliveryFormatField; + + private PersonalInfoType adminInfoField; + + private ServiceEndpointType[] serviceEndpointListField; + + private string duplicateCertPolicyField; + + private string supersededPolicyOIDField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("searchAttributeNameValuePair", IsNullable=false)] + public AttributeNameValuePairType[] searchCertificateData { + get { + return this.searchCertificateDataField; + } + set { + this.searchCertificateDataField = value; + } + } + + /// + public PublishCert cACertPublish { + get { + return this.cACertPublishField; + } + set { + this.cACertPublishField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool cACertPublishSpecified { + get { + return this.cACertPublishFieldSpecified; + } + set { + this.cACertPublishFieldSpecified = value; + } + } + + /// + public CACertPublishNameValuePair cACertPublishNameValuePair { + get { + return this.cACertPublishNameValuePairField; + } + set { + this.cACertPublishNameValuePairField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool cACertPublishNameValuePairSpecified { + get { + return this.cACertPublishNameValuePairFieldSpecified; + } + set { + this.cACertPublishNameValuePairFieldSpecified = value; + } + } + + /// + public DeliveryFormat certificateDeliveryFormat { + get { + return this.certificateDeliveryFormatField; + } + set { + this.certificateDeliveryFormatField = value; + } + } + + /// + public PersonalInfoType adminInfo { + get { + return this.adminInfoField; + } + set { + this.adminInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("serviceEndpoint", IsNullable=false)] + public ServiceEndpointType[] serviceEndpointList { + get { + return this.serviceEndpointListField; + } + set { + this.serviceEndpointListField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string duplicateCertPolicy { + get { + return this.duplicateCertPolicyField; + } + set { + this.duplicateCertPolicyField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string supersededPolicyOID { + get { + return this.supersededPolicyOIDField; + } + set { + this.supersededPolicyOIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class AttributeNameValuePairType { + + private string attributeNameField; + + private AttributeValueType attributeNameValueField; + + private AttributeNameValuePropertyType attributeNameValuePropertyField; + + /// + public string attributeName { + get { + return this.attributeNameField; + } + set { + this.attributeNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public AttributeValueType attributeNameValue { + get { + return this.attributeNameValueField; + } + set { + this.attributeNameValueField = value; + } + } + + /// + public AttributeNameValuePropertyType attributeNameValueProperty { + get { + return this.attributeNameValuePropertyField; + } + set { + this.attributeNameValuePropertyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public enum CACertPublishNameValuePair { + + /// + [System.Xml.Serialization.XmlEnumAttribute("$publish_flag")] + publish_flag, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public enum DeliveryFormat { + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X5" + + "09v3")] + httpdocsoasisopenorgwss200401oasis200401wssx509tokenprofile10X509v3, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PK" + + "CS7")] + httpdocsoasisopenorgwss200401oasis200401wssx509tokenprofile10PKCS7, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://schemas.verisign.com/pkiservices/2009/07/PKCS12")] + httpschemasverisigncompkiservices200907PKCS12, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class ClientPolicy { + + private string clientNameField; + + private int maxPinLengthField; + + private bool maxPinLengthFieldSpecified; + + private int minPinLengthField; + + private bool minPinLengthFieldSpecified; + + private int noOfBadAttemptsField; + + private bool noOfBadAttemptsFieldSpecified; + + private int certRenewalOverlapField; + + private bool certRenewalOverlapFieldSpecified; + + private bool renewExpiredCertsField; + + private bool renewExpiredCertsFieldSpecified; + + private string certRenewalMsgField; + + private bool certCleanUpField; + + private bool certCleanUpFieldSpecified; + + private PublishCert certPublishField; + + private System.Xml.XmlElement[] anyField; + + /// + public string clientName { + get { + return this.clientNameField; + } + set { + this.clientNameField = value; + } + } + + /// + public int maxPinLength { + get { + return this.maxPinLengthField; + } + set { + this.maxPinLengthField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool maxPinLengthSpecified { + get { + return this.maxPinLengthFieldSpecified; + } + set { + this.maxPinLengthFieldSpecified = value; + } + } + + /// + public int minPinLength { + get { + return this.minPinLengthField; + } + set { + this.minPinLengthField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool minPinLengthSpecified { + get { + return this.minPinLengthFieldSpecified; + } + set { + this.minPinLengthFieldSpecified = value; + } + } + + /// + public int noOfBadAttempts { + get { + return this.noOfBadAttemptsField; + } + set { + this.noOfBadAttemptsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool noOfBadAttemptsSpecified { + get { + return this.noOfBadAttemptsFieldSpecified; + } + set { + this.noOfBadAttemptsFieldSpecified = value; + } + } + + /// + public int certRenewalOverlap { + get { + return this.certRenewalOverlapField; + } + set { + this.certRenewalOverlapField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool certRenewalOverlapSpecified { + get { + return this.certRenewalOverlapFieldSpecified; + } + set { + this.certRenewalOverlapFieldSpecified = value; + } + } + + /// + public bool renewExpiredCerts { + get { + return this.renewExpiredCertsField; + } + set { + this.renewExpiredCertsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool renewExpiredCertsSpecified { + get { + return this.renewExpiredCertsFieldSpecified; + } + set { + this.renewExpiredCertsFieldSpecified = value; + } + } + + /// + public string certRenewalMsg { + get { + return this.certRenewalMsgField; + } + set { + this.certRenewalMsgField = value; + } + } + + /// + public bool certCleanUp { + get { + return this.certCleanUpField; + } + set { + this.certCleanUpField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool certCleanUpSpecified { + get { + return this.certCleanUpFieldSpecified; + } + set { + this.certCleanUpFieldSpecified = value; + } + } + + /// + public PublishCert certPublish { + get { + return this.certPublishField; + } + set { + this.certPublishField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class KeyEscrowPolicyType { + + private bool keyEscrowEnabledField; + + private bool keyRecoveryDualAdminApprovalRequiredField; + + private bool keyRecoveryDualAdminApprovalRequiredFieldSpecified; + + private string keyEscrowDeploymentModeField; + + private System.Nullable doKeyRecoveryForAdditionalEnrollRequestField; + + private System.Xml.XmlElement[] anyField; + + /// + public bool keyEscrowEnabled { + get { + return this.keyEscrowEnabledField; + } + set { + this.keyEscrowEnabledField = value; + } + } + + /// + public bool keyRecoveryDualAdminApprovalRequired { + get { + return this.keyRecoveryDualAdminApprovalRequiredField; + } + set { + this.keyRecoveryDualAdminApprovalRequiredField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool keyRecoveryDualAdminApprovalRequiredSpecified { + get { + return this.keyRecoveryDualAdminApprovalRequiredFieldSpecified; + } + set { + this.keyRecoveryDualAdminApprovalRequiredFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public string keyEscrowDeploymentMode { + get { + return this.keyEscrowDeploymentModeField; + } + set { + this.keyEscrowDeploymentModeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable doKeyRecoveryForAdditionalEnrollRequest { + get { + return this.doKeyRecoveryForAdditionalEnrollRequestField; + } + set { + this.doKeyRecoveryForAdditionalEnrollRequestField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class PrivateKeyInfo { + + private int keysizeField; + + private KeyEscrowPolicyType keyEscrowPolicyField; + + private bool keyexportableField; + + private bool keyprotectField; + + private bool keyprotectFieldSpecified; + + private System.Nullable algorithmOIDReferenceField; + + private string[] cryptoProvidersField; + + /// + public int keysize { + get { + return this.keysizeField; + } + set { + this.keysizeField = value; + } + } + + /// + public KeyEscrowPolicyType keyEscrowPolicy { + get { + return this.keyEscrowPolicyField; + } + set { + this.keyEscrowPolicyField = value; + } + } + + /// + public bool keyexportable { + get { + return this.keyexportableField; + } + set { + this.keyexportableField = value; + } + } + + /// + public bool keyprotect { + get { + return this.keyprotectField; + } + set { + this.keyprotectField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool keyprotectSpecified { + get { + return this.keyprotectFieldSpecified; + } + set { + this.keyprotectFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable algorithmOIDReference { + get { + return this.algorithmOIDReferenceField; + } + set { + this.algorithmOIDReferenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("provider", IsNullable=false)] + public string[] cryptoProviders { + get { + return this.cryptoProvidersField; + } + set { + this.cryptoProvidersField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class extensionValueType { + + private bool mandatoryField; + + private bool mandatoryFieldSpecified; + + private string typeField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool mandatory { + get { + return this.mandatoryField; + } + set { + this.mandatoryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mandatorySpecified { + get { + return this.mandatoryFieldSpecified; + } + set { + this.mandatoryFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class extensionSyntax { + + private object[] itemsField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute("extensionAttributeNameValuePair", typeof(AttributeNameValuePairType))] + [System.Xml.Serialization.XmlElementAttribute("extensionValue", typeof(extensionValueType))] + public object[] Items { + get { + return this.itemsField; + } + set { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class Extension { + + private int extensionOIDReferenceField; + + private bool extensionCriticalFlagField; + + private extensionSyntax extensionSyntaxField; + + /// + public int extensionOIDReference { + get { + return this.extensionOIDReferenceField; + } + set { + this.extensionOIDReferenceField = value; + } + } + + /// + public bool extensionCriticalFlag { + get { + return this.extensionCriticalFlagField; + } + set { + this.extensionCriticalFlagField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public extensionSyntax extensionSyntax { + get { + return this.extensionSyntaxField; + } + set { + this.extensionSyntaxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class subjectNameAttribute { + + private System.Nullable subjectNameAttributecountField; + + private AttributeNameValuePairType[] subjectNameAttributeNameValuePairField; + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable subjectNameAttributecount { + get { + return this.subjectNameAttributecountField; + } + set { + this.subjectNameAttributecountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("subjectNameAttributeNameValuePair")] + public AttributeNameValuePairType[] subjectNameAttributeNameValuePair { + get { + return this.subjectNameAttributeNameValuePairField; + } + set { + this.subjectNameAttributeNameValuePairField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class subjectName { + + private subjectNameAttribute[] subjectNameAttributeField; + + private bool overrideSubjectNameFormatField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlElementAttribute("subjectNameAttribute")] + public subjectNameAttribute[] subjectNameAttribute { + get { + return this.subjectNameAttributeField; + } + set { + this.subjectNameAttributeField = value; + } + } + + /// + public bool overrideSubjectNameFormat { + get { + return this.overrideSubjectNameFormatField; + } + set { + this.overrideSubjectNameFormatField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class OverrideValidity { + + private bool overrideFlagField; + + private bool overrideFlagFieldSpecified; + + private validityNameValuePairNames[] overrideNameValuePairField; + + /// + public bool overrideFlag { + get { + return this.overrideFlagField; + } + set { + this.overrideFlagField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool overrideFlagSpecified { + get { + return this.overrideFlagFieldSpecified; + } + set { + this.overrideFlagFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("overrideNameValuePair")] + public validityNameValuePairNames[] overrideNameValuePair { + get { + return this.overrideNameValuePairField; + } + set { + this.overrideNameValuePairField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public enum validityNameValuePairNames { + + /// + [System.Xml.Serialization.XmlEnumAttribute("$overrideValidityDays")] + overrideValidityDays, + + /// + [System.Xml.Serialization.XmlEnumAttribute("$overrideValidityStartDate")] + overrideValidityStartDate, + + /// + [System.Xml.Serialization.XmlEnumAttribute("$overrideValidityEndDate")] + overrideValidityEndDate, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class CertificateValidity { + + private ulong validityPeriodDaysField; + + private ulong renewalPeriodDaysField; + + /// + public ulong validityPeriodDays { + get { + return this.validityPeriodDaysField; + } + set { + this.validityPeriodDaysField = value; + } + } + + /// + public ulong renewalPeriodDays { + get { + return this.renewalPeriodDaysField; + } + set { + this.renewalPeriodDaysField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class Attributes { + + private int policySchemaField; + + private CertificateValidity certificateValidityField; + + private OverrideValidity certificateOverrideValidityField; + + private subjectName subjectNameInfoField; + + private Extension[] extensionsField; + + private PrivateKeyInfo privateKeyAttributesField; + + private ClientPolicy clientPolicyField; + + private SystemInformation systemInfoField; + + private RAPolicy rAPolicyField; + + private SeatInfoType seatIdInfoField; + + private ApplicationInstructionsType applicationInstructionsField; + + private string deploymentModeField; + + private string statusField; + + private MigrationOIDCollection migrationOIDsField; + + private System.Xml.XmlElement[] anyField; + + /// + public int policySchema { + get { + return this.policySchemaField; + } + set { + this.policySchemaField = value; + } + } + + /// + public CertificateValidity certificateValidity { + get { + return this.certificateValidityField; + } + set { + this.certificateValidityField = value; + } + } + + /// + public OverrideValidity certificateOverrideValidity { + get { + return this.certificateOverrideValidityField; + } + set { + this.certificateOverrideValidityField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public subjectName subjectNameInfo { + get { + return this.subjectNameInfoField; + } + set { + this.subjectNameInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] + public Extension[] extensions { + get { + return this.extensionsField; + } + set { + this.extensionsField = value; + } + } + + /// + public PrivateKeyInfo privateKeyAttributes { + get { + return this.privateKeyAttributesField; + } + set { + this.privateKeyAttributesField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public ClientPolicy clientPolicy { + get { + return this.clientPolicyField; + } + set { + this.clientPolicyField = value; + } + } + + /// + public SystemInformation systemInfo { + get { + return this.systemInfoField; + } + set { + this.systemInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public RAPolicy rAPolicy { + get { + return this.rAPolicyField; + } + set { + this.rAPolicyField = value; + } + } + + /// + public SeatInfoType seatIdInfo { + get { + return this.seatIdInfoField; + } + set { + this.seatIdInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public ApplicationInstructionsType applicationInstructions { + get { + return this.applicationInstructionsField; + } + set { + this.applicationInstructionsField = value; + } + } + + /// + public string deploymentMode { + get { + return this.deploymentModeField; + } + set { + this.deploymentModeField = value; + } + } + + /// + public string status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public MigrationOIDCollection migrationOIDs { + get { + return this.migrationOIDsField; + } + set { + this.migrationOIDsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class CertificateEnrollmentPolicy { + + private int policyOIDReferenceField; + + private int[] cAsField; + + private Attributes attributesField; + + /// + public int policyOIDReference { + get { + return this.policyOIDReferenceField; + } + set { + this.policyOIDReferenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("cAReference", IsNullable=false)] + public int[] cAs { + get { + return this.cAsField; + } + set { + this.cAsField = value; + } + } + + /// + public Attributes attributes { + get { + return this.attributesField; + } + set { + this.attributesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class Response { + + private string policyIDField; + + private string policyFriendlyNameField; + + private System.Nullable nextUpdateHoursField; + + private bool policiesNotChangedField; + + private CertificateEnrollmentPolicy[] policiesField; + + private System.Xml.XmlElement[] anyField; + + /// + public string policyID { + get { + return this.policyIDField; + } + set { + this.policyIDField = value; + } + } + + /// + public string policyFriendlyName { + get { + return this.policyFriendlyNameField; + } + set { + this.policyFriendlyNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] + public System.Nullable nextUpdateHours { + get { + return this.nextUpdateHoursField; + } + set { + this.nextUpdateHoursField = value; + } + } + + /// + public bool policiesNotChanged { + get { + return this.policiesNotChangedField; + } + set { + this.policiesNotChangedField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("policy", IsNullable=false)] + public CertificateEnrollmentPolicy[] policies { + get { + return this.policiesField; + } + set { + this.policiesField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class RequestFilter { + + private string[] policyIDsField; + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("oid", IsNullable=false)] + public string[] policyIDs { + get { + return this.policyIDsField; + } + set { + this.policyIDsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.verisign.com/pkiservices/2009/07/policy")] + public partial class getPoliciesResponse { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private Response responseField; + + private CA[] cAsField; + + private OID[] oIDsField; + + private byte[] signedEnrollmentPolicyField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public Response response { + get { + return this.responseField; + } + set { + this.responseField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("cA", IsNullable=false)] + public CA[] cAs { + get { + return this.cAsField; + } + set { + this.cAsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] + [System.Xml.Serialization.XmlArrayItemAttribute("oID", IsNullable=false)] + public OID[] oIDs { + get { + return this.oIDsField; + } + set { + this.oIDsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] signedEnrollmentPolicy { + get { + return this.signedEnrollmentPolicyField; + } + set { + this.signedEnrollmentPolicyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void requestPoliciesCompletedEventHandler(object sender, requestPoliciesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class requestPoliciesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal requestPoliciesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public getPoliciesResponse Result { + get { + this.RaiseExceptionIfNecessary(); + return ((getPoliciesResponse)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/policyService/Reference.map b/utils/ipn_sqlclr/Web References/policyService/Reference.map new file mode 100644 index 0000000..104777c --- /dev/null +++ b/utils/ipn_sqlclr/Web References/policyService/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/policyService/getPoliciesResponse.datasource b/utils/ipn_sqlclr/Web References/policyService/getPoliciesResponse.datasource new file mode 100644 index 0000000..ab499c5 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/policyService/getPoliciesResponse.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.policyService.getPoliciesResponse, Web References.policyService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/PrepSignDataResponse.datasource b/utils/ipn_sqlclr/Web References/signDataService/PrepSignDataResponse.datasource new file mode 100644 index 0000000..5132a84 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/PrepSignDataResponse.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.signDataService.PrepSignDataResponse, Web References.signDataService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/Reference.cs b/utils/ipn_sqlclr/Web References/signDataService/Reference.cs new file mode 100644 index 0000000..6bac516 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/Reference.cs @@ -0,0 +1,793 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.34014. +// + +using System.Security.Cryptography.X509Certificates; + +#pragma warning disable 1591 + +namespace signDataService { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="signDataServiceSOAP", Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class signDataService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback prepSignDataOperationCompleted; + + private System.Threading.SendOrPostCallback verifySignedDataOperationCompleted; + + private System.Threading.SendOrPostCallback noOpOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public signDataService(X509Certificate clientCert, string url) + { + this.Url = url; + ClientCertificates.Add(clientCert); + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event prepSignDataCompletedEventHandler prepSignDataCompleted; + + /// + public event verifySignedDataCompletedEventHandler verifySignedDataCompleted; + + /// + public event noOpCompletedEventHandler noOpCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.symantec.com/pkiservices/2011/11/sign/signDataOperations/prepSignD" + + "ataRequest", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("PrepSignDataResponse", Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public PrepSignDataResponse prepSignData([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] PrepSignDataRequest PrepSignDataRequest) { + object[] results = this.Invoke("prepSignData", new object[] { + PrepSignDataRequest}); + return ((PrepSignDataResponse)(results[0])); + } + + /// + public void prepSignDataAsync(PrepSignDataRequest PrepSignDataRequest) { + this.prepSignDataAsync(PrepSignDataRequest, null); + } + + /// + public void prepSignDataAsync(PrepSignDataRequest PrepSignDataRequest, object userState) { + if ((this.prepSignDataOperationCompleted == null)) { + this.prepSignDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnprepSignDataOperationCompleted); + } + this.InvokeAsync("prepSignData", new object[] { + PrepSignDataRequest}, this.prepSignDataOperationCompleted, userState); + } + + private void OnprepSignDataOperationCompleted(object arg) { + if ((this.prepSignDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.prepSignDataCompleted(this, new prepSignDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.symantec.com/pkiservices/2011/11/sign/signDataOperations/verifySig" + + "nedDataRequest", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("VerifySignedDataResponse", Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public VerifySignedDataResponse verifySignedData([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] VerifySignedDataRequest VerifySignedDataRequest) { + object[] results = this.Invoke("verifySignedData", new object[] { + VerifySignedDataRequest}); + return ((VerifySignedDataResponse)(results[0])); + } + + /// + public void verifySignedDataAsync(VerifySignedDataRequest VerifySignedDataRequest) { + this.verifySignedDataAsync(VerifySignedDataRequest, null); + } + + /// + public void verifySignedDataAsync(VerifySignedDataRequest VerifySignedDataRequest, object userState) { + if ((this.verifySignedDataOperationCompleted == null)) { + this.verifySignedDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnverifySignedDataOperationCompleted); + } + this.InvokeAsync("verifySignedData", new object[] { + VerifySignedDataRequest}, this.verifySignedDataOperationCompleted, userState); + } + + private void OnverifySignedDataOperationCompleted(object arg) { + if ((this.verifySignedDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.verifySignedDataCompleted(this, new verifySignedDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.symantec.com/pkiservices/2011/11/sign/signDataOperations/noOpReque" + + "st", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("ToBeSignedClientPKCS7BlobType", Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public ToBeSignedClientPKCS7BlobType noOp([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] ToBeSignedPKCS7BlobType ToBeSignedPKCS7BlobType) { + object[] results = this.Invoke("noOp", new object[] { + ToBeSignedPKCS7BlobType}); + return ((ToBeSignedClientPKCS7BlobType)(results[0])); + } + + /// + public void noOpAsync(ToBeSignedPKCS7BlobType ToBeSignedPKCS7BlobType) { + this.noOpAsync(ToBeSignedPKCS7BlobType, null); + } + + /// + public void noOpAsync(ToBeSignedPKCS7BlobType ToBeSignedPKCS7BlobType, object userState) { + if ((this.noOpOperationCompleted == null)) { + this.noOpOperationCompleted = new System.Threading.SendOrPostCallback(this.OnnoOpOperationCompleted); + } + this.InvokeAsync("noOp", new object[] { + ToBeSignedPKCS7BlobType}, this.noOpOperationCompleted, userState); + } + + private void OnnoOpOperationCompleted(object arg) { + if ((this.noOpCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.noOpCompleted(this, new noOpCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class PrepSignDataRequest { + + private string clientTransactionIDField; + + private SignDataInfoType signDataInfoField; + + private byte[] toBeSignDataField; + + private string versionField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public SignDataInfoType signDataInfo { + get { + return this.signDataInfoField; + } + set { + this.signDataInfoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] toBeSignData { + get { + return this.toBeSignDataField; + } + set { + this.toBeSignDataField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class SignDataInfoType { + + private string descriptionField; + + private CertificateFilterType certificateFilterField; + + private HashAlgorithmType hashAlgorithmField; + + private string urlFilterField; + + /// + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + public CertificateFilterType certificateFilter { + get { + return this.certificateFilterField; + } + set { + this.certificateFilterField = value; + } + } + + /// + public HashAlgorithmType hashAlgorithm { + get { + return this.hashAlgorithmField; + } + set { + this.hashAlgorithmField = value; + } + } + + /// + public string urlFilter { + get { + return this.urlFilterField; + } + set { + this.urlFilterField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class CertificateFilterType { + + private string[] profileIDFilterSetField; + + private UserFilterType[] userFilterSetField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("profileOID", IsNullable=false)] + public string[] profileIDFilterSet { + get { + return this.profileIDFilterSetField; + } + set { + this.profileIDFilterSetField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("userFilter", IsNullable=false)] + public UserFilterType[] userFilterSet { + get { + return this.userFilterSetField; + } + set { + this.userFilterSetField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class UserFilterType { + + private UserAttributeNameType userAttributeNameField; + + private string userAttributeValueField; + + private bool ignoreCaseField; + + private bool ignoreCaseFieldSpecified; + + /// + public UserAttributeNameType userAttributeName { + get { + return this.userAttributeNameField; + } + set { + this.userAttributeNameField = value; + } + } + + /// + public string userAttributeValue { + get { + return this.userAttributeValueField; + } + set { + this.userAttributeValueField = value; + } + } + + /// + public bool ignoreCase { + get { + return this.ignoreCaseField; + } + set { + this.ignoreCaseField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ignoreCaseSpecified { + get { + return this.ignoreCaseFieldSpecified; + } + set { + this.ignoreCaseFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public enum UserAttributeNameType { + + /// + CN, + + /// + Email, + + /// + UID, + + /// + rfc822Name, + + /// + UPN, + + /// + DNSName, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public enum HashAlgorithmType { + + /// + sha512, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class PrepSignDataResponse { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private byte[] pkcs7SignedBlobField; + + private string versionField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] pkcs7SignedBlob { + get { + return this.pkcs7SignedBlobField; + } + set { + this.pkcs7SignedBlobField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class VerifySignedDataRequest { + + private string clientTransactionIDField; + + private byte[] clientPkcs7SignedBlobField; + + private string versionField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] clientPkcs7SignedBlob { + get { + return this.clientPkcs7SignedBlobField; + } + set { + this.clientPkcs7SignedBlobField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class VerifySignedDataResponse { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private StatusType statusField; + + private string versionField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public StatusType status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public enum StatusType { + + /// + SUCCESS, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class ToBeSignedPKCS7BlobType { + + private SignDataInfoType signDataInfoField; + + private string organizationField; + + private string requestIdField; + + private byte[] hashValueField; + + private string versionField; + + /// + public SignDataInfoType signDataInfo { + get { + return this.signDataInfoField; + } + set { + this.signDataInfoField = value; + } + } + + /// + public string organization { + get { + return this.organizationField; + } + set { + this.organizationField = value; + } + } + + /// + public string requestId { + get { + return this.requestIdField; + } + set { + this.requestIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] hashValue { + get { + return this.hashValueField; + } + set { + this.hashValueField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.symantec.com/pkiservices/2011/11/sign")] + public partial class ToBeSignedClientPKCS7BlobType { + + private byte[] pkcs7SignedBlobField; + + private byte[] toBeSignDataField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] pkcs7SignedBlob { + get { + return this.pkcs7SignedBlobField; + } + set { + this.pkcs7SignedBlobField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] toBeSignData { + get { + return this.toBeSignDataField; + } + set { + this.toBeSignDataField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void prepSignDataCompletedEventHandler(object sender, prepSignDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class prepSignDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal prepSignDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public PrepSignDataResponse Result { + get { + this.RaiseExceptionIfNecessary(); + return ((PrepSignDataResponse)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void verifySignedDataCompletedEventHandler(object sender, verifySignedDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class verifySignedDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal verifySignedDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public VerifySignedDataResponse Result { + get { + this.RaiseExceptionIfNecessary(); + return ((VerifySignedDataResponse)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void noOpCompletedEventHandler(object sender, noOpCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class noOpCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal noOpCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ToBeSignedClientPKCS7BlobType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ToBeSignedClientPKCS7BlobType)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/Reference.map b/utils/ipn_sqlclr/Web References/signDataService/Reference.map new file mode 100644 index 0000000..5ee651a --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.wsdl b/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.wsdl new file mode 100644 index 0000000..0fcae8c --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.wsdl @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.xsd b/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.xsd new file mode 100644 index 0000000..03a802a --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/SignerAPI.xsd @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/ToBeSignedClientPKCS7BlobType.datasource b/utils/ipn_sqlclr/Web References/signDataService/ToBeSignedClientPKCS7BlobType.datasource new file mode 100644 index 0000000..fa17ce7 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/ToBeSignedClientPKCS7BlobType.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.signDataService.ToBeSignedClientPKCS7BlobType, Web References.signDataService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/signDataService/VerifySignedDataResponse.datasource b/utils/ipn_sqlclr/Web References/signDataService/VerifySignedDataResponse.datasource new file mode 100644 index 0000000..de31f24 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/signDataService/VerifySignedDataResponse.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.signDataService.VerifySignedDataResponse, Web References.signDataService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/userManagementService/Reference.map b/utils/ipn_sqlclr/Web References/userManagementService/Reference.map new file mode 100644 index 0000000..ab3e45d --- /dev/null +++ b/utils/ipn_sqlclr/Web References/userManagementService/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.wsdl b/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.wsdl new file mode 100644 index 0000000..540ac2f --- /dev/null +++ b/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.xsd b/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.xsd new file mode 100644 index 0000000..b38e295 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/userManagementService/UserManagementService.xsd @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.cs b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.cs new file mode 100644 index 0000000..7b9754c --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.cs @@ -0,0 +1,1045 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.34014. +// + +using System.Security.Cryptography.X509Certificates; +using ipn_sqlclr; + +#pragma warning disable 1591 + +namespace veriSignCertIssuingService { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="veriSignCertIssuingServiceSOAP", Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttributedString))] + public partial class veriSignCertIssuingService : XmlReaderSpyService + { + + private System.Threading.SendOrPostCallback RequestSecurityTokenOperationCompleted; + + private System.Threading.SendOrPostCallback RequestSecurityToken2OperationCompleted; + + /// + public veriSignCertIssuingService(X509Certificate clientCert, string url) + : base(clientCert, url) + { + } + + /// + public event RequestSecurityTokenCompletedEventHandler RequestSecurityTokenCompleted; + + /// + public event RequestSecurityToken2CompletedEventHandler RequestSecurityToken2Completed; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/enrollment/requestSecurityToken", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("RequestSecurityTokenResponse", Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] + public RequestSecurityTokenResponseType RequestSecurityToken([System.Xml.Serialization.XmlElementAttribute("RequestSecurityToken", Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] RequestSecurityTokenType RequestSecurityToken1) { + object[] results = this.Invoke("RequestSecurityToken", new object[] { + RequestSecurityToken1}); + return ((RequestSecurityTokenResponseType)(results[0])); + } + + /// + public void RequestSecurityTokenAsync(RequestSecurityTokenType RequestSecurityToken1) { + this.RequestSecurityTokenAsync(RequestSecurityToken1, null); + } + + /// + public void RequestSecurityTokenAsync(RequestSecurityTokenType RequestSecurityToken1, object userState) { + if ((this.RequestSecurityTokenOperationCompleted == null)) { + this.RequestSecurityTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRequestSecurityTokenOperationCompleted); + } + this.InvokeAsync("RequestSecurityToken", new object[] { + RequestSecurityToken1}, this.RequestSecurityTokenOperationCompleted, userState); + } + + private void OnRequestSecurityTokenOperationCompleted(object arg) { + if ((this.RequestSecurityTokenCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RequestSecurityTokenCompleted(this, new RequestSecurityTokenCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.verisign.com/pkiservices/2009/07/enrollment/requestSecurityToken2", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("RequestSecurityTokenResponseCollection", Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] + public RequestSecurityTokenResponseCollectionType RequestSecurityToken2([System.Xml.Serialization.XmlElementAttribute("RequestSecurityToken", Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] RequestSecurityTokenType RequestSecurityToken1) { + object[] results = this.Invoke("RequestSecurityToken2", new object[] { + RequestSecurityToken1}); + return ((RequestSecurityTokenResponseCollectionType)(results[0])); + } + + /// + public void RequestSecurityToken2Async(RequestSecurityTokenType RequestSecurityToken1) { + this.RequestSecurityToken2Async(RequestSecurityToken1, null); + } + + /// + public void RequestSecurityToken2Async(RequestSecurityTokenType RequestSecurityToken1, object userState) { + if ((this.RequestSecurityToken2OperationCompleted == null)) { + this.RequestSecurityToken2OperationCompleted = new System.Threading.SendOrPostCallback(this.OnRequestSecurityToken2OperationCompleted); + } + this.InvokeAsync("RequestSecurityToken2", new object[] { + RequestSecurityToken1}, this.RequestSecurityToken2OperationCompleted, userState); + } + + private void OnRequestSecurityToken2OperationCompleted(object arg) { + if ((this.RequestSecurityToken2Completed != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RequestSecurityToken2Completed(this, new RequestSecurityToken2CompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] + public partial class RequestSecurityTokenType { + + private RequestVSSecurityTokenEnrollmentType itemField; + + private System.Xml.XmlElement[] anyField; + + private string contextField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + [System.Xml.Serialization.XmlElementAttribute("requestVSSecurityToken", Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public RequestVSSecurityTokenEnrollmentType Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string Context { + get { + return this.contextField; + } + set { + this.contextField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public partial class RequestVSSecurityTokenEnrollmentType { + + private string certificateProfileIDField; + + private string clientTransactionIDField; + + private TokenType tokenTypeField; + + private bool tokenTypeFieldSpecified; + + private RequestTypeEnum requestTypeField; + + private BinarySecurityTokenType[] binarySecurityTokenField; + + private AdditionalContextType additionalContextField; + + private string pendingTokenReferenceIDField; + + private NameValueType[] nameValuePairField; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + private string preferredLanguageField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + public string certificateProfileID { + get { + return this.certificateProfileIDField; + } + set { + this.certificateProfileIDField = value; + } + } + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public TokenType tokenType { + get { + return this.tokenTypeField; + } + set { + this.tokenTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool tokenTypeSpecified { + get { + return this.tokenTypeFieldSpecified; + } + set { + this.tokenTypeFieldSpecified = value; + } + } + + /// + public RequestTypeEnum requestType { + get { + return this.requestTypeField; + } + set { + this.requestTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("binarySecurityToken")] + public BinarySecurityTokenType[] binarySecurityToken { + get { + return this.binarySecurityTokenField; + } + set { + this.binarySecurityTokenField = value; + } + } + + /// + public AdditionalContextType additionalContext { + get { + return this.additionalContextField; + } + set { + this.additionalContextField = value; + } + } + + /// + public string pendingTokenReferenceID { + get { + return this.pendingTokenReferenceIDField; + } + set { + this.pendingTokenReferenceIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("nameValuePair")] + public NameValueType[] nameValuePair { + get { + return this.nameValuePairField; + } + set { + this.nameValuePairField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="language")] + public string preferredLanguage { + get { + return this.preferredLanguageField; + } + set { + this.preferredLanguageField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public enum TokenType { + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X5" + + "09v3")] + httpdocsoasisopenorgwss200401oasis200401wssx509tokenprofile10X509v3, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#PK" + + "CS7")] + httpdocsoasisopenorgwss200401oasis200401wssx509tokenprofile10PKCS7, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://schemas.verisign.com/pkiservices/2009/07/PKCS12")] + httpschemasverisigncompkiservices200907PKCS12, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public enum RequestTypeEnum { + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue")] + httpdocsoasisopenorgwssxwstrust200512Issue, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://docs.oasis-open.org/ws-sx/ws-trust/200512/Renew")] + httpdocsoasisopenorgwssxwstrust200512Renew, + + /// + [System.Xml.Serialization.XmlEnumAttribute("http://schemas.verisign.com/pkiservices/2009/07/QueryTokenStatus")] + httpschemasverisigncompkiservices200907QueryTokenStatus, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" + + "")] + public partial class BinarySecurityTokenType : EncodedString { + + private string valueTypeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string ValueType { + get { + return this.valueTypeField; + } + set { + this.valueTypeField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeyIdentifierType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BinarySecurityTokenType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" + + "")] + public partial class EncodedString : AttributedString { + + private string encodingTypeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string EncodingType { + get { + return this.encodingTypeField; + } + set { + this.encodingTypeField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EncodedString))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(KeyIdentifierType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BinarySecurityTokenType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PasswordString))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" + + "")] + public partial class AttributedString { + + private string idField; + + private System.Xml.XmlAttribute[] anyAttrField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs" + + "d", DataType="ID")] + public string Id { + get { + return this.idField; + } + set { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] + public partial class RequestSecurityTokenResponseCollectionType { + + private RequestSecurityTokenResponseType[] requestSecurityTokenResponseField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + [System.Xml.Serialization.XmlElementAttribute("RequestSecurityTokenResponse")] + public RequestSecurityTokenResponseType[] RequestSecurityTokenResponse { + get { + return this.requestSecurityTokenResponseField; + } + set { + this.requestSecurityTokenResponseField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/")] + public partial class RequestSecurityTokenResponseType { + + private RequestVSSecurityTokenResponseEnrollmentType itemField; + + private System.Xml.XmlElement[] anyField; + + private string contextField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + [System.Xml.Serialization.XmlElementAttribute("RequestVSSecurityTokenResponse", Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public RequestVSSecurityTokenResponseEnrollmentType Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string Context { + get { + return this.contextField; + } + set { + this.contextField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public partial class RequestVSSecurityTokenResponseEnrollmentType { + + private string clientTransactionIDField; + + private string serverTransactionIDField; + + private TokenType tokenTypeField; + + private bool tokenTypeFieldSpecified; + + private string dispositionMessageField; + + private BinarySecurityTokenType binarySecurityTokenField; + + private RequestedVSSecurityTokenEnrollmentType requestedVSSecurityTokenField; + + private string versionField; + + private System.Xml.XmlElement[] anyField; + + private string preferredLanguageField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + public string clientTransactionID { + get { + return this.clientTransactionIDField; + } + set { + this.clientTransactionIDField = value; + } + } + + /// + public string serverTransactionID { + get { + return this.serverTransactionIDField; + } + set { + this.serverTransactionIDField = value; + } + } + + /// + public TokenType tokenType { + get { + return this.tokenTypeField; + } + set { + this.tokenTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool tokenTypeSpecified { + get { + return this.tokenTypeFieldSpecified; + } + set { + this.tokenTypeFieldSpecified = value; + } + } + + /// + public string dispositionMessage { + get { + return this.dispositionMessageField; + } + set { + this.dispositionMessageField = value; + } + } + + /// + public BinarySecurityTokenType binarySecurityToken { + get { + return this.binarySecurityTokenField; + } + set { + this.binarySecurityTokenField = value; + } + } + + /// + public RequestedVSSecurityTokenEnrollmentType requestedVSSecurityToken { + get { + return this.requestedVSSecurityTokenField; + } + set { + this.requestedVSSecurityTokenField = value; + } + } + + /// + public string version { + get { + return this.versionField; + } + set { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="language")] + public string preferredLanguage { + get { + return this.preferredLanguageField; + } + set { + this.preferredLanguageField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public partial class RequestedVSSecurityTokenEnrollmentType { + + private object[] itemsField; + + private ItemsChoiceType[] itemsElementNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("binarySecurityToken", typeof(BinarySecurityTokenType))] + [System.Xml.Serialization.XmlElementAttribute("pKCS12Password", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("pendingTokenReferenceID", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public object[] Items { + get { + return this.itemsField; + } + set { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType[] ItemsElementName { + get { + return this.itemsElementNameField; + } + set { + this.itemsElementNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment", IncludeInSchema=false)] + public enum ItemsChoiceType { + + /// + binarySecurityToken, + + /// + pKCS12Password, + + /// + pendingTokenReferenceID, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.verisign.com/pkiservices/2009/07/enrollment")] + public partial class NameValueType { + + private string nameField; + + private string valueField; + + /// + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + public string value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.xmlsoap.org/ws/2006/12/authorization")] + public partial class ContextItemType { + + private object itemField; + + private string nameField; + + private string scopeField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + [System.Xml.Serialization.XmlElementAttribute("Value", typeof(string))] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string Name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string Scope { + get { + return this.scopeField; + } + set { + this.scopeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.xmlsoap.org/ws/2006/12/authorization")] + public partial class AdditionalContextType { + + private ContextItemType[] contextItemField; + + private System.Xml.XmlElement[] anyField; + + private System.Xml.XmlAttribute[] anyAttrField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ContextItem")] + public ContextItemType[] ContextItem { + get { + return this.contextItemField; + } + set { + this.contextItemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any { + get { + return this.anyField; + } + set { + this.anyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr { + get { + return this.anyAttrField; + } + set { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" + + "")] + public partial class PasswordString : AttributedString { + + private string typeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string Type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" + + "")] + public partial class KeyIdentifierType : EncodedString { + + private string valueTypeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")] + public string ValueType { + get { + return this.valueTypeField; + } + set { + this.valueTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void RequestSecurityTokenCompletedEventHandler(object sender, RequestSecurityTokenCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RequestSecurityTokenCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RequestSecurityTokenCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RequestSecurityTokenResponseType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RequestSecurityTokenResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + public delegate void RequestSecurityToken2CompletedEventHandler(object sender, RequestSecurityToken2CompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RequestSecurityToken2CompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RequestSecurityToken2CompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public RequestSecurityTokenResponseCollectionType Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RequestSecurityTokenResponseCollectionType)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.map b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.map new file mode 100644 index 0000000..26e85af --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/Reference.map @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseCollectionType.datasource b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseCollectionType.datasource new file mode 100644 index 0000000..293512c --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseCollectionType.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.veriSignCertIssuingService.RequestSecurityTokenResponseCollectionType, Web References.veriSignCertIssuingService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseType.datasource b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseType.datasource new file mode 100644 index 0000000..71a9c98 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/RequestSecurityTokenResponseType.datasource @@ -0,0 +1,10 @@ + + + + taggantWrapper.veriSignCertIssuingService.RequestSecurityTokenResponseType, Web References.veriSignCertIssuingService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/VS_WSTEP.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/VS_WSTEP.xsd new file mode 100644 index 0000000..f0a60fd --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/VS_WSTEP.xsd @@ -0,0 +1,83 @@ + + + + + + + + XML Schema for veriSignCertIssuingService Web Services + version 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/certificateService.wsdl b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/certificateService.wsdl new file mode 100644 index 0000000..ec7d758 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/certificateService.wsdl @@ -0,0 +1,38 @@ + + + + + XML WSDL for VeriSign + Certificate Web Services + version 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-secext-1.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-secext-1.xsd new file mode 100644 index 0000000..78cfc6e --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-secext-1.xsd @@ -0,0 +1,187 @@ + + + + + + + + This type represents an element with arbitrary attributes. + + + + + + + + + + + This type is used for password elements per Section 4.1. + + + + + + + + + + This type is used for elements containing stringified binary data. + + + + + + + + + + This type represents a username token per Section 4.1 + + + + + + + + + + + A security token that is encoded in binary + + + + + + + + + + A security token key identifier + + + + + + + + + + Typedef to allow a list of usages (as URIs). + + + + + + This global attribute is used to indicate the usage of a referenced or indicated token within the containing context + + + + + This type represents a reference to an external security token. + + + + + + + + This type represents a reference to an embedded security token. + + + + + + + + + + This type is used reference a security token. + + + + + + + + + + + This complexType defines header block to use for security-relevant data directed at a specific SOAP actor. + + + + + The use of "any" is to allow extensibility and different forms of security data. + + + + + + + + This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation. + + + + + The use of "any" is to allow extensibility from any namespace. + + + + + + + + This element defines the wsse:UsernameToken element per Section 4.1. + + + + + This element defines the wsse:BinarySecurityToken element per Section 4.2. + + + + + This element defines a security token reference + + + + + This element defines a security token embedded reference + + + + + This element defines a key identifier reference + + + + + This element defines the wsse:SecurityTokenReference per Section 4.3. + + + + + This element defines the wsse:Security SOAP header element per Section 4. + + + + + This element contains properties for transformations from any namespace, including DSIG. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-utility-1.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-utility-1.xsd new file mode 100644 index 0000000..4c4f775 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/oasis-200401-wss-wssecurity-utility-1.xsd @@ -0,0 +1,90 @@ + + + + + +This type defines the fault code value for Timestamp message expiration. + + + + + + + + + +This global attribute supports annotating arbitrary elements with an ID. + + + + + + +Convenience attribute group used to simplify this schema. + + + + + + + + +This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes. + + + + + + + + + + + +This type is for elements whose [children] is an anyURI and can have arbitrary attributes. + + + + + + + + + + + +This complex type ties together the timestamp related elements into a composite type. + + + + + + + + + + + + + + +This element allows Timestamps to be applied anywhere element wildcards are present, +including as a SOAP header. + + + + + + +This element allows an expiration time to be applied anywhere element wildcards are present. + + + + + + +This element allows a creation time to be applied anywhere element wildcards are present. + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-addr.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-addr.xsd new file mode 100644 index 0000000..25e4ca7 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-addr.xsd @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-authorization.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-authorization.xsd new file mode 100644 index 0000000..5e23c93 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-authorization.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-policy.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-policy.xsd new file mode 100644 index 0000000..f8444cf --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-policy.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.wsdl b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.wsdl new file mode 100644 index 0000000..3016c34 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.wsdl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.xsd new file mode 100644 index 0000000..027f4e0 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/ws-trust-1.xsd @@ -0,0 +1,359 @@ + + + + + + + + + + + + Actual content model is non-deterministic, hence wildcard. The following shows intended content model: + + <xs:element ref='wst:TokenType' minOccurs='0' /> + <xs:element ref='wst:RequestType' /> + <xs:element ref='wsp:AppliesTo' minOccurs='0' /> + <xs:element ref='wst:Claims' minOccurs='0' /> + <xs:element ref='wst:Entropy' minOccurs='0' /> + <xs:element ref='wst:Lifetime' minOccurs='0' /> + <xs:element ref='wst:AllowPostdating' minOccurs='0' /> + <xs:element ref='wst:Renewing' minOccurs='0' /> + <xs:element ref='wst:OnBehalfOf' minOccurs='0' /> + <xs:element ref='wst:Issuer' minOccurs='0' /> + <xs:element ref='wst:AuthenticationType' minOccurs='0' /> + <xs:element ref='wst:KeyType' minOccurs='0' /> + <xs:element ref='wst:KeySize' minOccurs='0' /> + <xs:element ref='wst:SignatureAlgorithm' minOccurs='0' /> + <xs:element ref='wst:Encryption' minOccurs='0' /> + <xs:element ref='wst:EncryptionAlgorithm' minOccurs='0' /> + <xs:element ref='wst:CanonicalizationAlgorithm' minOccurs='0' /> + <xs:element ref='wst:ProofEncryption' minOccurs='0' /> + <xs:element ref='wst:UseKey' minOccurs='0' /> + <xs:element ref='wst:SignWith' minOccurs='0' /> + <xs:element ref='wst:EncryptWith' minOccurs='0' /> + <xs:element ref='wst:DelegateTo' minOccurs='0' /> + <xs:element ref='wst:Forwardable' minOccurs='0' /> + <xs:element ref='wst:Delegatable' minOccurs='0' /> + <xs:element ref='wsp:Policy' minOccurs='0' /> + <xs:element ref='wsp:PolicyReference' minOccurs='0' /> + <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Actual content model is non-deterministic, hence wildcard. The following shows intended content model: + + <xs:element ref='wst:TokenType' minOccurs='0' /> + <xs:element ref='wst:RequestType' /> + <xs:element ref='wst:RequestedSecurityToken' minOccurs='0' /> + <xs:element ref='wsp:AppliesTo' minOccurs='0' /> + <xs:element ref='wst:RequestedAttachedReference' minOccurs='0' /> + <xs:element ref='wst:RequestedUnattachedReference' minOccurs='0' /> + <xs:element ref='wst:RequestedProofToken' minOccurs='0' /> + <xs:element ref='wst:Entropy' minOccurs='0' /> + <xs:element ref='wst:Lifetime' minOccurs='0' /> + <xs:element ref='wst:Status' minOccurs='0' /> + <xs:element ref='wst:AllowPostdating' minOccurs='0' /> + <xs:element ref='wst:Renewing' minOccurs='0' /> + <xs:element ref='wst:OnBehalfOf' minOccurs='0' /> + <xs:element ref='wst:Issuer' minOccurs='0' /> + <xs:element ref='wst:AuthenticationType' minOccurs='0' /> + <xs:element ref='wst:Authenticator' minOccurs='0' /> + <xs:element ref='wst:KeyType' minOccurs='0' /> + <xs:element ref='wst:KeySize' minOccurs='0' /> + <xs:element ref='wst:SignatureAlgorithm' minOccurs='0' /> + <xs:element ref='wst:Encryption' minOccurs='0' /> + <xs:element ref='wst:EncryptionAlgorithm' minOccurs='0' /> + <xs:element ref='wst:CanonicalizationAlgorithm' minOccurs='0' /> + <xs:element ref='wst:ProofEncryption' minOccurs='0' /> + <xs:element ref='wst:UseKey' minOccurs='0' /> + <xs:element ref='wst:SignWith' minOccurs='0' /> + <xs:element ref='wst:EncryptWith' minOccurs='0' /> + <xs:element ref='wst:DelegateTo' minOccurs='0' /> + <xs:element ref='wst:Forwardable' minOccurs='0' /> + <xs:element ref='wst:Delegatable' minOccurs='0' /> + <xs:element ref='wsp:Policy' minOccurs='0' /> + <xs:element ref='wsp:PolicyReference' minOccurs='0' /> + <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The RequestSecurityTokenCollection (RSTC) element is used to provide multiple RST requests. + One or more RSTR elements in an RSTRC element are returned in the response to the RequestSecurityTokenCollection. + + + + + + + + + + + The <wst:RequestSecurityTokenResponseCollection> element (RSTRC) MUST be used to return a security token or + response to a security token request on the final response. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xml.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xml.xsd new file mode 100644 index 0000000..be134de --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xml.xsd @@ -0,0 +1,270 @@ + + + + +
+

About the XML namespace

+
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + +
+

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + +
+

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+
+
+
+ + + + + + +
+ + + +
+

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + +
+

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + +
+

Father (in any context at all)

+
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + +
+

+ About this schema document +

+
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + +
+

+ Versioning policy for this schema document +

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+
\ No newline at end of file diff --git a/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xmldsig-core-schema.xsd b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xmldsig-core-schema.xsd new file mode 100644 index 0000000..e036087 --- /dev/null +++ b/utils/ipn_sqlclr/Web References/veriSignCertIssuingService/xmldsig-core-schema.xsd @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/XmlReaderSpy.cs b/utils/ipn_sqlclr/XmlReaderSpy.cs new file mode 100644 index 0000000..f89ece9 --- /dev/null +++ b/utils/ipn_sqlclr/XmlReaderSpy.cs @@ -0,0 +1,280 @@ +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Web.Services.Protocols; +using System.Xml; +using System.IO; + +namespace ipn_sqlclr +{ + public class XmlReaderSpy : StreamReader + { + private readonly StringBuilder _sb = new StringBuilder(); + public XmlReaderSpy(Stream stream, Encoding encoding, bool p, int bufferSize) : base(stream, encoding, p, bufferSize) + { + } + + public override int Read(char[] buffer, int index, int count) + { + var ret = base.Read(buffer, index, count); + if(ret > 0) + _sb.Append(buffer, index, ret); + return ret; + } + + public override string ReadToEnd() + { + var ret = base.ReadToEnd(); + _sb.Append(ret); + return ret; + } + + public override string ReadLine() + { + var ret = base.ReadLine(); + _sb.Append(ret); + return ret; + } + + public override int ReadBlock(char[] buffer, int index, int count) + { + return Read(buffer, index, count); + } + + public string Xml + { + get { return _sb.ToString().Replace("", ""); } + } + } + + public class XmlWriterSpy : XmlWriter + { + private readonly XmlWriter _base; + private readonly XmlTextWriter _xtw; + private readonly StringWriter _sw; + + /// + /// Extracted XML. + /// + public string Xml + { + get + { + return (_sw != null) ? _sw.ToString() : string.Empty; + } + } + + public XmlWriterSpy(XmlWriter parent) + { + _base = parent; + _sw = new StringWriter(); + _xtw = new XmlTextWriter(_sw); + } + + #region Abstract properties and methods that must be implemented + + public override WriteState WriteState + { + get + { + return _base.WriteState; + } + } + + public override void Close() + { + _base.Close(); + _xtw.Close(); + _sw.Close(); + } + + public override void Flush() + { + _base.Flush(); + _xtw.Flush(); + _sw.Flush(); + } + + public override string LookupPrefix(string ns) + { + return _base.LookupPrefix(ns); + } + + public override void WriteBase64(byte[] buffer, int index, int count) + { + _base.WriteBase64(buffer, index, count); + _xtw.WriteBase64(buffer, index, count); + } + + public override void WriteCData(string text) + { + _base.WriteCData(text); + _xtw.WriteCData(text); + } + + public override void WriteCharEntity(char ch) + { + _base.WriteCharEntity(ch); + _xtw.WriteCharEntity(ch); + } + + public override void WriteChars(char[] buffer, int index, int count) + { + _base.WriteChars(buffer, index, count); + _xtw.WriteChars(buffer, index, count); + } + + public override void WriteComment(string text) + { + _base.WriteComment(text); + _xtw.WriteComment(text); + } + + public override void WriteDocType(string name, string pubid, string sysid, string subset) + { + _base.WriteDocType(name, pubid, sysid, subset); + _xtw.WriteDocType(name, pubid, sysid, subset); + } + + public override void WriteEndAttribute() + { + _base.WriteEndAttribute(); + _xtw.WriteEndAttribute(); + } + + public override void WriteEndDocument() + { + _base.WriteEndDocument(); + _xtw.WriteEndDocument(); + } + + public override void WriteEndElement() + { + _base.WriteEndElement(); + _xtw.WriteEndElement(); + } + + public override void WriteEntityRef(string name) + { + _base.WriteEntityRef(name); + _xtw.WriteEntityRef(name); + } + + public override void WriteFullEndElement() + { + _base.WriteFullEndElement(); + _xtw.WriteFullEndElement(); + } + + public override void WriteProcessingInstruction(string name, string text) + { + _base.WriteProcessingInstruction(name, text); + _xtw.WriteProcessingInstruction(name, text); + } + + public override void WriteRaw(string data) + { + _base.WriteRaw(data); + _xtw.WriteRaw(data); + } + + public override void WriteRaw(char[] buffer, int index, int count) + { + _base.WriteRaw(buffer, index, count); + _xtw.WriteRaw(buffer, index, count); + } + + public override void WriteStartAttribute(string prefix, string localName, string ns) + { + _base.WriteStartAttribute(prefix, localName, ns); + _xtw.WriteStartAttribute(prefix, localName, ns); + } + + public override void WriteStartDocument(bool standalone) + { + _base.WriteStartDocument(standalone); + _xtw.WriteStartDocument(standalone); + } + + public override void WriteStartDocument() + { + _base.WriteStartDocument(); + _xtw.WriteStartDocument(); + } + + public override void WriteStartElement(string prefix, string localName, string ns) + { + _base.WriteStartElement(prefix, localName, ns); + _xtw.WriteStartElement(prefix, localName, ns); + } + + public override void WriteString(string text) + { + _base.WriteString(text); + _xtw.WriteString(text); + } + + public override void WriteSurrogateCharEntity(char lowChar, char highChar) + { + _base.WriteSurrogateCharEntity(lowChar, highChar); + _xtw.WriteSurrogateCharEntity(lowChar, highChar); + + } + + public override void WriteWhitespace(string ws) + { + _base.WriteWhitespace(ws); + _xtw.WriteWhitespace(ws); + } + + #endregion + } + + public class XmlReaderSpyService : SoapHttpClientProtocol + { + protected XmlReaderSpyService(X509Certificate clientCert, string url) + { + Url = url; + ClientCertificates.Add(clientCert); + } + + private XmlReaderSpy _xmlReaderSpy; + private XmlWriterSpy _xmlWriterSpy; + + public string GetRequestXml() + { + if (_xmlWriterSpy != null) + return _xmlWriterSpy.Xml; + return string.Empty; + } + public string GetResponseXml() + { + if (_xmlReaderSpy != null) + { + return _xmlReaderSpy.Xml; + } + return string.Empty; + } + + protected override XmlReader GetReaderForMessage(SoapClientMessage message, int bufferSize) + { + Encoding encoding = Encoding.UTF8; + if (bufferSize < 0x200) + { + bufferSize = 0x200; + } + var reader = new XmlTextReader(_xmlReaderSpy = new XmlReaderSpy(message.Stream, encoding, true, bufferSize)) + { + DtdProcessing = DtdProcessing.Prohibit, + Normalization = true, + XmlResolver = null + }; + return reader; + } + + protected override XmlWriter GetWriterForMessage(SoapClientMessage message, int bufferSize) + { + _xmlWriterSpy = new XmlWriterSpy(base.GetWriterForMessage(message, bufferSize)); + return _xmlWriterSpy; + } + } +} diff --git a/utils/ipn_sqlclr/ipn_sqlclr.sqlproj b/utils/ipn_sqlclr/ipn_sqlclr.sqlproj new file mode 100644 index 0000000..67fa032 --- /dev/null +++ b/utils/ipn_sqlclr/ipn_sqlclr.sqlproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + ipn_sqlclr + 2.0 + 4.1 + {046364af-635b-4f62-9c8c-d3866b8f622f} + Microsoft.Data.Tools.Schema.Sql.Sql110DatabaseSchemaProvider + Database + + + ipn_sqlclr + ipn_sqlclr + 1033, CI + BySchemaAndSchemaType + True + v4.5 + CS + Properties + False + True + UNSAFE + True + + + bin\Release\ + $(MSBuildProjectName).sql + False + pdbonly + true + false + true + prompt + 4 + + + bin\Debug\ + $(MSBuildProjectName).sql + false + true + full + false + true + true + prompt + 4 + + + + 10.0 + + + + + + + + + + + + + + + + + + + + + + + + True + True + Reference.map + + + True + True + Reference.map + + + True + True + Reference.map + + + True + True + Reference.map + + + + + + + + Web References\CertificateEnrollmentPolicy.wsdl + + + Web References\CertificateManagementService.wsdl + + + Web References\SignerAPI.wsdl + + + Web References\UserManagementService.wsdl + + + Web References\VS_WSTEP.wsdl + + + Web References\ws-trust-1.3-verisign.wsdl + + + + + + crypto + {38872a5f-e87e-4fad-b109-8eb7b2e6a4a0} + True + True + True + + + \ No newline at end of file diff --git a/utils/ipn_sqlclr/keygen.cs b/utils/ipn_sqlclr/keygen.cs new file mode 100644 index 0000000..d26b5a3 --- /dev/null +++ b/utils/ipn_sqlclr/keygen.cs @@ -0,0 +1,212 @@ +using System; +using System.IO; +using System.Numerics; +using System.Security.Cryptography; +using System.Text; + +namespace ipn_sqlclr +{ + enum SerialNumberChunks : byte + { + Version = 0x01, // 1 byte of data - version + UserName = 0x02, // 1 + N bytes - length + N bytes of customer's name (without enging \0). + Email = 0x03, // 1 + N bytes - length + N bytes of customer's email (without ending \0). + ProductCode = 0x07, // 8 bytes - used for decrypting some parts of exe-file + UserData = 0x08, // 1 + N bytes - length + N bytes of user data + MaxBuild = 0x09, // 4 bytes - (year << 16) + (month << 8) + (day) + End = 0xFF // 4 bytes - checksum: the first four bytes of sha-1 hash from the data before that chunk + }; + + public static class Rsa + { + private const string PublicExpB64 = "AAEAAQ=="; + private const string PrivateExpB64 = "CXHXWx/Z9JqetQWwFpvmD72wrDiqQOXMQs18fhAMjWCfJ/f2r3p2io+iB3gqIuu3LGH3WJ8PQuIzvDMnbwAx+8BbAyYhWhGEbxDdifndjQ2KlDV2Hu8NQgCbc5Wjok0rKwQ+Bxeb2i1+Gu3FsnhRNv9RhSyiwcnH/4Q3+ySE3AFAcAUwuQABePjDKCYOfIyx7RKz5h0sG+v10nkPuuCGPSnh+AXDTBIJFH+yNIjkrfweC9A3dv7URyRJumAMgm/SnDU76rTkFw9vZpupQeMtMtIsZIkeFSngip9KImD5zzbb2vKD63Cg9W/Yvqgvro/d+cR5n6P0t4DzfanNIFRGpFrX8/Q5VjuezDKw/4YbsFYwOhzJPRxglmCEjh8cpfxJ11cUXa/hNBV4c4Dp29D0F+w01OlBnFb1Ck9VXur2qJCsqcWtjsnt/VITsxa1jzr+3C2+uvaI4JSd7yLEnTqSaSsRfWuhDXgjY/YWhmyvMzeQeXBGOXKt2j2lY2Fm0WJx"; + private const string ModulusB64 = "pwUqwaM8IOukyx06Lvi5YNQ70JE7pwg7K+pmM/vCe1CUseHKFM1v1m11geDjVsAt38AnaiFs3JhtTs80ySCIxOSyvMw6Cd52k6N6dn7LAx1mxQLJLhYeMMJYbplMHnMLwYN0+IO58OVbEqRyaJV2ExolnK2EYZL7QRXujGY7/sOoOMF3p6GsWJK6kkBJICIoL9hHWBQMO6/9rmls/+EhaWuP80Vx0+H2OlrQ58K+TJeyE393cvb4QufiEPpCNaB50Klee9QUnsjSW/bTnmGn4Bi5+cowRbawUY73Q5I58fMAXiH9ueDPuNMR9YKDgW9GxunLmYkbuwqIp/v7kw3cfMBM0ihhB0B8UhjyAMAGLzJWX3H/H6Zrz41g9PbPjTAxfsTaCrxoqjaTaO4zk9YsI//VX9Fhivcy913SevBpNandziGfYH/oHW2xDy9AfwkE1wuIBlLj7c/k8U1YmmRAmkoCzlmB7EU4ClNltboh1uARUQ6wW30upppnuYhGkTy7"; + + static BigInteger B2Bi(byte[] b) //reverse & make positive + { + Array.Reverse(b); + var b2 = new byte[b.Length + 1]; + Array.Copy(b, b2, b.Length); + return new BigInteger(b2); + } + + private static readonly BigInteger PublicExp = B2Bi(Convert.FromBase64String(PublicExpB64)); + private static readonly BigInteger PrivateExp = B2Bi(Convert.FromBase64String(PrivateExpB64)); + private static readonly BigInteger Modulus = B2Bi(Convert.FromBase64String(ModulusB64)); + + public static byte[] Encrypt(byte[] paddedData) + { + var x = B2Bi(paddedData); + var y = BigInteger.ModPow(x, PrivateExp, Modulus); + + byte[] ret = y.ToByteArray(); + Array.Resize(ref ret, paddedData.Length); + Array.Reverse(ret); + return ret; + } + + public static byte[] Decrypt(byte[] data) + { + var x = B2Bi(data); + var y = BigInteger.ModPow(x, PublicExp, Modulus); + + byte[] ret = y.ToByteArray(); + Array.Reverse(ret); + return ret; + } + + } + public static class Keygen + { + public static void ParseKey(string key, out int productId, out string customerName, out string eMail, out DateTime maxBuildDt) + { + productId = -1; + customerName = null; + eMail = null; + maxBuildDt = new DateTime(); + + var crypted = Convert.FromBase64String(key); + var data = Rsa.Decrypt(crypted); + int i; + for (i = 2; i < data.Length && data[i] != 0; i++) { + } + + i++; + var pos = i; + while (pos < data.Length) + { + var b = data[pos++]; + switch (b) + { + case (byte) SerialNumberChunks.Version: + b = data[pos++]; + if (b < 1 || b > 2) + throw new InvalidDataException("SerialNumberChunks.Version"); + break; + case (byte) SerialNumberChunks.UserName: + b = data[pos++]; + customerName = Encoding.UTF8.GetString(data, pos, b); + pos += b; + break; + case (byte) SerialNumberChunks.Email: + b = data[pos++]; + eMail = Encoding.UTF8.GetString(data, pos, b); + pos += b; + break; + case (byte)SerialNumberChunks.ProductCode: + pos += 8; + break; + case (byte) SerialNumberChunks.UserData: + b = data[pos++]; + if (b == 0) + productId = 0; + else if(b != 1) + throw new InvalidDataException("Invalid ProductID"); + else + productId = data[pos]; + pos += b; + break; + case (byte) SerialNumberChunks.MaxBuild: + maxBuildDt = new DateTime(data[pos + 2] + 256 * data[pos + 3], data[pos + 1],data[pos]); + pos += 4; + break; + case (byte) SerialNumberChunks.End: + if (pos + 4 > data.Length) + throw new InvalidDataException("No checksum"); + { + SHA1 sha = new SHA1Managed(); + sha.Initialize(); + var hash = sha.ComputeHash(data, i, pos - 1 - i); + for (int j = 0; j < 4; j++) + { + if(data[pos + j] == hash[3 - j]) + continue; + throw new InvalidDataException("Invalid checksum"); + } + } + return; + } + } + throw new InvalidDataException("No checksum"); + } + + public static string GenerateKey(int productId, string customerName, string eMail, DateTime maxBuildDt) + { + var data = new MemoryStream(); + data.WriteByte((byte)SerialNumberChunks.Version); + data.WriteByte(1); + + data.WriteByte((byte)SerialNumberChunks.UserName); + var utfCustomer = Encoding.UTF8.GetBytes(customerName); + if (utfCustomer.Length > 255) + throw new ArgumentException("Customer name too long", "customerName"); + data.WriteByte((byte)utfCustomer.Length); + data.Write(utfCustomer, 0, utfCustomer.Length); + + data.WriteByte((byte)SerialNumberChunks.Email); + byte[] utfeMail = Encoding.UTF8.GetBytes(eMail); + if (utfeMail.Length > 255) + throw new ArgumentException("EMail too long", "eMail"); + data.WriteByte((byte)utfeMail.Length); + data.Write(utfeMail, 0, utfeMail.Length); + + data.WriteByte((byte)SerialNumberChunks.ProductCode); + data.Write(new byte[] { 41, 65, 36, 150, 5, 175, 174, 137 }, 0, 8); + + data.WriteByte((byte)SerialNumberChunks.UserData); + data.WriteByte(1); + data.WriteByte((byte)productId); + + data.WriteByte((byte)SerialNumberChunks.MaxBuild); + data.WriteByte((byte)maxBuildDt.Day); + data.WriteByte((byte)maxBuildDt.Month); + data.WriteByte((byte)maxBuildDt.Year); + data.WriteByte((byte)(maxBuildDt.Year >> 8)); + + SHA1 sha = new SHA1Managed(); + sha.Initialize(); + data.Position = 0; + var hash = sha.ComputeHash(data); + data.WriteByte((byte)SerialNumberChunks.End); + data.WriteByte(hash[3]); + data.WriteByte(hash[2]); + data.WriteByte(hash[1]); + data.WriteByte(hash[0]); + + const int minPadding = 8 + 3; + const int maxPadding = minPadding + 16; + const int maxBytes = 3072 / 8; + if (data.Length + minPadding > maxBytes) + throw new ApplicationException("Serial number too long"); + + var rnd = new Random(); + var paddingBytes = rnd.Next(minPadding, maxPadding + 1); + if (data.Length + paddingBytes > maxBytes) + paddingBytes = maxBytes - (int)data.Length; + + var paddedData = new byte[maxBytes]; + var nonPaddedData = data.ToArray(); + Array.Copy(nonPaddedData, paddedData, paddingBytes); + Array.Copy(nonPaddedData, 0, paddedData, paddingBytes, data.Length); + paddedData[0] = 0; + paddedData[1] = 2; + paddedData[paddingBytes - 1] = 0; + var i = 2; + for (; i < paddingBytes - 1; i++) { + byte b = 0; + while (b == 0) { + b = (byte)rnd.Next(256); + } + paddedData[i] = b; + } + i = nonPaddedData.Length + paddingBytes; + while (i < maxBytes) { + paddedData[i++] = (byte)rnd.Next(256); + } + + var res = Convert.ToBase64String(Rsa.Encrypt(paddedData), Base64FormattingOptions.InsertLineBreaks); + return res; + } + } +} diff --git a/utils/ipn_tool/App.config b/utils/ipn_tool/App.config new file mode 100644 index 0000000..0a564f8 --- /dev/null +++ b/utils/ipn_tool/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/utils/ipn_tool/CheckSsvTest.cs b/utils/ipn_tool/CheckSsvTest.cs new file mode 100644 index 0000000..e5a708d --- /dev/null +++ b/utils/ipn_tool/CheckSsvTest.cs @@ -0,0 +1,170 @@ +using System; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; + +namespace ipn_tool +{ + internal static class CheckSsvTest + { + /* GOOD sequence +Taggant Test Application + +Taggant Library version 1 + + + - correct PE file + - taggant is found + - taggant object created + - taggant is correct + - taggant does not contain timestamp + - file protected by packer with 1 id, version .+ + - hashmap covers following regions: +\d.+ any lines + - hashmap is valid + - full file hash is valid + - full file hash covers first \d+ bytes + - SPV Certificate + 30 82 05 5b 30 82 03 43 a0 03 02 01 02 02 10 25 many lines + - User Certificate + 30 82 04 04 30 82 02 ec a0 03 02 01 02 02 10 05 many lines + etc +*/ + internal static int Result(string logFile, string pemFile) + { + var expectedLines = new[] + { + /*00*/ new Regex("^Taggant Test Application$"), + /*01*/ null, + /*02*/ new Regex("^Taggant Library version 1$"), + /*03*/ null, + /*04*/ new Regex(@"^.+"), + /*05*/ new Regex(@"^ - correct PE file$"), + /*06*/ new Regex(@"^ - taggant is found$"), + /*07*/ new Regex(@"^ - taggant object created$"), + /*08*/ new Regex(@"^ - taggant is correct$"), + /*09*/ new Regex(@"^ - taggant does not contain timestamp$"), + /*10*/ new Regex(@"^ - file protected by packer with 1 id, version .+$"), + /*11*/ new Regex(@"^ - hashmap covers following regions:$"), + /*12*/ new Regex(@"^\d.+$"), //any lines + /*13*/ new Regex(@"^ - hashmap is valid$"), + /*14*/ new Regex(@"^ - full file hash is valid$"), + /*15*/ new Regex(@"^ - full file hash covers first \d+ bytes$"), + /*16*/ new Regex(@"^ - SPV Certificate$"), + /*17*/ null, + /*18*/ new Regex(@"^ - User Certificate"), + /*19*/ null + }; + try + { + var stateIndex = 0; + var lineNo = 0; + var spv = new MemoryStream(); + var usr = new MemoryStream(); + var curFile = "unknown"; + foreach (var line in File.ReadAllLines(logFile)) + { + if (stateIndex == 4) + curFile = line; + var re = expectedLines[stateIndex]; + var needCheck = true; + switch (stateIndex) + { + case 13: + needCheck = false; + if (re.IsMatch(line)) + ++stateIndex; + else if (!expectedLines[stateIndex - 1].IsMatch(line)) + throw new InvalidDataException(string.Format("Regex '{0}' or '{1}' match was expected at line #{2} but got '{3}'", re, expectedLines[stateIndex - 1], lineNo, line)); + break; + case 17: + if (!AppendToMemoryStream(line, spv)) + { + stateIndex = 18; + re = expectedLines[stateIndex]; + } + else + { + needCheck = false; + } + break; + case 19: + if (!AppendToMemoryStream(line, usr)) + { + if (!CompareCertificates(pemFile, curFile, spv, usr)) + return 1; + spv = new MemoryStream(); + usr = new MemoryStream(); + stateIndex = 4; + re = expectedLines[stateIndex]; + } + else + { + needCheck = false; + } + break; + } + if(needCheck) + { + if (re == null && line != string.Empty) + throw new InvalidDataException(string.Format("Empty line #{0} was expected but got '{1}'", lineNo, line)); + if (re != null && !re.IsMatch(line)) + throw new InvalidDataException(string.Format("Regex '{0}' match was expected at line #{1} but got '{2}'", re, lineNo, line)); + ++stateIndex; + } + ++lineNo; + } + return CompareCertificates(pemFile, curFile, spv, usr) ? 0 : 1; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex); + return 1; + } + } + + private static bool CompareCertificates(string pemFile, string binaryName, MemoryStream spv, MemoryStream usr) + { + var pemContents = File.ReadAllText(pemFile); + var m = Regex.Match(pemContents, + @"^-----BEGIN CERTIFICATE-----[\s]*(?([^-]+))[\s]*-----END CERTIFICATE-----[\s]*-----BEGIN CERTIFICATE-----[\s]*(?([^-]+))[\s]*-----END CERTIFICATE-----[\s]*-----BEGIN RSA PRIVATE KEY-----[\s]*(?([^-]+))[\s]*-----END RSA PRIVATE KEY-----[\s]*$", + RegexOptions.Multiline); + if (!m.Success) + throw new InvalidDataException("Cannot parse " + pemFile); + var expectedSpv = Convert.FromBase64String(m.Groups["spv"].Value); + var expectedUsr = Convert.FromBase64String(m.Groups["usr"].Value); + //TODO: check private key if need + return CompareBa("SPV", binaryName, expectedSpv, spv.ToArray()) && CompareBa("USER", binaryName, expectedUsr, usr.ToArray()); + } + + private static bool CompareBa(string partName, string binaryName, byte[] p1, byte[] p2) + { + if (p1.Length == p2.Length && p1.Length > 0) + { + for(var i = 0; i < p1.Length; i++) + if (p1[i] != p2[i]) + throw new InvalidDataException(string.Format("taggant.pem {0} did not match to file {1} signature at position {2}.", partName, binaryName, i)); + return true; + } + throw new InvalidDataException(string.Format("taggant.pem {0} did not match to file {1} signature", partName, binaryName)); + } + + // 30 82 05 5b 30 82 03 43 a0 03 02 01 02 02 10 25 - typical line + private static bool AppendToMemoryStream(string line, Stream spv) + { + if (!Regex.IsMatch(line, @"^[\s0-9A-F]+$", RegexOptions.IgnoreCase)) + return false; + var chunk = StringToByteArray(line.Replace(" ", "")); + spv.Write(chunk, 0, chunk.Length); + return true; + } + + private static byte[] StringToByteArray(string hex) + { + return Enumerable.Range(0, hex.Length) + .Where(x => x % 2 == 0) + .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/utils/ipn_tool/Program.cs b/utils/ipn_tool/Program.cs new file mode 100644 index 0000000..b86dbdb --- /dev/null +++ b/utils/ipn_tool/Program.cs @@ -0,0 +1,301 @@ +using System; +using System.Data; +using System.Data.SqlClient; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml; + +namespace ipn_tool +{ + static class Program + { + static int Main(string[] args) + { + switch (args.Length) + { + case 2: + if (args[0] == "-export_wm") + return ExportWatermarks(args[1]); + break; + case 3: + switch (args[0]) + { + case "-export_bl": + return MergeBlacklist(args[1], args[2]); + case "-export_tasks": + return ExportTasks(null, args[1], args[2]); + case "-check_ssvtest": + return CheckSsvTest.Result(args[1], args[2]); + } + break; + case 4: + if (args[0] == "-export_task") + return ExportTasks(args[1], args[2], args[3]); + if (args[0] == "-check_wm") + return Watermarks.CheckIfPresent(args[1], args[2], args[3]); + break; + case 5: + if (args[0] == "-register_result") + return RegisterResult(args[1], args[2], args[3], args[4]); + break; + } + Console.WriteLine("IPN database tool. USAGE:"); + Console.WriteLine("a) Export watermarks: ipn_tool -export_wm "); + Console.WriteLine("b) Merge project with blacklist: ipn_tool -export_bl "); + Console.WriteLine("c) Prepare for all actual end-user builds: ipn_tool -export_tasks "); + Console.WriteLine("d) Prepare for actual end-user build: ipn_tool -export_task "); + Console.WriteLine("e) Register build result: ipn_tool -register_result "); + Console.WriteLine("f) Parse and check ssvtest.log: ipn_tool -check_ssvtest "); + Console.WriteLine("g) Check if watermark present: ipn_tool -check_wm "); + return 1; + } + + private static int RegisterResult(string licenseId, string bambooBuildUrl, string success, string version) + { + int ret; + using (var con = IpnConn()) + { + using (var cmd = new SqlCommand("dbo.RegisterBuildTaskResult", con)) + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.CommandTimeout = 600; + cmd.Parameters.AddWithValue("@licenseID", int.Parse(licenseId)); + cmd.Parameters.AddWithValue("@bambooBuildUrl", bambooBuildUrl); + cmd.Parameters.AddWithValue("@success", bool.Parse(success)); + cmd.Parameters.AddWithValue("@version", version); + + con.Open(); + ret = (int)cmd.ExecuteScalar(); + Console.WriteLine("RegisterResult (0 - OK): {0}.", ret); + } + } + return ret; + } + + private enum Platform + { + Windows, + Linux, + Mac + } + + private static Platform RunningPlatform() + { + switch (Environment.OSVersion.Platform) + { + case PlatformID.Unix: + // Well, there are chances MacOSX is reported as Unix instead of MacOSX. + // Instead of platform check, we'll do a feature checks (Mac specific root folders) + if (Directory.Exists("/Applications") + & Directory.Exists("/System") + & Directory.Exists("/Users") + & Directory.Exists("/Volumes")) + return Platform.Mac; + else + return Platform.Linux; + + case PlatformID.MacOSX: + return Platform.Mac; + + default: + return Platform.Windows; + } + } + + private static int ExportTasks(string licenseId, string rootPath, string version) + { + var ret = 1; + if (!rootPath.EndsWith(Path.DirectorySeparatorChar + @"licenses")) + { + Console.WriteLine(@"RootPath '{0}' check failed (should ends with {1}licenses)", rootPath, Path.DirectorySeparatorChar); + } + else using (var con = IpnConn()) + { + using (var cmd = new SqlCommand("dbo.ExportBuildTaskInfo", con)) + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.CommandTimeout = 600; + cmd.Parameters.AddWithValue("@licenseID", licenseId == null ? DBNull.Value : (object)int.Parse(licenseId)); + cmd.Parameters.AddWithValue("@filterOutVersion", version); + cmd.Parameters.AddWithValue("@filterByOperatingSystem", RunningPlatform().ToString()); + + con.Open(); + var cnt = 0; + using (var r = cmd.ExecuteReader()) + { + if (licenseId == null) + { + Directory.Delete(rootPath, true); + } + while (r.Read()) + { + ++cnt; + var lId = r.GetInt32(0); + var task = r.GetString(1); + var key = r.GetString(2); + var taggant = r.GetString(3); + + Directory.CreateDirectory(Path.Combine(rootPath, lId.ToString(CultureInfo.InvariantCulture))); + var taskIniName = Path.Combine(rootPath, lId.ToString(), "task.ini"); + using (var taskIni = new StreamWriter(new FileStream(taskIniName, FileMode.OpenOrCreate, FileAccess.Write), new UTF8Encoding(false))) + { + var doc = new XmlDocument(); + doc.LoadXml(task); + // ReSharper disable once PossibleNullReferenceException + foreach (XmlAttribute attr in doc.DocumentElement.Attributes) + { + taskIni.WriteLine("{0}={1}", attr.Name, attr.Value); + } + } + var keyName = Path.Combine(rootPath, lId.ToString(), "VMProtect.key"); + File.WriteAllText(keyName, key); + var tagName = Path.Combine(rootPath, lId.ToString(), "taggant.pem"); + File.WriteAllText(tagName, + String.Join("\r\n", taggant.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries))); + } + + Console.WriteLine("ExportTasks: {0} item(s) exported.", cnt); + if (cnt > 0) + ret = 0; + } + } + } + return ret; + } + + private static int MergeBlacklist(string filenameIn, string filenameOut) + { + var ret = 1; + using (var con = IpnConn()) + { + using (var cmd = new SqlCommand("dbo.ExportBlacklist", con)) + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.CommandTimeout = 600; + con.Open(); + var xml = new XmlDocument(); + xml.Load(filenameIn); + var lm = xml.SelectSingleNode("Document/LicenseManager"); + if (lm != null) + { + lm.InnerXml = ""; + var cnt = 0; + using (var r = cmd.ExecuteReader()) + { + while (r.Read()) + { + XmlNode license = xml.CreateElement("License"); + XmlAttribute adate = xml.CreateAttribute("Date"); + adate.Value = r.GetDateTime(1).ToString("yyyy-MM-dd"); + + XmlAttribute aname = xml.CreateAttribute("CustomerName"); + aname.Value = r.GetString(2); + + XmlAttribute aemail = xml.CreateAttribute("CustomerEmail"); + aemail.Value = r.GetString(3); + + XmlAttribute akey = xml.CreateAttribute("SerialNumber"); + akey.Value = r.GetString(4); + + if (license.Attributes != null) + { + license.Attributes.Append(adate); + license.Attributes.Append(aname); + license.Attributes.Append(aemail); + license.Attributes.Append(akey); + XmlAttribute ablocked = xml.CreateAttribute("Blocked"); + ablocked.Value = "1"; + license.Attributes.Append(ablocked); + } + lm.AppendChild(license); + + cnt++; + } + } + xml.Save(filenameOut); + Console.WriteLine("MergeBlacklist: {0} item(s) exported.", cnt); + if (cnt > 0) + ret = 0; + } + } + } + return ret; + } + + private static int ExportWatermarks(string filenameOut) + { + var ret = 1; + using (var con = IpnConn()) + { + using (var cmd = new SqlCommand("dbo.ExportWatermarks", con)) + { + cmd.CommandType = CommandType.StoredProcedure; + cmd.CommandTimeout = 600; + con.Open(); + var xml = new XmlDocument(); + xml.InsertBefore(xml.CreateXmlDeclaration("1.0",null,null), xml.DocumentElement); + XmlNode rootNode = xml.CreateElement("Document"); + xml.AppendChild(rootNode); + XmlNode wms = xml.CreateElement("Watermarks"); + rootNode.AppendChild(wms); + + int cnt = 0; + using (var r = cmd.ExecuteReader()) + { + while (r.Read()) + { + XmlNode wm = xml.CreateElement("Watermark"); + XmlAttribute aid = xml.CreateAttribute("Id"); + aid.Value = cnt.ToString(CultureInfo.InvariantCulture); + + XmlAttribute aname = xml.CreateAttribute("Name"); + aname.Value = r.GetString(0); + + XmlAttribute areadablename = xml.CreateAttribute("ReadableName"); + areadablename.Value = r.GetString(1); + + XmlAttribute aemail = xml.CreateAttribute("EMail"); + aemail.Value = r.GetString(2); + + wm.InnerText = r.GetString(3); + + if (wm.Attributes != null) + { + wm.Attributes.Append(aid); + wm.Attributes.Append(aname); + wm.Attributes.Append(areadablename); + wm.Attributes.Append(aemail); + if (r.GetInt32(4) == 0) + { + XmlAttribute aenabled = xml.CreateAttribute("Enabled"); + aenabled.Value = "0"; + wm.Attributes.Append(aenabled); + } + } + wms.AppendChild(wm); + + cnt++; + } + } + XmlAttribute acnt = xml.CreateAttribute("Id"); + acnt.Value = cnt.ToString(CultureInfo.InvariantCulture); + if (wms.Attributes != null) + wms.Attributes.Append(acnt); + + xml.Save(filenameOut); + Console.WriteLine("ExportWatermarks: {0} item(s) exported.", cnt); + if (cnt > 0) + ret = 0; + } + } + return ret; + } + + private static SqlConnection IpnConn() + { + return new SqlConnection("server=scb-serv;database=ipn;user id=ipn_reader;password=rAqiEiGBOh39;Connection Timeout=300"); + } + + } +} diff --git a/utils/ipn_tool/Properties/AssemblyInfo.cs b/utils/ipn_tool/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0c49f83 --- /dev/null +++ b/utils/ipn_tool/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ipn_tool")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ipn_tool")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a555f928-8e1a-4b21-b346-ad777bddebab")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/utils/ipn_tool/Watermarks.cs b/utils/ipn_tool/Watermarks.cs new file mode 100644 index 0000000..3ed47f5 --- /dev/null +++ b/utils/ipn_tool/Watermarks.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml; + +namespace ipn_tool +{ + internal static class Watermarks + { + internal static int CheckIfPresent(string xmlDb, string id, string binFile) + { + try + { + var wm = LoadWm(xmlDb, id); + return FindWm(wm, binFile) ? 0 : 1; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex); + return 1; + } + } + + private static string LoadWm(string xmlDb, string id) + { + var s = new FileStream(xmlDb, FileMode.Open, FileAccess.Read); + using (var x = new XmlTextReader(s)) + { + while (x.Read()) + { + if (x.NodeType == XmlNodeType.Element && x.Name == "Watermark" && x.GetAttribute("Name") == id) + { + if(x.Read() && x.NodeType == XmlNodeType.Text && !string.IsNullOrEmpty(x.Value)) + return x.Value; + } + } + } + throw new KeyNotFoundException("WM.id=" + id); + } + + private static bool FindWm(string wm, string binFile) + { + var wmna = WmStringToNibbleArray(wm.ToUpper()); + var filesToCheck = new List(); + if (Directory.Exists(binFile)) + { + filesToCheck.AddRange(Directory.EnumerateFiles(binFile)); + } + else + { + filesToCheck.Add(binFile); + } + return filesToCheck.All(s => CheckFile(s, wmna)); + } + + private static bool CheckFile(string binFile, int[] wmna) + { + var filena = new List(wmna.Length + 1); + using (var s = new FileStream(binFile, FileMode.Open, FileAccess.Read)) + { + while (true) + { + var nextByte = s.ReadByte(); + if (nextByte == -1) + { + Console.Error.WriteLine("Watermark was not found in {0}", binFile); + return false; + } + filena.Add(nextByte >> 4); + filena.Add(nextByte & 15); + while (filena.Count >= wmna.Length) + { + if (MatchWm(wmna, filena)) + { + Console.WriteLine("Watermark in {0}: FOUND", binFile); + return true; + } + filena.RemoveAt(0); + } + } + } + } + + private static bool MatchWm(IEnumerable wmna, IList filena) + { + return !wmna.Where((t, i) => t != -1 && t != filena[i]).Any(); + } + + private static int[] WmStringToNibbleArray(string wm) + { + if(!Regex.IsMatch(wm, @"[A-Z0-9\?]+")) + throw new ArgumentException("Watermark contains bad symbols: " + wm, "wm"); + + var ret = new int[wm.Length]; + var idx = 0; + foreach (var ch in wm) + { + if (ch == '?') + ret[idx++] = -1; + else if (ch <= '9') + ret[idx++] = ch - '0'; + else + ret[idx++] = ch - 'A' + 10; + } + return ret; + } + + } +} \ No newline at end of file diff --git a/utils/ipn_tool/ipn_tool.csproj b/utils/ipn_tool/ipn_tool.csproj new file mode 100644 index 0000000..379456e --- /dev/null +++ b/utils/ipn_tool/ipn_tool.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {4ADE08C2-D14E-4FE6-BF66-95EE29C953C6} + Exe + Properties + ipn_tool + ipn_tool + v4.8 + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/ipn_tool/ipn_tool.sln b/utils/ipn_tool/ipn_tool.sln new file mode 100644 index 0000000..2b43a4d --- /dev/null +++ b/utils/ipn_tool/ipn_tool.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25123.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ipn_tool", "ipn_tool.csproj", "{4ADE08C2-D14E-4FE6-BF66-95EE29C953C6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4ADE08C2-D14E-4FE6-BF66-95EE29C953C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4ADE08C2-D14E-4FE6-BF66-95EE29C953C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4ADE08C2-D14E-4FE6-BF66-95EE29C953C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4ADE08C2-D14E-4FE6-BF66-95EE29C953C6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/utils/x86disasm/Sconstruct-x86disasm b/utils/x86disasm/Sconstruct-x86disasm new file mode 100644 index 0000000..409bcc5 --- /dev/null +++ b/utils/x86disasm/Sconstruct-x86disasm @@ -0,0 +1,93 @@ +import os +import platform +import sys +sys.path.append("../..") +import fileop + +def get_arg(arg_str): + return int((ARGUMENTS.get(arg_str, '0'))) != 0 + +release = get_arg('release') +clean = get_arg('clean') +amd64 = get_arg('amd64') + +system = platform.system().lower() +linux = (system == 'linux') +macosx = (system == 'darwin') +win = (system == 'windows') +assert win or linux or macosx, 'Unsupported platform' + +defs = {} + +if win: + if release: + compiler_flags = '-MD -Ox -Oy ' + defs['NDEBUG'] = None + else: + compiler_flags = '-WX -MTd -Zi -Od ' + defs['_DEBUG'] = None + defs['_DPRINT'] = None + compiler_flags += ' -GS -GF -EHsc ' + defs['WIN'] = None + defs['_CRT_SECURE_NO_DEPRECATE'] = None + defs['_FILE_OFFSET_BITS'] = '64' + defs['WIN32'] = None + defs['_CONSOLE'] = None + linker_flags = '-debug -opt:ref' +elif linux or macosx: + if release: + compiler_flags = '-O3 -fomit-frame-pointer' + defs['NDEBUG'] = None + else: + compiler_flags = '-g' + defs['_DPRINT'] = None + if linux: + defs['LIN'] = None + else: + defs['MACOSX'] = None + linker_flags = ' -pthread ' +else: + assert False, 'Unsupported OS' + +defs['UNITTEST'] = None + +incdirs = ['../../third-party/libudis86'] + +if amd64: + defs['AMD64'] = None + target_arch = 'x86_64' +else: + defs['I386'] = None + target_arch = 'x86' + +project_name = 'x86disasm' + +env = Environment( + ENV = os.environ, + CCFLAGS = compiler_flags, + CPPPATH = incdirs, + CPPDEFINES = defs, + LINKFLAGS = linker_flags, + NAME = project_name, + TARGET_ARCH = target_arch + ) + +if win: + obj_ext = '.obj' +elif linux or macosx: + obj_ext = '.o' +else: + assert False + +dirs = ['.', '../../third-party/libudis86'] + +if clean: + fileop.clean_dirs(dirs, obj_ext) +else: + # Build file list + sources = [] + sources += Glob('./*.cc') + sources += Glob('../../third-party/libudis86/*.c') + # Perform build + env.Program(project_name, sources) + diff --git a/utils/x86disasm/disasm.cc b/utils/x86disasm/disasm.cc new file mode 100644 index 0000000..bd8067b --- /dev/null +++ b/utils/x86disasm/disasm.cc @@ -0,0 +1,295 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "disasm.h" +#include "../../third-party/libudis86/extern.h" + +const size_t kBufSize = 20; + +typedef unsigned char uint8_t; + +static void GenerateBuffer(std::vector * buf) +{ + size_t i; + buf->resize(kBufSize); + for (i = 0; i < kBufSize; i++) + (*buf)[i] = 0x10 + i; +} + +typedef unsigned int operand_encoding_t; +#define OP_ENC_REG 0x80000000UL +#define OP_ENC_MEM 0x40000000UL + +struct InsnDef { + unsigned insn_enc; + size_t count; + operand_encoding_t enc[3]; + uint8_t pfx_rex; + uint8_t pfx_seg; + uint8_t pfx_opr; + uint8_t pfx_adr; + uint8_t pfx_lock; + uint8_t pfx_rep; + uint8_t pfx_repe; + uint8_t pfx_repne; + uint8_t pfx_insn; + + InsnDef(const struct ud & u); + friend bool operator == (const InsnDef & left, const InsnDef & right) + { + return 0 == memcmp(&left, &right, sizeof(InsnDef)); + } + friend bool operator < (const InsnDef & left, const InsnDef & right) + { + return 0 > memcmp(&left, &right, sizeof(InsnDef)); + } + friend bool operator > (const InsnDef & left, const InsnDef & right) + { + return 0 < memcmp(&left, &right, sizeof(InsnDef)); + } +}; + +struct InsnDefCompare { + bool operator() (const InsnDef & left, const InsnDef & right) + { + return left < right; + } +}; +typedef std::set insn_set_t; + +InsnDef::InsnDef(const struct ud & u) + : count(0) +{ + int i; + const struct ud_operand *op; + + pfx_adr = u.pfx_adr; + pfx_insn = u.pfx_insn; + pfx_lock = u.pfx_lock; + pfx_opr = u.pfx_opr; + pfx_rep = u.pfx_rep; + pfx_repe = u.pfx_repe; + pfx_repne = u.pfx_repne; + pfx_rex = u.pfx_rex; + pfx_seg = u.pfx_seg; + insn_enc = u.mnemonic; + memset(enc, 0, sizeof(enc)); + /* + * Encode registers and operand types. Do not encode offsets and + * immediate values. + */ + for (i = 0; i < 3; i++) { + op = &u.operand[i]; + switch (op->type) { + case UD_OP_REG: + enc[i] |= OP_ENC_REG; + enc[i] |= op->base; + break; + case UD_OP_MEM: + /* Encode only registers and scales. */ + enc[i] |= OP_ENC_MEM; + enc[i] |= op->base | (op->index << 8) | (op->scale << 16); + break; + default: + /* Encode operand type other than OP_ENC_MEM or OP_ENC_REG. */ + enc[i] |= op->type; + break; + } + if (op->type != UD_NONE) + count++; + } + +} + +static std::string ReplaceAll(const std::string & str, + const std::string & prev_val, + const std::string & new_val) +{ + size_t pos; + std::string s = str; + + while (true) { + pos = s.find(prev_val); + if (std::string::npos == pos) + break; + s = s.replace(pos, prev_val.size(), new_val); + } + return s; +} + +static const struct { + const char *from; + const char *to; +} repl[] = { + {"retn", "ret"}, + {"retnw", "ret"}, + {"iretw", "iret"}, + {"pushfw", "pushf"}, + {"popfw", "popf"}, + {"enterw", "enter"}, + {"cmovae", "cmovnb"}, + {"cmova", "cmovnbe"}, + {"cmovge", "cmovnl"}, + {"cmovg", "cmovnle"}, + {"setae", "setnb"}, + {"seta", "setnbe"}, + {"setge", "setnl"}, + {"setg", "setnle"}, + {"leavew", "leave"}, + {"int1", "int 01"}, + {"int3", "int 03"} +}; + +/* trim from start */ +static inline std::string <rim(std::string &s) { + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(std::isspace)))); + return s; +} + +/* trim from end */ +static inline std::string &rtrim(std::string &s) { + s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(std::isspace))).base(), s.end()); + return s; +} + +/* trim from both ends */ +static inline std::string &trim(std::string &s) { + return ltrim(rtrim(s)); +} + +static const char *pfx[] = { + "cs", "es", "fs", "gs", "ss", "ds" +}; + +static std::string FixDisassembly(const std::string & disasm) +{ + size_t i, j; + std::string s,s2; + + s = ReplaceAll(disasm, "0x", ""); + s = ReplaceAll(s, "o16 ", ""); + s = ReplaceAll(s, "a16 ", ""); + s = ReplaceAll(s, "a32 ", ""); + for (i = 0; i < _countof(repl); i++) { + s2 = ReplaceAll(s, repl[i].from, repl[i].to); + if (s2 != s) { + s = s2; + break; + } + } + s = trim(s); + for (i = 0; i < 6; i++) { + if (s.substr(0, 3).compare(std::string(pfx[i]) + " ") == 0) { + s = s.substr(3); + break; + } else { + j = s.find(" " + std::string(pfx[i]) + " "); + if (j != s.npos) { + s = s.substr(0, j) + s.substr(j + 3); + break; + } + } + } + return s; +} + +static bool IsInsnUnique(const struct ud & u, insn_set_t *is) +{ + InsnDef insn_def(u); + + insn_set_t::iterator it = is->lower_bound(insn_def); + if (it != is->end() && *it == insn_def) { + return false; + } + is->insert(insn_def); + return true; +} + +static void WriteOutput(FILE * f, const std::vector & buf, size_t size, + const char *disasm) +{ + size_t i; + assert(size <= buf.size()); + for (i = 0; i < size; i++) + fprintf(f, "%02x", buf[i]); + fprintf(f, " %s\n", FixDisassembly(disasm).c_str()); + fflush(f); +} + +static void GenerateToFile(FILE * f, bool x64) +{ + /* Generate buffer */ + std::vector buf; + unsigned int p0, p1, p2; + insn_set_t is; + struct ud u; + unsigned int insn_len, n; + bool disasm_ok; + + n = 0; + GenerateBuffer(&buf); + /* + for (p0 = 0x10; p0 < 0x110; p0++) { + for (p1 = 0x10; p1 < 0x110; p1++) { + for (p2 = 0x10; p2 < 0x110; p2++) { + */ + for (p0 = 0x10; p0 < 0x110; p0++) { + for (p1 = 0x10; p1 < 0x110; p1++) { + for (p2 = 0x10; p2 < 0x110; p2++) { + buf[0] = (p0 & 0xff); + buf[1] = (p1 & 0xff); + buf[2] = (p2 & 0xff); + ud_init(&u); + ud_set_input_buffer(&u, &buf[0], buf.size()); + ud_set_pc(&u, 0x401000); + ud_set_mode(&u, x64 ? 64 : 32); + ud_set_syntax(&u, UD_SYN_INTEL); + ud_set_vendor(&u, UD_VENDOR_INTEL); + + disasm_ok = false; + if ((insn_len = ud_disassemble(&u)) != 0) { + char *disasm = ud_insn_asm(&u); + if (0 != strncmp(disasm, "invalid", 7)) { + disasm_ok = true; + if (IsInsnUnique(u, &is)) { + WriteOutput(f, buf, insn_len, disasm); + n++; + if (n % 10000 == 0) + std::cout << n << " opcodes processed\n"; + } + } + } + if (!disasm_ok) { + /* Cannot disassemble. */ + WriteOutput(f, buf, 10, "db"); + n++; + if (n % 10000 == 0) + std::cout << n << " opcodes processed\n"; + } + } + } + } +} + +int GenerateInstructions(const std::string & out_filename, bool x64) +{ + FILE *f; + + f = fopen(out_filename.c_str(), "wt"); + if (f == NULL) { + std::cerr << "ERROR Cannot open file " << out_filename << "\n"; + return GEN_INSN_IOERROR; + } + + GenerateToFile(f, x64); + + fclose(f); + return GEN_INSN_OKAY; +} + diff --git a/utils/x86disasm/disasm.h b/utils/x86disasm/disasm.h new file mode 100644 index 0000000..0124dcc --- /dev/null +++ b/utils/x86disasm/disasm.h @@ -0,0 +1,15 @@ + + +#ifndef DISASM_H +#define DISASM_H + +#include + +#define GEN_INSN_OKAY 0 +#define GEN_INSN_IOERROR 1 +#define GEN_INSN_ERROR 2 + +int GenerateInstructions(const std::string & out_filename, bool x64); + +#endif + diff --git a/utils/x86disasm/main.cc b/utils/x86disasm/main.cc new file mode 100644 index 0000000..e0d43af --- /dev/null +++ b/utils/x86disasm/main.cc @@ -0,0 +1,24 @@ +#include +#include "disasm.h" + +int main(int argc, char **argv) +{ + int rc; + bool x64; + std::cout << "x86 Disassembly Generator (C) 2012\n"; + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " [x64]\n"; + return 1; + } + if (argc >= 3) { + x64 = (0 == _strnicmp(argv[2], "x64", 3)); + } else { + x64 = false; + } + rc = GenerateInstructions(argv[1], x64); + if (rc == GEN_INSN_OKAY) + std::cout << "Finished\n"; + else + std::cerr << "ERROR Failed with error " << rc << "\n"; + return rc; +} diff --git a/utils/x86disasm/make-x86disasm.py b/utils/x86disasm/make-x86disasm.py new file mode 100644 index 0000000..d7b9fdf --- /dev/null +++ b/utils/x86disasm/make-x86disasm.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +import os +import os.path +import sys +sys.path.append("../..") +import fileop +import utils + +name = "x86disasm" + +def do_clean(): + fileop.clean_dir(".", ".obj") + fileop.clean_dir(".", ".pdb") + fileop.clean_dir(".", ".ilk") + fileop.clean_dir(".", ".exe") + fileop.remove_file(os.path.join(bin_dir, name)) + fileop.remove_file(os.path.join(bin_dir, name + '.exe')) + fileop.remove_file(os.path.join(bin_dir, name + '.pdb')) + fileop.remove_file(os.path.join(bin_dir, name + '.ilk')) + return 0 + +def make(clean, release, x64): + if clean: + do_clean() + result = os.system("scons -f Sconstruct-%s release=%d clean=%d amd64=%d" % (name, release, clean, x64)) + if 0 == result: + # Scons does not put file in the required directory. Do it ourselves. + if utils.get_platform() == 'windows': + os.system("move " + name + ".exe " + bin_dir) + os.system("move " + name + ".pdb " + bin_dir) + os.system("move " + name + ".ilk " + bin_dir) + else: + os.system("mv " + name + " " + bin_dir) + return result + +def title(clean, release, x64): + print "*** %s making ... ***" % name + print "clean = ", clean + print "release = ", release + print "x64 = ", x64 + +def print_result(result): + if 0 == result: + print "*** %s make: OK ***" % name + else: + print "*** %s make: error %d" % (name, result) + +clean = 'clean' in sys.argv +release = 'release' in sys.argv +x64 = 'x64' in sys.argv + +bin_dir = fileop.get_bin_dir('../..', x64, release) +assert os.path.isdir(bin_dir) + +title(clean, release, x64) +result = make(clean, release, x64) +print_result(result) +sys.exit(result) + diff --git a/utils/x86disasm/x86disasm.sln b/utils/x86disasm/x86disasm.sln new file mode 100644 index 0000000..0ba0f4a --- /dev/null +++ b/utils/x86disasm/x86disasm.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86disasm", "x86disasm.vcxproj", "{C4688533-8E09-4F65-A04D-39201C9B2D33}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Debug|Win32.Build.0 = Debug|Win32 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Debug|x64.ActiveCfg = Debug|x64 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Debug|x64.Build.0 = Debug|x64 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Release|Win32.ActiveCfg = Release|Win32 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Release|Win32.Build.0 = Release|Win32 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Release|x64.ActiveCfg = Release|x64 + {C4688533-8E09-4F65-A04D-39201C9B2D33}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/utils/x86disasm/x86disasm.vcxproj b/utils/x86disasm/x86disasm.vcxproj new file mode 100644 index 0000000..fc1cdb6 --- /dev/null +++ b/utils/x86disasm/x86disasm.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {C4688533-8E09-4F65-A04D-39201C9B2D33} + Win32Proj + x86disasm + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)../../bin/i386/$(Configuration) + + + true + $(ProjectDir)../../bin/amd64/$(Configuration) + + + false + $(ProjectDir)../../bin/i386/$(Configuration) + + + false + $(ProjectDir)../../bin/amd64/$(Configuration) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)../../third-party/libudis86;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)../../third-party/libudis86;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)../../third-party/libudis86 + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)../../third-party/libudis86 + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/x86disasm/x86disasm.vcxproj.filters b/utils/x86disasm/x86disasm.vcxproj.filters new file mode 100644 index 0000000..1f99f34 --- /dev/null +++ b/utils/x86disasm/x86disasm.vcxproj.filters @@ -0,0 +1,75 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {0fa6ebf3-658c-4c86-89c7-425c16cf7ba6} + + + + + Source Files + + + Source Files + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + + + Source Files + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + libudis86 + + + \ No newline at end of file -- cgit v1.2.3