summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto-test/crypto-test.mdp27
-rw-r--r--crypto/Contributors.html6
-rw-r--r--crypto/License.html2
-rw-r--r--crypto/NBuild.build492
-rw-r--r--crypto/crypto.csproj139
-rw-r--r--crypto/crypto.mdp2325
-rw-r--r--crypto/src/AssemblyInfo.cs7
-rw-r--r--crypto/src/asn1/Asn1InputStream.cs4
-rw-r--r--crypto/src/asn1/DerBoolean.cs86
-rw-r--r--crypto/src/asn1/DerEnumerated.cs66
-rw-r--r--crypto/src/asn1/isismtt/x509/AdmissionSyntax.csbin20290 -> 20844 bytes
-rw-r--r--crypto/src/asn1/sec/SECNamedCurves.cs2346
-rw-r--r--crypto/src/asn1/x9/ECNamedCurveTable.cs118
-rw-r--r--crypto/src/asn1/x9/X962NamedCurves.cs1428
-rw-r--r--crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs25
-rw-r--r--crypto/src/cms/CMSSignedDataParser.cs5
-rw-r--r--crypto/src/crypto/ec/CustomNamedCurves.cs95
-rw-r--r--crypto/src/crypto/engines/ChaChaEngine.cs189
-rw-r--r--crypto/src/crypto/engines/IdeaEngine.cs46
-rw-r--r--crypto/src/crypto/engines/Salsa20Engine.cs277
-rw-r--r--crypto/src/crypto/engines/XSalsa20Engine.cs71
-rw-r--r--crypto/src/crypto/generators/ECKeyPairGenerator.cs5
-rw-r--r--crypto/src/crypto/generators/Poly1305KeyGenerator.cs123
-rw-r--r--crypto/src/crypto/macs/CMac.cs2
-rw-r--r--crypto/src/crypto/macs/GMac.cs111
-rw-r--r--crypto/src/crypto/macs/Poly1305.cs272
-rw-r--r--crypto/src/crypto/modes/EAXBlockCipher.cs5
-rw-r--r--crypto/src/crypto/modes/GCMBlockCipher.cs5
-rw-r--r--crypto/src/crypto/modes/IAeadBlockCipher.cs3
-rw-r--r--crypto/src/crypto/tls/AlertDescription.cs258
-rw-r--r--crypto/src/crypto/tls/AlertLevel.cs16
-rw-r--r--crypto/src/crypto/tls/ByteQueue.cs10
-rw-r--r--crypto/src/crypto/tls/Certificate.cs228
-rw-r--r--crypto/src/crypto/tls/CertificateRequest.cs176
-rw-r--r--crypto/src/crypto/tls/CipherSuite.cs428
-rw-r--r--crypto/src/crypto/tls/ClientCertificateType.cs37
-rw-r--r--crypto/src/crypto/tls/CompressionMethod.cs32
-rw-r--r--crypto/src/crypto/tls/ContentType.cs21
-rw-r--r--crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs2
-rw-r--r--crypto/src/crypto/tls/DefaultTlsCipherFactory.cs116
-rw-r--r--crypto/src/crypto/tls/DefaultTlsClient.cs350
-rw-r--r--crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs2
-rw-r--r--crypto/src/crypto/tls/ECCurveType.cs46
-rw-r--r--crypto/src/crypto/tls/ECPointFormat.cs24
-rw-r--r--crypto/src/crypto/tls/EncryptionAlgorithm.cs77
-rw-r--r--crypto/src/crypto/tls/ExtensionType.cs81
-rw-r--r--crypto/src/crypto/tls/HandshakeType.cs53
-rw-r--r--crypto/src/crypto/tls/HashAlgorithm.cs18
-rw-r--r--crypto/src/crypto/tls/KeyExchangeAlgorithm.cs81
-rw-r--r--crypto/src/crypto/tls/LegacyTlsAuthentication.cs44
-rw-r--r--crypto/src/crypto/tls/NamedCurve.cs126
-rw-r--r--crypto/src/crypto/tls/PrfAlgorithm.cs25
-rw-r--r--crypto/src/crypto/tls/ProtocolVersion.cs159
-rw-r--r--crypto/src/crypto/tls/PskTlsClient.cs262
-rw-r--r--crypto/src/crypto/tls/RecordStream.cs18
-rw-r--r--crypto/src/crypto/tls/SignatureAlgorithm.cs15
-rw-r--r--crypto/src/crypto/tls/SignatureAndHashAlgorithm.cs94
-rw-r--r--crypto/src/crypto/tls/SrpTlsClient.cs350
-rw-r--r--crypto/src/crypto/tls/TlsBlockCipher.cs194
-rw-r--r--crypto/src/crypto/tls/TlsCipher.cs14
-rw-r--r--crypto/src/crypto/tls/TlsCipherFactory.cs12
-rw-r--r--crypto/src/crypto/tls/TlsClient.cs190
-rw-r--r--crypto/src/crypto/tls/TlsDHKeyExchange.cs374
-rw-r--r--crypto/src/crypto/tls/TlsDheKeyExchange.cs90
-rw-r--r--crypto/src/crypto/tls/TlsECDHKeyExchange.cs10
-rw-r--r--crypto/src/crypto/tls/TlsECDheKeyExchange.cs10
-rw-r--r--crypto/src/crypto/tls/TlsException.cs14
-rw-r--r--crypto/src/crypto/tls/TlsFatalAlert.cs26
-rw-r--r--crypto/src/crypto/tls/TlsMac.cs174
-rw-r--r--crypto/src/crypto/tls/TlsNullCipher.cs42
-rw-r--r--crypto/src/crypto/tls/TlsProtocolHandler.cs119
-rw-r--r--crypto/src/crypto/tls/TlsPskKeyExchange.cs258
-rw-r--r--crypto/src/crypto/tls/TlsRsaKeyExchange.cs224
-rw-r--r--crypto/src/crypto/tls/TlsSrpKeyExchange.cs6
-rw-r--r--crypto/src/crypto/tls/TlsStreamCipher.cs40
-rw-r--r--crypto/src/crypto/tls/TlsUtilities.cs112
-rw-r--r--crypto/src/math/BigInteger.cs4282
-rw-r--r--crypto/src/math/ec/ECCurve.cs7
-rw-r--r--crypto/src/math/ec/ECFieldElement.cs1598
-rw-r--r--crypto/src/math/field/FiniteFields.cs54
-rw-r--r--crypto/src/math/field/GF2Polynomial.cs46
-rw-r--r--crypto/src/math/field/GenericPolynomialExtensionField.cs63
-rw-r--r--crypto/src/math/field/IExtensionField.cs12
-rw-r--r--crypto/src/math/field/IFiniteField.cs11
-rw-r--r--crypto/src/math/field/IPolynomial.cs15
-rw-r--r--crypto/src/math/field/IPolynomialExtensionField.cs10
-rw-r--r--crypto/src/math/field/PrimeField.cs44
-rw-r--r--crypto/src/openpgp/PgpUtilities.cs13
-rw-r--r--crypto/src/pkcs/Pkcs12Store.cs3
-rw-r--r--crypto/src/pkix/PkixCertPathValidatorUtilities.cs10
-rw-r--r--crypto/src/pkix/Rfc3280CertPathUtilities.cs8
-rw-r--r--crypto/src/pkix/Rfc3281CertPathUtilities.cs8
-rw-r--r--crypto/src/security/CipherUtilities.cs4
-rw-r--r--crypto/src/security/DotNetUtilities.cs47
-rw-r--r--crypto/src/security/MacUtilities.cs11
-rw-r--r--crypto/src/security/ParameterUtilities.cs6
-rw-r--r--crypto/src/util/Arrays.cs389
-rw-r--r--crypto/src/util/BigIntegers.cs6
-rw-r--r--crypto/src/util/Enums.cs6
-rw-r--r--crypto/src/util/Integers.cs17
-rw-r--r--crypto/src/util/Platform.cs96
-rw-r--r--crypto/src/util/Strings.cs86
-rw-r--r--crypto/src/util/collections/CollectionUtilities.cs65
-rw-r--r--crypto/test/src/asn1/test/EnumeratedTest.cs115
-rw-r--r--crypto/test/src/asn1/test/MiscTest.cs168
-rw-r--r--crypto/test/src/cms/test/SignedDataStreamTest.cs20
-rw-r--r--crypto/test/src/crypto/test/ChaChaTest.cs319
-rw-r--r--crypto/test/src/crypto/test/GMacTest.cs184
-rw-r--r--crypto/test/src/crypto/test/IDEATest.cs40
-rw-r--r--crypto/test/src/crypto/test/Poly1305Test.cs395
-rw-r--r--crypto/test/src/crypto/test/RegressionTest.cs8
-rw-r--r--crypto/test/src/crypto/test/Salsa20Test.cs69
-rw-r--r--crypto/test/src/crypto/test/XSalsa20Test.cs183
-rw-r--r--crypto/test/src/math/ec/test/ECPointPerformanceTest.cs162
-rw-r--r--crypto/test/src/math/ec/test/ECPointTest.cs858
-rw-r--r--crypto/test/src/openpgp/test/PGPRSATest.cs1358
-rw-r--r--crypto/test/src/openpgp/test/PgpKeyRingTest.cs4024
-rw-r--r--crypto/test/src/test/BlockCipherTest.cs7
-rw-r--r--crypto/test/src/test/nist/NistCertPathTest.cs2
-rw-r--r--csharp.mds20
120 files changed, 14821 insertions, 13366 deletions
diff --git a/crypto-test/crypto-test.mdp b/crypto-test/crypto-test.mdp
deleted file mode 100644
index a9c3a30ba..000000000
--- a/crypto-test/crypto-test.mdp
+++ /dev/null
@@ -1,27 +0,0 @@
-<Project name="crypto-test" fileversion="2.0" DefaultNamespace="cryptotest" language="C#" clr-version="Net_2_0" targetFramework="1.1" ctype="DotNetProject">
-  <Configurations active="Release">
-    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
-      <Output directory="bin/Debug/" assembly="crypto-test" />
-      <Build debugmode="True" target="Exe" />
-      <Execution consolepause="False" runwithwarnings="False" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="NET_1_1" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-    <Configuration name="Release" ctype="DotNetProjectConfiguration">
-      <Output directory="bin/Release/" assembly="crypto-test" />
-      <Build debugmode="False" target="Exe" />
-      <Execution consolepause="True" runwithwarnings="False" runtime="MsNet" clr-version="Net_2_0" />
-      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="NET_1_1" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
-    </Configuration>
-  </Configurations>
-  <Contents>
-    <File subtype="Code" buildaction="Exclude" name="App.ico" />
-    <File subtype="Code" buildaction="Compile" name="CryptoTest.cs" />
-  </Contents>
-  <References>
-    <ProjectReference type="Project" localcopy="True" refto="crypto" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  </References>
-  <DeploymentInformation strategy="File" />
-</Project>
\ No newline at end of file
diff --git a/crypto/Contributors.html b/crypto/Contributors.html
index b37af312f..7e3e1a88e 100644
--- a/crypto/Contributors.html
+++ b/crypto/Contributors.html
@@ -111,6 +111,12 @@
 			<li>
 				<p>Laszlo Magyar &lt;lmagyar1973&#064gmail.com&gt; - patch to fix problem with SubjectDirectoryAttributes constructor.</p>
 			</li>
+			<li>
+				<p>Tim Whittington (https://github.com/timw) - ports of ChaCha, GMAC, Poly1305, XSalsa20. Registerised Salsa20 core.</p>
+			</li>
+			<li>
+				<p>Oscar Jacobsson (https://github.com/OscarAyoy) - patch to fix DerEnumerated constructor (including test coverage).</p>
+			</li>
 		</ul>
 	</body>
 </html>
diff --git a/crypto/License.html b/crypto/License.html
index 7213058e7..8076a183e 100644
--- a/crypto/License.html
+++ b/crypto/License.html
@@ -9,7 +9,7 @@
 <h2>The Bouncy Castle Cryptographic C#&reg; API</h2>
 <h3>License:</h3>
 The Bouncy Castle License<br>
-Copyright (c) 2000-2013 The Legion Of The Bouncy Castle
+Copyright (c) 2000-2013 The Legion of the Bouncy Castle Inc.
 (http://www.bouncycastle.org)<br>
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"), to deal in the
diff --git a/crypto/NBuild.build b/crypto/NBuild.build
index 9c4488c38..033c7079f 100644
--- a/crypto/NBuild.build
+++ b/crypto/NBuild.build
@@ -1,265 +1,243 @@
 <?xml version="1.0"?>
 <project name="bccrypto-csharp" default="compile-release" basedir=".">
 
-	<!-- Source control properties -->
-	<property name="CVSROOT"
-		value=":pserver:anonymous@cvs.bouncycastle.org:/home/users/bouncy/cvsroot" />
-	<property name="sourcecontrol.usesharpcvslib" value="false" />
-	<property name="CVSCMD" value="C:/Program Files (x86)/CVSNT/cvs.exe" />
+  <!-- Source control properties -->
+  <property name="CVSROOT"
+    value=":pserver:anonymous@cvs.bouncycastle.org:/home/users/bouncy/cvsroot" />
+  <property name="sourcecontrol.usesharpcvslib" value="false" />
+  <property name="CVSCMD" value="C:/Program Files (x86)/CVSNT/cvs.exe" />
   <!--<property name="CVSCMD" value="C:/Program Files/CVSNT/cvs.exe" />-->
   <!--<property name="CVSCMD" value="/usr/bin/cvs" />-->
 
-	<property name="api-debugpath" value="./api/bin/debug" />
-	<property name="api-releasepath" value="./api/bin/release" />
-	<property name="api-srcpath" value="./src" />
-	<property name="bzip2-srcpath" value="./bzip2/src" />
-	<property name="test-srcpath" value="./test/src" />
-	<property name="test-datapath" value="./test/data" />
-	<property name="api-spikepath" value="./spike" />
-	<property name="test-libpath" value="./test/lib" />
-	<property name="test-binpath" value="./test/bin"/>
-	<property name="dist-path" value="./dist"/>
-
-	<!-- Version -->
-	<property name="version" value="1.7"/>
-	<property name="name" value="BouncyCastle.Crypto"/>
-	<property name="name-ext" value="BouncyCastle.CryptoExt"/>
-
-	<property name="OPTIONAL_INCLUDE_IDEA" value="" />
-	<if test="${file::exists(api-srcpath + '/crypto/engines/IdeaEngine.cs')}">
-		<echo>Include extended algorithm set (IDEA)</echo> 
-		<property name="OPTIONAL_INCLUDE_IDEA" value=";INCLUDE_IDEA" />
-	</if>
-
-	<property name="OPTIONAL_STRONG_NAME" value="" />
-	<if test="${property::exists('use-strong-name') and use-strong-name}">
-		<echo>Compile targets will be signed using keyfile ../BouncyCastle.snk</echo> 
-		<property name="OPTIONAL_STRONG_NAME" value=";STRONG_NAME" />
-	</if>
-
-	<target name="init">
-		<call target="set-framework-props" />
-	</target>
-
-	<target name="set-framework-props">
-		<if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-props'))}">
-			<fail message="Unsupported framework: '${framework::get-target-framework()}'." />
-		</if>
-		<call target="set-${framework::get-target-framework()}-framework-props" />
-	</target>
-	<target name="set-mono-1.0-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="dll.mdb" />
-		<property name="enable-nostdlib" value="false" />
-		<property name="nunit-console" value="nunit-console" />
-		<property name="switch" value="-" />
-	</target>
-	<target name="set-mono-2.0-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="dll.mdb" />
-		<property name="enable-nostdlib" value="false" />
-		<property name="nunit-console" value="nunit-console" />
-		<property name="switch" value="-" />
-	</target>
-	<target name="set-net-1.1-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-net-2.0-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-net-3.5-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-net-4.0-framework-props">
-		<property name="compile-defines" value="NET_1_1" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-netcf-1.0-framework-props">
-		<property name="compile-defines" value="NETCF_1_0" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-netcf-2.0-framework-props">
-		<property name="compile-defines" value="NETCF_2_0" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-silverlight-2.0-framework-props">
-		<property name="compile-defines" value="SILVERLIGHT" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-silverlight-3.0-framework-props">
-		<property name="compile-defines" value="SILVERLIGHT" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-	<target name="set-silverlight-4.0-framework-props">
-		<property name="compile-defines" value="SILVERLIGHT" />
-		<property name="debug-extension" value="pdb" />
-		<property name="enable-nostdlib" value="true" />
-		<property name="nunit-console" value="nunit-console.exe" />
-		<property name="switch" value="/" />
-	</target>
-
-	<target name="clean">
-		<delete failonerror="false" dir="./api" />
-		<delete failonerror="false" dir="${dist-path}" />
-		<delete failonerror="false" dir="${test-binpath}" />
-		<delete failonerror="false" file="./TestResult.xml" />
-	</target>
-
-	<!-- Compile api in debug mode and compile tests -->
-	<target name="compile-debug" depends="init">
-		<echo message="Compiling Debug"/>
-		<echo message="Compiling API in debug mode."/>
-		<mkdir dir="${api-debugpath}"/>
-		<csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${api-debugpath}/${name}.dll"
-			verbose="false" debug="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}${OPTIONAL_INCLUDE_IDEA}">
-			<sources>
-				<include name="${api-srcpath}/**/*.cs"/>
-				<include name="${bzip2-srcpath}/**/*.cs"/>
-			</sources>
-			<references>
-				<include name="mscorlib.dll"/>
-				<include name="System.dll"/>
-			</references>
-		</csc>
-
-		<copy todir="${test-binpath}">
-			<fileset basedir="${test-libpath}">
-				<include name="*.dll" />
-			</fileset>
-		</copy>
-		<copy file="${api-debugpath}/${name}.dll" tofile="${test-binpath}/${name}.dll" />
-		<copy file="${api-debugpath}/${name}.${debug-extension}"
-				tofile="${test-binpath}/${name}.${debug-extension}" />
-
-		<echo message="Compiling Tests."/>
-		<mkdir dir="${api-debugpath}"/>
-		<csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${test-binpath}/BCTest.dll"
-			verbose="false" debug="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}${OPTIONAL_INCLUDE_IDEA}">
-			<sources>
-				<include name="${test-srcpath}/**/*.cs"/>
-			</sources>
-			<resources prefix="crypto" dynamicprefix="true">
-				<include name="${test-datapath}/**/*.*"/>
-				<exclude name="${test-datapath}/**/README.txt"/>
-			</resources>
-			<references>
-				<include name="mscorlib.dll"/>
-				<include name="System.dll"/>
-				<include name="${test-libpath}/*.dll"/>
-				<include name="${test-binpath}/${name}.dll"/>
-			</references>
-		</csc>
-	</target>
-
-	<!-- Compile Release.-->
-	<target name="compile-release" depends="init">
-		<echo message="Compiling Release"/>
-		<echo message="Compiling API in release mode."/>
-		<mkdir dir="${api-releasepath}"/>
-		<csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${api-releasepath}/${name}.dll"
-			verbose="false" debug="false" optimize="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}${OPTIONAL_INCLUDE_IDEA}">
-			<sources>
-				<include name="${api-srcpath}/**/*.cs"/>
-				<include name="${bzip2-srcpath}/**/*.cs"/>
-			</sources>
-			<references>
-				<include name="mscorlib.dll"/>
-				<include name="System.dll"/>
-			</references>
-		</csc>
-	</target>
-
-	<!-- Make distribution.-->
-	<target name="dist" depends="init">
-		<echo message="Building signed assemblies for release ${version}"/>
-		<mkdir dir="${dist-path}"/>
-		<cvs-export cvsfullpath="${CVSCMD}" cvsroot="${CVSROOT}"
-			destination="${dist-path}/src" module="csharp" revision="release-${string::replace(version,'.','_')}" />
-
-		<!-- One version without the IDEA stuff -->
-		<csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${dist-path}/${name}.dll"
-			verbose="false" debug="false" optimize="true" define="${compile-defines};STRONG_NAME">
-			<sources>
-				<include name="${dist-path}/src/csharp/crypto/${api-srcpath}/**/*.cs"/>
-				<include name="${dist-path}/src/csharp/crypto/${bzip2-srcpath}/**/*.cs"/>
-				<exclude name="${dist-path}/src/csharp/crypto/${api-srcpath}/asn1/misc/IDEACBCPar.cs"/>
-				<exclude name="${dist-path}/src/csharp/crypto/${api-srcpath}/crypto/engines/IdeaEngine.cs"/>
-			</sources>
-			<references>
-				<include name="mscorlib.dll"/>
-				<include name="System.dll"/>
-			</references>
-		</csc>
-		<zip zipfile="${dist-path}/bccrypto-net-${version}-bin.zip">
-			<fileset basedir="${dist-path}">
-				<include name="${name}.dll" />
-			</fileset>
-		</zip>
-		<zip zipfile="${dist-path}/bccrypto-net-${version}-src.zip">
-			<fileset basedir="${dist-path}/src">
-				<include name="**/*"/>
-				<exclude name="csharp/crypto/${api-srcpath}/asn1/misc/IDEACBCPar.cs"/>
-				<exclude name="csharp/crypto/${api-srcpath}/crypto/engines/IdeaEngine.cs"/>
-				<exclude name="csharp/crypto/${test-srcpath}/crypto/test/IDEATest.cs"/>
-			</fileset>
-		</zip>
-
-		<!-- One version with everything -->
-		<csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${dist-path}/${name-ext}.dll"
-			verbose="false" debug="false" optimize="true" define="${compile-defines};STRONG_NAME;INCLUDE_IDEA">
-			<sources>
-				<include name="${dist-path}/src/csharp/crypto/${api-srcpath}/**/*.cs"/>
-				<include name="${dist-path}/src/csharp/crypto/${bzip2-srcpath}/**/*.cs"/>
-			</sources>
-			<references>
-				<include name="mscorlib.dll"/>
-				<include name="System.dll"/>
-			</references>
-		</csc>
-		<zip zipfile="${dist-path}/bccrypto-net-${version}-bin-ext.zip">
-			<fileset basedir="${dist-path}">
-				<include name="${name-ext}.dll" />
-			</fileset>
-		</zip>
-		<zip zipfile="${dist-path}/bccrypto-net-${version}-src-ext.zip">
-			<fileset basedir="${dist-path}/src">
-				<include name="**/*"/>
-			</fileset>
-		</zip>
-
-	</target>
-
-	<target name="all" depends="compile-debug, compile-release"/>
-
-	<target name="test" depends="compile-debug">
-		<exec program="${nunit-console}" commandline="${switch}labels testcfg.nunit" workingdir="${nant.project.basedir}"></exec>
-	</target>
+  <property name="api-debugpath" value="./api/bin/debug" />
+  <property name="api-releasepath" value="./api/bin/release" />
+  <property name="api-srcpath" value="./src" />
+  <property name="bzip2-srcpath" value="./bzip2/src" />
+  <property name="test-srcpath" value="./test/src" />
+  <property name="test-datapath" value="./test/data" />
+  <property name="test-libpath" value="./test/lib" />
+  <property name="test-binpath" value="./test/bin"/>
+  <property name="dist-path" value="./dist"/>
+
+  <!-- Version -->
+  <property name="version" value="1.7"/>
+  <property name="name" value="BouncyCastle.Crypto"/>
+
+  <property name="OPTIONAL_STRONG_NAME" value="" />
+  <if test="${property::exists('use-strong-name') and use-strong-name}">
+    <echo>Compile targets will be signed using keyfile ../BouncyCastle.snk</echo> 
+    <property name="OPTIONAL_STRONG_NAME" value=";STRONG_NAME" />
+  </if>
+
+  <target name="init">
+    <call target="set-framework-props" />
+  </target>
+
+  <target name="set-framework-props">
+    <if test="${not(target::exists('set-'+framework::get-target-framework()+'-framework-props'))}">
+      <fail message="Unsupported framework: '${framework::get-target-framework()}'." />
+    </if>
+    <call target="set-${framework::get-target-framework()}-framework-props" />
+  </target>
+  <target name="set-mono-1.0-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="dll.mdb" />
+    <property name="enable-nostdlib" value="false" />
+    <property name="nunit-console" value="nunit-console" />
+    <property name="switch" value="-" />
+  </target>
+  <target name="set-mono-2.0-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="dll.mdb" />
+    <property name="enable-nostdlib" value="false" />
+    <property name="nunit-console" value="nunit-console" />
+    <property name="switch" value="-" />
+  </target>
+  <target name="set-mono-3.5-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="dll.mdb" />
+    <property name="enable-nostdlib" value="false" />
+    <property name="nunit-console" value="nunit-console" />
+    <property name="switch" value="-" />
+  </target>
+  <target name="set-mono-4.0-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="dll.mdb" />
+    <property name="enable-nostdlib" value="false" />
+    <property name="nunit-console" value="nunit-console" />
+    <property name="switch" value="-" />
+  </target>
+  <target name="set-net-1.1-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-net-2.0-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-net-3.5-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-net-4.0-framework-props">
+    <property name="compile-defines" value="NET_1_1" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-netcf-1.0-framework-props">
+    <property name="compile-defines" value="NETCF_1_0" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-netcf-2.0-framework-props">
+    <property name="compile-defines" value="NETCF_2_0" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-silverlight-2.0-framework-props">
+    <property name="compile-defines" value="SILVERLIGHT" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-silverlight-3.0-framework-props">
+    <property name="compile-defines" value="SILVERLIGHT" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+  <target name="set-silverlight-4.0-framework-props">
+    <property name="compile-defines" value="SILVERLIGHT" />
+    <property name="debug-extension" value="pdb" />
+    <property name="enable-nostdlib" value="true" />
+    <property name="nunit-console" value="nunit-console.exe" />
+    <property name="switch" value="/" />
+  </target>
+
+  <target name="clean">
+    <delete failonerror="false" dir="./api" />
+    <delete failonerror="false" dir="${dist-path}" />
+    <delete failonerror="false" dir="${test-binpath}" />
+    <delete failonerror="false" file="./TestResult.xml" />
+  </target>
+
+  <!-- Compile api in debug mode and compile tests -->
+  <target name="compile-debug" depends="init">
+    <echo message="Compiling Debug"/>
+    <echo message="Compiling API in debug mode."/>
+    <mkdir dir="${api-debugpath}"/>
+    <csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${api-debugpath}/${name}.dll"
+      verbose="false" debug="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}">
+      <sources>
+        <include name="${api-srcpath}/**/*.cs"/>
+        <include name="${bzip2-srcpath}/**/*.cs"/>
+      </sources>
+      <references>
+        <include name="mscorlib.dll"/>
+        <include name="System.dll"/>
+      </references>
+    </csc>
+
+    <copy todir="${test-binpath}">
+      <fileset basedir="${test-libpath}">
+        <include name="*.dll" />
+      </fileset>
+    </copy>
+    <copy file="${api-debugpath}/${name}.dll" tofile="${test-binpath}/${name}.dll" />
+    <copy file="${api-debugpath}/${name}.${debug-extension}"
+        tofile="${test-binpath}/${name}.${debug-extension}" />
+
+    <echo message="Compiling Tests."/>
+    <mkdir dir="${api-debugpath}"/>
+    <csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${test-binpath}/BCTest.dll"
+      verbose="false" debug="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}">
+      <sources>
+        <include name="${test-srcpath}/**/*.cs"/>
+      </sources>
+      <resources prefix="crypto" dynamicprefix="true">
+        <include name="${test-datapath}/**/*.*"/>
+        <exclude name="${test-datapath}/**/README.txt"/>
+      </resources>
+      <references>
+        <include name="mscorlib.dll"/>
+        <include name="System.dll"/>
+        <include name="${test-libpath}/*.dll"/>
+        <include name="${test-binpath}/${name}.dll"/>
+      </references>
+    </csc>
+  </target>
+
+  <!-- Compile Release.-->
+  <target name="compile-release" depends="init">
+    <echo message="Compiling Release"/>
+    <echo message="Compiling API in release mode."/>
+    <mkdir dir="${api-releasepath}"/>
+    <csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${api-releasepath}/${name}.dll"
+      verbose="false" debug="false" optimize="true" define="${compile-defines}${OPTIONAL_STRONG_NAME}">
+      <sources>
+        <include name="${api-srcpath}/**/*.cs"/>
+        <include name="${bzip2-srcpath}/**/*.cs"/>
+      </sources>
+      <references>
+        <include name="mscorlib.dll"/>
+        <include name="System.dll"/>
+      </references>
+    </csc>
+  </target>
+
+  <!-- Make distribution.-->
+  <target name="dist" depends="init">
+    <echo message="Building signed assemblies for release ${version}"/>
+    <mkdir dir="${dist-path}"/>
+    <cvs-export cvsfullpath="${CVSCMD}" cvsroot="${CVSROOT}"
+      destination="${dist-path}/src" module="csharp" revision="release-${string::replace(version,'.','_')}" />
+
+    <!-- One version with everything -->
+    <csc target="library" noconfig="true" nostdlib="${enable-nostdlib}" output="${dist-path}/${name}.dll"
+      verbose="false" debug="false" optimize="true" define="${compile-defines};STRONG_NAME">
+      <sources>
+        <include name="${dist-path}/src/csharp/crypto/${api-srcpath}/**/*.cs"/>
+        <include name="${dist-path}/src/csharp/crypto/${bzip2-srcpath}/**/*.cs"/>
+      </sources>
+      <references>
+        <include name="mscorlib.dll"/>
+        <include name="System.dll"/>
+      </references>
+    </csc>
+    <zip zipfile="${dist-path}/bccrypto-net-${version}-bin.zip">
+      <fileset basedir="${dist-path}">
+        <include name="${name}.dll" />
+      </fileset>
+    </zip>
+    <zip zipfile="${dist-path}/bccrypto-net-${version}-src.zip">
+      <fileset basedir="${dist-path}/src">
+        <include name="**/*"/>
+      </fileset>
+    </zip>
+
+  </target>
+
+  <target name="all" depends="compile-debug, compile-release"/>
+
+  <target name="test" depends="compile-debug">
+    <exec program="${nunit-console}" commandline="${switch}labels testcfg.nunit" workingdir="${nant.project.basedir}"></exec>
+  </target>
 
 </project>
diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj
index 76c91ae2b..2a326e384 100644
--- a/crypto/crypto.csproj
+++ b/crypto/crypto.csproj
@@ -28,7 +28,7 @@
                     BaseAddress = "285212672"
                     CheckForOverflowUnderflow = "false"
                     ConfigurationOverrideFile = ""
-                    DefineConstants = "DEBUG;TRACE;INCLUDE_IDEA;NET_1_1"
+                    DefineConstants = "DEBUG;TRACE;NET_1_1"
                     DocumentationFile = "doc\crypto.xml"
                     DebugSymbols = "true"
                     FileAlignment = "4096"
@@ -48,7 +48,7 @@
                     BaseAddress = "285212672"
                     CheckForOverflowUnderflow = "false"
                     ConfigurationOverrideFile = ""
-                    DefineConstants = "TRACE;INCLUDE_IDEA;NET_1_1"
+                    DefineConstants = "TRACE;NET_1_1"
                     DocumentationFile = "doc\crypto.xml"
                     DebugSymbols = "false"
                     FileAlignment = "4096"
@@ -2199,6 +2199,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\asn1\x9\ECNamedCurveTable.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\asn1\x9\KeySpecificInfo.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3259,6 +3264,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\ec\CustomNamedCurves.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\encodings\ISO9796d1Encoding.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3324,6 +3334,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\engines\ChaChaEngine.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\engines\DESedeEngine.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3499,6 +3514,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\engines\XSalsa20Engine.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\engines\XTEAEngine.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3619,6 +3639,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\generators\Poly1305KeyGenerator.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\generators\RSABlindingFactorGenerator.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3669,6 +3694,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\macs\GMac.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\macs\GOST28147Mac.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -3679,6 +3709,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\macs\Poly1305.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\macs\SipHash.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -4299,6 +4334,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\tls\HashAlgorithm.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\tls\ICertificateVerifyer.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -4324,6 +4364,16 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\tls\PrfAlgorithm.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\crypto\tls\ProtocolVersion.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\tls\PskTlsClient.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -4339,6 +4389,16 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\crypto\tls\SignatureAlgorithm.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\crypto\tls\SignatureAndHashAlgorithm.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\crypto\tls\SrpTlsClient.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -4444,11 +4504,6 @@
                     BuildAction = "Compile"
                 />
                 <File
-                    RelPath = "src\crypto\tls\TlsException.cs"
-                    SubType = "Code"
-                    BuildAction = "Compile"
-                />
-                <File
                     RelPath = "src\crypto\tls\TlsFatalAlert.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -4624,6 +4679,46 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\math\field\FiniteFields.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\GF2Polynomial.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\GenericPolynomialExtensionField.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\IExtensionField.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\IFiniteField.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\IPolynomial.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\IPolynomialExtensionField.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "src\math\field\PrimeField.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\ocsp\BasicOCSPResp.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -5324,6 +5419,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "src\util\Integers.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "src\util\Platform.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -9187,6 +9287,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "test\src\asn1\test\EnumeratedTest.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "test\src\asn1\test\EssCertIDv2UnitTest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -9567,6 +9672,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "test\src\crypto\test\ChaChaTest.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "test\src\crypto\test\CipherTest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -9667,6 +9777,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "test\src\crypto\test\GMacTest.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "test\src\crypto\test\OCBTest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -9802,6 +9917,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "test\src\crypto\test\Poly1305Test.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "test\src\crypto\test\PSSBlindTest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
@@ -10037,6 +10157,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "test\src\crypto\test\XSalsa20Test.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "test\src\crypto\test\XTEATest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
diff --git a/crypto/crypto.mdp b/crypto/crypto.mdp
deleted file mode 100644
index 0e2349801..000000000
--- a/crypto/crypto.mdp
+++ /dev/null
@@ -1,2325 +0,0 @@
-<Project name="crypto" fileversion="2.0" DefaultNamespace="crypto" language="C#" clr-version="Net_1_1" targetFramework="1.1" ctype="DotNetProject">
-  <Policies>
-    <TextStylePolicy FileWidth="120" TabWidth="4" RemoveTrailingWhitespace="True" inheritsSet="Mono" inheritsScope="text/plain" />
-    <DotNetNamingPolicy DirectoryNamespaceAssociation="None" ResourceNamePolicy="MSBuild" />
-  </Policies>
-  <Configurations active="Release">
-    <Configuration name="Debug" ctype="DotNetProjectConfiguration">
-      <Output directory="bin/Debug/" assembly="crypto" assemblyKeyFile="." />
-      <Build debugmode="True" target="Library" />
-      <Execution consolepause="True" runwithwarnings="False" runtime="MsNet" clr-version="Net_1_1" />
-      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="BC_BUILD_MONODEVELOP;INCLUDE_IDEA;NET_1_1" generatexmldocumentation="False" langversion="ISO_1" ctype="CSharpCompilerParameters" />
-    </Configuration>
-    <Configuration name="Release" ctype="DotNetProjectConfiguration">
-      <Output directory="bin/Release/" assembly="crypto" />
-      <Build debugmode="False" target="Library" />
-      <Execution consolepause="True" runwithwarnings="False" runtime="MsNet" clr-version="Net_1_1" />
-      <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="BC_BUILD_MONODEVELOP;INCLUDE_IDEA;NET_1_1" generatexmldocumentation="False" langversion="ISO_1" ctype="CSharpCompilerParameters" />
-    </Configuration>
-  </Configurations>
-  <Contents>
-    <File subtype="Code" buildaction="Exclude" name="Contributors.html" />
-    <File subtype="Code" buildaction="Exclude" name="License.html" />
-    <File subtype="Code" buildaction="Nothing" name="NBuild.build" />
-    <File subtype="Code" buildaction="Exclude" name="Readme.html" />
-    <File subtype="Code" buildaction="Nothing" name="testcfg.nunit" />
-    <File subtype="Code" buildaction="Compile" name="src/AssemblyInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Encodable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1EncodableVector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1InputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Null.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Object.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1OctetString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1OutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Sequence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Set.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1TaggedObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Tags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerNull.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerOctetString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerSequence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerSet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerTaggedObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerApplicationSpecific.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerBitString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerBMPString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerBoolean.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerEnumerated.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerGeneralizedTime.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerGeneralString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerIA5String.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerInteger.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerNull.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerNumericString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerObjectIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerOctetString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerPrintableString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerSequence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerSet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerT61String.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerTaggedObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerUniversalString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerUnknownTag.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerUTCTime.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerUTF8String.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerVisibleString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/IAsn1Convertible.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/IAsn1String.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/OidTokenizer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CmpObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIFailureInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIFreeText.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIStatusInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/Attribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/AttributeTable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/CMSAttributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/CMSObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/CompressedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/ContentInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/EncryptedContentInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/EnvelopedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/IssuerAndSerialNumber.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/KEKIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/KEKRecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/KeyAgreeRecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/KeyTransRecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OriginatorIdentifierOrKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OriginatorInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OriginatorPublicKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OtherKeyAttribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OtherRecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/OtherRevocationInfoFormat.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/PasswordRecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/RecipientIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/RecipientInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/RecipientKeyIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/SCVPReqRes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/SignedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/SignerIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/SignerInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/Time.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/CryptoProObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/ECGOST3410NamedCurves.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/GOST28147Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/GOST3410NamedParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/GOST3410ParamSetParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CommitmentTypeIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CommitmentTypeIndication.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CommitmentTypeQualifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/ESFAttributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/SignerLocation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/ContentIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/ESSCertID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/OtherCertID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/OtherSigningCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/SigningCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/gnu/GNUObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/icao/CscaMasterList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/icao/DataGroupHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/icao/ICAOObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/icao/LDSSecurityObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/CAST5CBCParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/IDEACBCPar.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/MiscObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/NetscapeCertType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/NetscapeRevocationURL.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/misc/VerisignCzagExtension.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/mozilla/PublicKeyAndChallenge.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/nist/NISTNamedCurves.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/nist/NISTObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/BasicOCSPResponse.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/CertID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/CertStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/CrlID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/OCSPObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/OCSPRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/OCSPResponse.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/OCSPResponseStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/Request.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/ResponderID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/ResponseBytes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/ResponseData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/RevokedInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/ServiceLocator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/Signature.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/SingleResponse.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ocsp/TBSRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/oiw/ElGamalParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/oiw/OIWObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/Attribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/AuthenticatedSafe.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/CertBag.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/CertificationRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/CertificationRequestInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/ContentInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/DHParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/EncryptedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/EncryptedPrivateKeyInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/EncryptionScheme.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/IssuerAndSerialNumber.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/KeyDerivationFunc.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/MacData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PBEParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PBES2Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PBKDF2Params.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/Pfx.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PKCS12PBEParams.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PKCSObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/PrivateKeyInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/RC2CBCParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/RSAPrivateKeyStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/SafeBag.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/SignedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/SignerInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/sec/ECPrivateKeyStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/sec/SECNamedCurves.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/sec/SECObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMEAttributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMECapabilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMECapabilitiesAttribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMECapability.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMECapabilityVector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/teletrust/TeleTrusTObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/tsp/Accuracy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/tsp/MessageImprint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/tsp/TimeStampReq.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/tsp/TimeStampResp.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/tsp/TSTInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/util/Asn1Dump.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/util/Dump.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/util/FilterStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AccessDescription.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AlgorithmIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AttCertIssuer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AttCertValidityPeriod.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/Attribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AttributeCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AttributeCertificateInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AttributeTable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AuthorityInformationAccess.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/AuthorityKeyIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/BasicConstraints.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CertificateList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CertificatePair.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CertificatePolicies.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CertPolicyId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CRLDistPoint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CRLNumber.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/CRLReason.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/DigestInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/DisplayText.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/DistributionPoint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/DistributionPointName.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/DSAParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/ExtendedKeyUsage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/GeneralName.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/GeneralNames.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/GeneralSubtree.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/Holder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/IetfAttrSyntax.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/IssuerSerial.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/IssuingDistributionPoint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/KeyPurposeId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/KeyUsage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/NameConstraints.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/NoticeReference.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/ObjectDigestInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/PolicyInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/PolicyMappings.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/PolicyQualifierId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/PolicyQualifierInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/ReasonFlags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/RoleSyntax.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/RSAPublicKeyStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/SubjectDirectoryAttributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/SubjectKeyIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/SubjectPublicKeyInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/TBSCertificateStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/TBSCertList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/Time.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/UserNotice.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/V1TBSCertificateGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/V2AttributeCertificateInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/V2Form.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/V2TBSCertListGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/V3TBSCertificateGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509Attributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509CertificateStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509DefaultEntryConverter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509Extension.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509Extensions.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509Name.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509NameEntryConverter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509NameTokenizer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509ObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/BiometricData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/Iso4217CurrencyCode.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/MonetaryValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/QCStatement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/SemanticsInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/qualified/TypeOfBiometricData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/sigi/SigIObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/DHDomainParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/DHPublicKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/DHValidationParms.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/KeySpecificInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/OtherInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X962NamedCurves.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X962Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9Curve.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9ECParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9ECPoint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9FieldElement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9FieldID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9IntegerConverter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9ObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ArmoredInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ArmoredOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/BcpgInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/BcpgObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/BcpgOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/CompressedDataPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/CompressionAlgorithmTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ContainedPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/Crc24.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/DsaPublicBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/DsaSecretBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ElGamalPublicBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ElGamalSecretBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ExperimentalPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/HashAlgorithmTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/IBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/InputStreamPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/LiteralDataPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/MarkerPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/ModDetectionCodePacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/MPInteger.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/OnePassSignaturePacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/OutputStreamPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/Packet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/PacketTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/PublicKeyAlgorithmTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/PublicKeyEncSessionPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/PublicKeyPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/PublicSubkeyPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/RsaPublicBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/RsaSecretBcpgKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/S2k.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SecretKeyPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SecretSubkeyPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SignaturePacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SignatureSubpacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SignatureSubpacketsReader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SignatureSubpacketTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SymmetricEncDataPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SymmetricEncIntegrityPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SymmetricKeyAlgorithmTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/SymmetricKeyEncSessionPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/TrustPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/UserAttributePacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/UserAttributeSubpacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/UserAttributeSubpacketsReader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/UserAttributeSubpacketTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/UserIdPacket.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/attr/ImageAttrib.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/Exportable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/IssuerKeyId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/KeyExpirationTime.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/KeyFlags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/PreferredAlgorithms.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/PrimaryUserId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/Revocable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/SignatureCreationTime.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/SignatureExpirationTime.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/SignerUserId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/TrustSignature.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/AsymmetricCipherKeyPair.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/AsymmetricKeyParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedAsymmetricBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/CipherKeyGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/CryptoException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/DataLengthException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IAsymmetricBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IAsymmetricCipherKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IBufferedCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/ICipherParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IDerivationFunction.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IDerivationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IDSA.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/InvalidCipherTextException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/ISigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/ISignerWithRecovery.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IStreamCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/IWrapper.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/KeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/PbeParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/StreamBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/DHAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/DHBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/ECDHBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/ECDHCBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/GeneralDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/GOST3411Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/LongDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/MD2Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/MD4Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/MD5Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/NullDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/RipeMD128Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/RipeMD160Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/RipeMD256Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/RipeMD320Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha1Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha224Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha256Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha384Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha512Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha512tDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sha3Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/ShortenedDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/TigerDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/WhirlpoolDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/encodings/ISO9796d1Encoding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/encodings/OaepEncoding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/encodings/Pkcs1Encoding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/AesEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/AesFastEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/AesLightEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/AesWrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/BlowfishEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/CamelliaEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/Cast5Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/Cast6Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/DesEdeEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/DesEdeWrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/DesEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/ElGamalEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/GOST28147Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/IdeaEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/IesEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/NaccacheSternEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/NullEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC2Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC2WrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC4Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC532Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC564Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RC6Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RijndaelEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RsaEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/SerpentEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/SkipjackEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/TwofishEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/BaseKdfBytesGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DesEdeKeyGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DesKeyGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DHBasicKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DHKeyGeneratorHelper.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DHKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DHParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DsaKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DsaParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/ECKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/ElGamalKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/ElGamalParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/GOST3410KeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/GOST3410ParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Kdf1BytesGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Kdf2BytesGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Mgf1BytesGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/NaccacheSternKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Pkcs12ParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Pkcs5S1ParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/Pkcs5S2ParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/RsaKeyPairGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/SCrypt.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/io/CipherStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/io/DigestStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/io/MacStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/CbcBlockCipherMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/CfbBlockCipherMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/GOST28147Mac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/HMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/ISO9797Alg3Mac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/SipHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/CbcBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/CcmBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/CfbBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/CtsBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/GOFBBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/OfbBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/OpenPgpCfbBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/SicBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/BlockCipherPadding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/ISO10126d2Padding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/ISO7816d4Padding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/PaddedBufferedBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/Pkcs7Padding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/TbcPadding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/X923Padding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/paddings/ZeroBytePadding.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/CcmParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DesEdeParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DesParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHPrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHPublicKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DHValidationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaParameterGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaPrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaPublicKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/DsaValidationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ECDomainParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ECKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ECKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ECPrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ECPublicKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ElGamalKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ElGamalKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ElGamalParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ElGamalPrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ElGamalPublicKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410KeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410KeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410PrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410PublicKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/GOST3410ValidationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/IesParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/IesWithCipherParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ISO18033KDFParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/KdfParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/KeyParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/MgfParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/NaccacheSternKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/NaccacheSternKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/NaccacheSternPrivateKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ParametersWithIV.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ParametersWithRandom.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ParametersWithSalt.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/ParametersWithSBox.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RC2Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RC5Parameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RsaKeyGenerationParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RsaKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RsaPrivateCrtKeyParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/DsaDigestSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/DsaSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/ECDsaSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/ECGOST3410Signer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/ECNRSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/GOST3410Signer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/Iso9796d2PssSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/Iso9796d2Signer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/PssSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/RsaDigestSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/BigInteger.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/ECCurve.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/ECFieldElement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/ECPoint.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpCompressedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpCompressedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpDataValidationException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpEncryptedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpEncryptedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpEncryptedDataList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpExperimental.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpKeyFlags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpKeyPair.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpKeyRingGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpKeyValidationException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpLiteralData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpLiteralDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpMarker.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PGPObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpObjectFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpOnePassSignature.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpOnePassSignatureList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPbeEncryptedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPrivateKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPublicKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPublicKeyEncryptedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPublicKeyRing.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpPublicKeyRingBundle.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSecretKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSecretKeyRing.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSecretKeyRingBundle.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSignature.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSignatureGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSignatureList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSignatureSubpacketGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpSignatureSubpacketVector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpUserAttributeSubpacketVector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PgpV3SignatureGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/AsymmetricKeyEntry.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/EncryptedPrivateKeyInfoFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/Pkcs10CertificationRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/Pkcs12Entry.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/Pkcs12Store.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/PrivateKeyInfoFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/X509CertificateEntry.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/CipherUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/DigestUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/DotNetUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/PbeUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/PrivateKeyFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/PublicKeyFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/SecureRandom.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/SecurityUtilityException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/SignerUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/Arrays.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/BigIntegers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/Base64.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/Base64Encoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/BufferedDecoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/BufferedEncoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/Hex.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/HexEncoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/HexTranslator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/IEncoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/Translator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/BaseInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/BaseOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/TeeOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/SubjectPublicKeyInfoFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509Certificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509CertificateParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509V1CertificateGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509V3CertificateGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509Utilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509V2CRLGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/iana/IANAObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/microsoft/MicrosoftObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/CompressedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/ContentInfoParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/EncryptedContentInfoParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/EnvelopedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/SignedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1Generator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1OctetStringParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1SequenceParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1SetParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1StreamParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ASN1TaggedObjectParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BEROctetStringGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BEROctetStringParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERSequenceGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERSequenceParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERSetParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERTaggedObjectParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ConstructedOctetStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DefiniteLengthInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERSequenceGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/IndefiniteLengthInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/LimitedInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/GeneralSecurityException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/IX509Extension.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/extension/X509ExtensionUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RSABlindedEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RSACoreEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/HashSet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/ISet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/date/DateTimeObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/EnumerableProxy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509ExtensionBase.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/RSAESOAEPparams.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/pkcs/RSASSAPSSparams.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/SignatureException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/PrincipalUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509Crl.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509CrlEntry.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509SignatureUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/InvalidKeyException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509CrlParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CertificateEncodingException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CertificateException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CertificateExpiredException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CertificateNotYetValidException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CertificateParsingException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/cert/CrlException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/KeyException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/NoSuchAlgorithmException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/ContentHints.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509CertificatePair.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/MacUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/WrapperUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedStreamCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/PEMParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509KeyUsage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/IX509AttributeCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509Attribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509V2AttributeCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/AttributeCertificateHolder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/AttributeCertificateIssuer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509V2AttributeCertificateGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/PrivateKeyUsagePeriod.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/extension/AuthorityKeyIdentifierStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/GOST3410DigestSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/AlwaysValidVerifyer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ByteQueue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/Certificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/CombinedHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ICertificateVerifyer.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/RecordStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsProtocolHandler.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedIesCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/InvalidParameterException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedCipherBase.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/IStreamGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/WrappedGeneratorStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/date/DateTimeUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/EncryptionException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/IPasswordFinder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/PasswordException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/PEMException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/PEMReader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/PEMUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/PEMWriter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/OpenSSLPBEParametersGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/X509ExtensionsGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/GeneratorUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/extension/SubjectKeyIdentifierStructure.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DerStringBase.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/AgreementUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/TEAEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/XTEAEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/KeyAgreeRecipientIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/RecipientEncryptedKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/kdf/DHKdfParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/kdf/DHKekGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/kdf/ECDHKekGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RFC3211WrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/ECDHWithKdfBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/security/ParameterUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/DHParametersHelper.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/CollectionUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509CertPairParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/X509AttrCertParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAttributeTableGenerationException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAttributeTableGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthEnvelopedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthEnvelopedGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSCompressedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSCompressedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSCompressedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSCompressedDataStreamGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSContentInfoParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedDataStreamGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSEnvelopedHelper.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSPBEKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSProcessable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSProcessableByteArray.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSProcessableFile.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSProcessableInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSReadable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSecureReadable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedDataStreamGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSSignedHelper.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSStreamException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSTypedStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSUtils.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/DefaultSignedAttributeTableGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/DigOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KEKRecipientInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KeyAgreeRecipientInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KeyTransRecipientInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/MacOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/NullOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/OriginatorId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/OriginatorInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/OriginatorInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/PasswordRecipientInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/PKCS5Scheme2PBEKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/RecipientId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/RecipientInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/RecipientInformationStore.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SignerId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SignerInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SignerInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SignerInformationStore.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SigOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/SimpleAttributeTableGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/IX509Selector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/IX509Store.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/IX509StoreParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/NoSuchStoreException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509AttrCertStoreSelector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509CertPairStoreSelector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509CertStoreSelector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509CollectionStore.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509CollectionStoreParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509CrlStoreSelector.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509StoreException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/x509/store/X509StoreFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/BasicOCSPResp.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/BasicOCSPRespGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/CertificateID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/CertificateStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPReq.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPReqGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPResp.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPRespGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPRespStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/OCSPUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/Req.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/RespData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/RespID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/RevokedStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/SingleResp.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/ocsp/UnknownStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/GenTimeAccuracy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampRequestGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampResponse.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampResponseGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampToken.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampTokenGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TimeStampTokenInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TSPAlgorithms.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TSPException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TSPUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/tsp/TSPValidationException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/DigestRandomGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/IRandomGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/ThreadedSeedGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="bzip2/src/BZip2Constants.cs" />
-    <File subtype="Code" buildaction="Compile" name="bzip2/src/CBZip2InputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="bzip2/src/CBZip2OutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="bzip2/src/CRC.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/Adler32.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/Deflate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/InfBlocks.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/InfCodes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/Inflate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/InfTree.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/JZlib.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/StaticTree.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/Tree.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/ZDeflaterOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/ZInflaterInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/ZStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RSABlindingEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/RSABlindingParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/generators/RSABlindingFactorGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PGPKeyRing.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ASN1SequenceParserTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/AttributeTableUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/BiometricDataUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/BitStringConstantTester.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/BitStringTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CertificateTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/DataGroupHashUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CMSTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CommitmentTypeIndicationUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CommitmentTypeQualifierUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/DERUTF8StringTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/EncryptedPrivateKeyInfoTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/EqualsAndHashCodeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/GeneralizedTimeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/GenerationTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/InputStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/Iso4217CurrencyCodeUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/KeyUsageTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/LDSSecurityObjectUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/MiscTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/MonetaryValueUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/NetscapeCertTypeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/OCSPTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/OctetStringTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/OIDTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ParseTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ParsingTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/PKCS10Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/PKCS12Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/PKIFailureInfoTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/QCStatementUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ReasonFlagsTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/RegressionTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/SemanticsInformationUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/SetTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/SignerLocationUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/SMIMETest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/StringTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/TagTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/TimeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/TypeOfBiometricDataUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/UTCTimeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/X509ExtensionsTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/X509NameTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/X9Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/CMSTestUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/CompressedDataStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/CompressedDataTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/EnvelopedDataStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/EnvelopedDataTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/SignedDataStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/SignedDataTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/examples/DESExample.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/io/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/io/test/CipherStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/AESFastTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/AESLightTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/AESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/AESWrapTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/BlockCipherMonteCarloTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/BlockCipherVectorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/BlowfishTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CamelliaTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Cast5Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CAST6Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CCMTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CipherTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CTSTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DESedeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DHKEKGeneratorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DHTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DSATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ECDHKEKGeneratorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ECGOST3410Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ECIESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ECNRTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ECTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ElGamalTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/EqualsHashCodeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GcmReorderTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GCMTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/OCBTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GOST28147MacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GOST28147Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GOST3410Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/GOST3411DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/IDEATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ISO9796Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ISO9797Alg3MacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/KDF1GeneratorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/KDF2GeneratorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MD2DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MD4DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MD5DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MD5HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/MGF1GeneratorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ModeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/NaccacheSternTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/NullTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/OAEPTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/PaddingTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Pkcs12Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Pkcs5Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/PSSBlindTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/PSSTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RC2Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RC2WrapTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RC4Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RC5Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RC6Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RegressionTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RFC3211WrapTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RijndaelTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD128DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD128HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD160DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD160HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD256DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RipeMD320DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RSABlindedTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/RsaTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SerpentTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA1DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA1HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA224DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA224HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA256DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA256HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA384DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA384HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA512DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA512t224DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA512t256DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA512HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SHA3DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ShortenedDigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SkipjackTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SipHashTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/StreamCipherVectorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/TEATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/TigerDigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/TwofishTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/WhirlpoolDigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/XTEATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/ec/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/ec/test/ECPointTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/test/BigIntegerTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/ocsp/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/ocsp/test/OCSPTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/ocsp/test/OCSPTestUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/ByteArrayHandler.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/ClearSignedFileProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/DetachedSignatureProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/DsaElGamalKeyRingGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/KeyBasedFileProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/KeyBasedLargeFileProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/PbeFileProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/PublicKeyRingDump.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/RsaKeyRingGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/SignedFileProcessor.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPArmoredTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPClearSignedSignatureTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPCompressionTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPDSAElGamalTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPDSATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PgpKeyRingTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PgpMarkerTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPPacketTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPPBETest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPRSATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/PGPSignatureTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/RegressionTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openssl/test/ReaderTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openssl/test/WriterTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/pkcs/test/EncryptedPrivateKeyInfoTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/pkcs/test/PKCS10Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/pkcs/test/PKCS12StoreTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/SecureRandomTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/TestDigestUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/TestDotNetUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/TestEncodings.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/TestParameterUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/security/test/TestSignerUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/AESSICTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/AESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/AttrCertTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/BlockCipherTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CertPathTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CertTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CipherStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CRL5Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/DESedeTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/DHTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/DigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/DSATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/ECDSA5Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/ECNRTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/ElGamalTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/EncryptedPrivateKeyInfoTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/FIPSDESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/GOST28147Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/GOST3410Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/HMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/IESTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/MacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/NamedCurveTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PBETest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PEMData.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PKCS10CertRequestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PSSTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/RegressionTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/RSATest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/SigTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/TestUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/WrapTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/X509CertificatePairTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/GenTimeAccuracyTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/ParseTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/TimeStampTokenInfoTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/TSPTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/tsp/test/TSPTestUtil.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/FixedSecureRandom.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/ITest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/ITestResult.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/NumberParsing.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/SimpleTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/SimpleTestResult.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/TestFailedException.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/test/UncloseableStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/x509/test/TestCertificateGen.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x9/X9ECParametersHolder.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/test/DSA2Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/ReversedWindowGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/Target.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/TargetInformation.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/Targets.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x500/DirectoryString.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/sigi/NameOrPseudonym.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/x509/sigi/PersonalData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/ocsp/CertHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/ocsp/RequestedCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/ISISMTTObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/Admissions.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/DeclarationOfMajority.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/MonetaryLimit.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/NamingAuthority.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/ProfessionInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/Restriction.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/SEEDEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SEEDTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/CamelliaWrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/RFC3394WrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/SEEDWrapEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/kisa/KISAObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/teletrust/TeleTrusTNamedCurves.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CamelliaTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/BaseBlockCipherTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/SEEDTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ntt/NTTObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/UrlBase64.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/encoders/UrlBase64Encoder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/Salsa20Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/CMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/MaxBytesExceededException.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Salsa20Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SCryptTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/AdditionalInformationSyntaxUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/AdmissionsUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/AdmissionSyntaxUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ASN1UnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CertHashUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ContentHintsUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/DeclarationOfMajorityUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/MonetaryLimitUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/NameOrPseudonymUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/NamingAuthorityUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/OtherCertIDUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/OtherSigningCertificateUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/PersonalDataUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ProcurationSyntaxUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/ProfessionInfoUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/RequestedCertificateUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/RestrictionUnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/AdditionalInformationSyntax.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/AdmissionSyntax.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/isismtt/x509/ProcurationSyntax.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/EAXBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/IAeadBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/AEADParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/EAXTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/IntArray.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/NotationData.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/ec/test/ECPointPerformanceTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/ec/test/F2mProofer.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/HCFamilyTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/ISAACTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/DirectKeySignature.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/HC128Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/HC256Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/ISAACEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/DERApplicationSpecificTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/CMSSampleMessages.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/TargetInformationTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/ECAlgorithms.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/net/IPAddress.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/net/test/IPAddressTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/ECEncodingTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/rsa3/RSA3CertTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/NoekeonEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/NoekeonTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/NoekeonTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/BufferedAeadBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/AttrCertSelectorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/Streams.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CertificateValues.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CompleteCertificateRefs.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CompleteRevocationRefs.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CrlIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CrlListID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CrlOcspRef.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/CrlValidatedID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OcspIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OcspListID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OcspResponsesID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherCertID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherHashAlgAndValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherRevRefs.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherRevVals.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/OtherSigningCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/RevocationValues.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/SignaturePolicyId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/SignaturePolicyIdentifier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/SigPolicyQualifierInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/EncryptedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/Platform.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/abc/SimpleBigDecimal.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/abc/Tnaf.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/abc/ZTauElement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/ECMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/FpNafMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/PreCompInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/ReferenceMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/WNafMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/WNafPreCompInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/WTauNafMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/math/ec/multiplier/WTauNafPreCompInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/Strings.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/VMPCEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/VMPCKSA3Engine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/VMPCKSA3Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/VMPCTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/math/ec/test/TnafTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DEROctetStringParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERSequenceParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERSetParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/CryptoApiRandomGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/prng/VMPCRandomGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/VMPCMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/VMPCMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/PushbackStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/BaseDigestCalculator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CounterSignatureDigestCalculator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/IDigestCalculator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/ESSCertIDv2.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/ess/SigningCertificateV2.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/EmptyEnumerable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/PKCS5Scheme2UTF8PBEKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BERSetGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERSetGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/LazyASN1InputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/LazyDERSequence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/LazyDERSet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/GCMBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/OCBBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/PKCS12StoreBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/IssuingDistributionPointTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/GeneralNameTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/CertStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixAttrCertChecker.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixAttrCertPathBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixAttrCertPathValidator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixBuilderParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPath.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathBuilderException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathBuilderResult.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathChecker.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathValidator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathValidatorException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathValidatorResult.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCertPathValidatorUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixNameConstraintValidator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixNameConstraintValidatorException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixPolicyNode.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/ReasonsMask.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/Rfc3280CertPathUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/Rfc3281CertPathUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/TrustAnchor.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/EmbeddedSignature.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/nist/NistCertPathTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CertPathBuilderTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CertPathValidatorTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/NistCertPathTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PkixNameConstraintsTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PkixPolicyMappingTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/PkixTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/esf/SignerAttribute.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/eac/EACObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Nothing" name="test/lib/nunit.core.dll" />
-    <File subtype="Code" buildaction="Nothing" name="test/lib/nunit.core.interfaces.dll" />
-    <File subtype="Code" buildaction="Nothing" name="test/lib/nunit.framework.dll" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/X509StoreTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/CamelliaLightTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/DigestRandomNumberTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/CamelliaLightEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/MiscDataStreamTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/IAsn1Choice.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/AuthenticatedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/AuthenticatedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerApplicationSpecific.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/BerApplicationSpecificParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/IAsn1ApplicationSpecificParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/srp/SRP6Client.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/srp/SRP6Server.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/srp/SRP6VerifierGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SRP6Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/srp/SRP6Utilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/io/SignerStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/signers/GenericSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsRsaSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDssSigner.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-1024-160.pub" resource_id="test.data.openpgp.dsa.keys.DSA-1024-160.pub" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-1024-160.sec" resource_id="test.data.openpgp.dsa.keys.DSA-1024-160.sec" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-15360-512.pub" resource_id="test.data.openpgp.dsa.keys.DSA-15360-512.pub" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-15360-512.sec" resource_id="test.data.openpgp.dsa.keys.DSA-15360-512.sec" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-2048-224.pub" resource_id="test.data.openpgp.dsa.keys.DSA-2048-224.pub" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-2048-224.sec" resource_id="test.data.openpgp.dsa.keys.DSA-2048-224.sec" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-3072-256.pub" resource_id="test.data.openpgp.dsa.keys.DSA-3072-256.pub" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-3072-256.sec" resource_id="test.data.openpgp.dsa.keys.DSA-3072-256.sec" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-7680-384.pub" resource_id="test.data.openpgp.dsa.keys.DSA-7680-384.pub" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/keys/DSA-7680-384.sec" resource_id="test.data.openpgp.dsa.keys.DSA-7680-384.sec" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-1024-160-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-1024-160-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-1024-224-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-1024-224-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-1024-256-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-1024-256-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-1024-384-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-1024-384-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-1024-512-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-1024-512-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-15360-512-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-15360-512-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-2048-224-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-2048-224-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-3072-256-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-3072-256-sign.gpg" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openpgp/dsa/sigs/dsa-7680-384-sign.gpg" resource_id="test.data.openpgp.dsa.sigs.dsa-7680-384-sign.gpg" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/openpgp/dsa/README.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes128_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes128_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes128_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes128_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes128_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes128_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes128_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes128_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes192_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes192_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes192_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes192_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes192_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes192_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes192_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes192_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes256_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes256_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes256_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes256_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes256_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes256_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_aes256_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_aes256_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_blowfish_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_blowfish_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_blowfish_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_blowfish_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_blowfish_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_blowfish_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_blowfish_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_blowfish_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des1_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des1_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des1_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des1_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des1_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des1_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des1_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des1_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des2_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des2_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des2_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des2_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des2_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des2_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des2_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des2_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des3_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des3_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des3_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des3_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des3_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des3_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_des3_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_des3_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_128_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_128_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_128_cfb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_128_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_128_ecb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_128_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_128_ofb.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_128_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_40_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_40_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_rc2_64_cbc.pem" resource_id="test.data.openssl.dsa.openssl_dsa_rc2_64_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/dsa/openssl_dsa_unencrypted.pem" resource_id="test.data.openssl.dsa.openssl_dsa_unencrypted.pem" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/openssl/README.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes128_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes128_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes128_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes128_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes128_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes128_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes128_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes128_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes192_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes192_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes192_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes192_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes192_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes192_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes192_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes192_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes256_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes256_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes256_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes256_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes256_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes256_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_aes256_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_aes256_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_blowfish_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_blowfish_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_blowfish_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_blowfish_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_blowfish_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_blowfish_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_blowfish_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_blowfish_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des1_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des1_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des1_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des1_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des1_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des1_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des1_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des1_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des2_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des2_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des2_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des2_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des2_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des2_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des2_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des2_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des3_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des3_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des3_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des3_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des3_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des3_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_des3_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_des3_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_128_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_128_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_128_cfb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_128_cfb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_128_ecb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_128_ecb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_128_ofb.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_128_ofb.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_40_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_40_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_rc2_64_cbc.pem" resource_id="test.data.openssl.rsa.openssl_rsa_rc2_64_cbc.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/rsa/openssl_rsa_unencrypted.pem" resource_id="test.data.openssl.rsa.openssl_rsa_unencrypted.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/AllCertificatesanyPolicyTest11EE.crt" resource_id="test.data.PKITS.certs.AllCertificatesanyPolicyTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/AllCertificatesNoPoliciesTest2EE.crt" resource_id="test.data.PKITS.certs.AllCertificatesNoPoliciesTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/AllCertificatesSamePoliciesTest10EE.crt" resource_id="test.data.PKITS.certs.AllCertificatesSamePoliciesTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/AllCertificatesSamePoliciesTest13EE.crt" resource_id="test.data.PKITS.certs.AllCertificatesSamePoliciesTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/anyPolicyCACert.crt" resource_id="test.data.PKITS.certs.anyPolicyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/AnyPolicyTest14EE.crt" resource_id="test.data.PKITS.certs.AnyPolicyTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BadCRLIssuerNameCACert.crt" resource_id="test.data.PKITS.certs.BadCRLIssuerNameCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BadCRLSignatureCACert.crt" resource_id="test.data.PKITS.certs.BadCRLSignatureCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BadnotAfterDateCACert.crt" resource_id="test.data.PKITS.certs.BadnotAfterDateCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BadnotBeforeDateCACert.crt" resource_id="test.data.PKITS.certs.BadnotBeforeDateCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BadSignedCACert.crt" resource_id="test.data.PKITS.certs.BadSignedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/basicConstraintsCriticalcAFalseCACert.crt" resource_id="test.data.PKITS.certs.basicConstraintsCriticalcAFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/basicConstraintsNotCriticalCACert.crt" resource_id="test.data.PKITS.certs.basicConstraintsNotCriticalCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/basicConstraintsNotCriticalcAFalseCACert.crt" resource_id="test.data.PKITS.certs.basicConstraintsNotCriticalcAFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedCRLSigningKeyCACert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedCRLSigningKeyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedCRLSigningKeyCRLCert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedCRLSigningKeyCRLCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedNewKeyCACert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedNewKeyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedNewKeyOldWithNewCACert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedNewKeyOldWithNewCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedOldKeyCACert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedOldKeyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/BasicSelfIssuedOldKeyNewWithOldCACert.crt" resource_id="test.data.PKITS.certs.BasicSelfIssuedOldKeyNewWithOldCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/CPSPointerQualifierTest20EE.crt" resource_id="test.data.PKITS.certs.CPSPointerQualifierTest20EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/deltaCRLCA1Cert.crt" resource_id="test.data.PKITS.certs.deltaCRLCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/deltaCRLCA2Cert.crt" resource_id="test.data.PKITS.certs.deltaCRLCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/deltaCRLCA3Cert.crt" resource_id="test.data.PKITS.certs.deltaCRLCA3Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/deltaCRLIndicatorNoBaseCACert.crt" resource_id="test.data.PKITS.certs.deltaCRLIndicatorNoBaseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest12EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest3EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest4EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest5EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest7EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest8EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DifferentPoliciesTest9EE.crt" resource_id="test.data.PKITS.certs.DifferentPoliciesTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/distributionPoint1CACert.crt" resource_id="test.data.PKITS.certs.distributionPoint1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/distributionPoint2CACert.crt" resource_id="test.data.PKITS.certs.distributionPoint2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DSACACert.crt" resource_id="test.data.PKITS.certs.DSACACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/DSAParametersInheritedCACert.crt" resource_id="test.data.PKITS.certs.DSAParametersInheritedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/GeneralizedTimeCRLnextUpdateCACert.crt" resource_id="test.data.PKITS.certs.GeneralizedTimeCRLnextUpdateCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/GoodCACert.crt" resource_id="test.data.PKITS.certs.GoodCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/GoodsubCACert.crt" resource_id="test.data.PKITS.certs.GoodsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/GoodsubCAPanyPolicyMapping1to2CACert.crt" resource_id="test.data.PKITS.certs.GoodsubCAPanyPolicyMapping1to2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA1Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA2Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA3Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA3Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA3cRLIssuerCert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA3cRLIssuerCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA4Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA4Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA4cRLIssuerCert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA4cRLIssuerCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA5Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA5Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/indirectCRLCA6Cert.crt" resource_id="test.data.PKITS.certs.indirectCRLCA6Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy0CACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy0CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1CACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1SelfIssuedsubCA2Cert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1SelfIssuedsubCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1subCA1Cert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1subCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1subCA2Cert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1subCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1subCAIAP5Cert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1subCAIAP5Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy1subsubCA2Cert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy1subsubCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy5CACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy5CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy5subCACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy5subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicy5subsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicy5subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitAnyPolicyTest3EE.crt" resource_id="test.data.PKITS.certs.inhibitAnyPolicyTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping0CACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping0CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping0subCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping0subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P12CACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P12CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P12subCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P12subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P12subCAIPM5Cert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P12subCAIPM5Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P12subsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P12subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P12subsubCAIPM5Cert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P12subsubCAIPM5Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P1CACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P1SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P1SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P1SelfIssuedsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P1SelfIssuedsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P1subCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P1subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping1P1subsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping1P1subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping5CACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping5CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping5subCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping5subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping5subsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping5subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/inhibitPolicyMapping5subsubsubCACert.crt" resource_id="test.data.PKITS.certs.inhibitPolicyMapping5subsubsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBadCRLIssuerNameTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidBadCRLIssuerNameTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBadCRLSignatureTest4EE.crt" resource_id="test.data.PKITS.certs.InvalidBadCRLSignatureTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBasicSelfIssuedCRLSigningKeyTest7EE.crt" resource_id="test.data.PKITS.certs.InvalidBasicSelfIssuedCRLSigningKeyTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBasicSelfIssuedCRLSigningKeyTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidBasicSelfIssuedCRLSigningKeyTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBasicSelfIssuedNewWithOldTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidBasicSelfIssuedNewWithOldTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidBasicSelfIssuedOldWithNewTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidBasicSelfIssuedOldWithNewTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcAFalseTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidcAFalseTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcAFalseTest3EE.crt" resource_id="test.data.PKITS.certs.InvalidcAFalseTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidCAnotAfterDateTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidCAnotAfterDateTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidCAnotBeforeDateTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidCAnotBeforeDateTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidCASignatureTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidCASignatureTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcRLIssuerTest27EE.crt" resource_id="test.data.PKITS.certs.InvalidcRLIssuerTest27EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcRLIssuerTest31EE.crt" resource_id="test.data.PKITS.certs.InvalidcRLIssuerTest31EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcRLIssuerTest32EE.crt" resource_id="test.data.PKITS.certs.InvalidcRLIssuerTest32EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcRLIssuerTest34EE.crt" resource_id="test.data.PKITS.certs.InvalidcRLIssuerTest34EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidcRLIssuerTest35EE.crt" resource_id="test.data.PKITS.certs.InvalidcRLIssuerTest35EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLIndicatorNoBaseTest1EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLIndicatorNoBaseTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLTest10EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLTest3EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLTest4EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLTest6EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddeltaCRLTest9EE.crt" resource_id="test.data.PKITS.certs.InvaliddeltaCRLTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddistributionPointTest2EE.crt" resource_id="test.data.PKITS.certs.InvaliddistributionPointTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddistributionPointTest3EE.crt" resource_id="test.data.PKITS.certs.InvaliddistributionPointTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddistributionPointTest6EE.crt" resource_id="test.data.PKITS.certs.InvaliddistributionPointTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddistributionPointTest8EE.crt" resource_id="test.data.PKITS.certs.InvaliddistributionPointTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvaliddistributionPointTest9EE.crt" resource_id="test.data.PKITS.certs.InvaliddistributionPointTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNandRFC822nameConstraintsTest28EE.crt" resource_id="test.data.PKITS.certs.InvalidDNandRFC822nameConstraintsTest28EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNandRFC822nameConstraintsTest29EE.crt" resource_id="test.data.PKITS.certs.InvalidDNandRFC822nameConstraintsTest29EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest12EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest13EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest15EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest15EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest16EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest16EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest17EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest17EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest20EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest20EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest3EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest7EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNnameConstraintsTest9EE.crt" resource_id="test.data.PKITS.certs.InvalidDNnameConstraintsTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNSnameConstraintsTest31EE.crt" resource_id="test.data.PKITS.certs.InvalidDNSnameConstraintsTest31EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNSnameConstraintsTest33EE.crt" resource_id="test.data.PKITS.certs.InvalidDNSnameConstraintsTest33EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDNSnameConstraintsTest38EE.crt" resource_id="test.data.PKITS.certs.InvalidDNSnameConstraintsTest38EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidDSASignatureTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidDSASignatureTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidEEnotAfterDateTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidEEnotAfterDateTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidEEnotBeforeDateTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidEEnotBeforeDateTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidEESignatureTest3EE.crt" resource_id="test.data.PKITS.certs.InvalidEESignatureTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidIDPwithindirectCRLTest23EE.crt" resource_id="test.data.PKITS.certs.InvalidIDPwithindirectCRLTest23EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidIDPwithindirectCRLTest26EE.crt" resource_id="test.data.PKITS.certs.InvalidIDPwithindirectCRLTest26EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitAnyPolicyTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitAnyPolicyTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitAnyPolicyTest4EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitAnyPolicyTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitAnyPolicyTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitAnyPolicyTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitAnyPolicyTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitAnyPolicyTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitPolicyMappingTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitPolicyMappingTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitPolicyMappingTest3EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitPolicyMappingTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitPolicyMappingTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitPolicyMappingTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidinhibitPolicyMappingTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidinhibitPolicyMappingTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidkeyUsageCriticalcRLSignFalseTest4EE.crt" resource_id="test.data.PKITS.certs.InvalidkeyUsageCriticalcRLSignFalseTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidkeyUsageCriticalkeyCertSignFalseTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidkeyUsageCriticalkeyCertSignFalseTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidkeyUsageNotCriticalcRLSignFalseTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidkeyUsageNotCriticalcRLSignFalseTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidkeyUsageNotCriticalkeyCertSignFalseTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidkeyUsageNotCriticalkeyCertSignFalseTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidLongSerialNumberTest18EE.crt" resource_id="test.data.PKITS.certs.InvalidLongSerialNumberTest18EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidMappingFromanyPolicyTest7EE.crt" resource_id="test.data.PKITS.certs.InvalidMappingFromanyPolicyTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidMappingToanyPolicyTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidMappingToanyPolicyTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidMissingbasicConstraintsTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidMissingbasicConstraintsTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidMissingCRLTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidMissingCRLTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidNameChainingOrderTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidNameChainingOrderTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidNameChainingTest1EE.crt" resource_id="test.data.PKITS.certs.InvalidNameChainingTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidNegativeSerialNumberTest15EE.crt" resource_id="test.data.PKITS.certs.InvalidNegativeSerialNumberTest15EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidOldCRLnextUpdateTest11EE.crt" resource_id="test.data.PKITS.certs.InvalidOldCRLnextUpdateTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlyContainsAttributeCertsTest14EE.crt" resource_id="test.data.PKITS.certs.InvalidonlyContainsAttributeCertsTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlyContainsCACertsTest12EE.crt" resource_id="test.data.PKITS.certs.InvalidonlyContainsCACertsTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlyContainsUserCertsTest11EE.crt" resource_id="test.data.PKITS.certs.InvalidonlyContainsUserCertsTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlySomeReasonsTest15EE.crt" resource_id="test.data.PKITS.certs.InvalidonlySomeReasonsTest15EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlySomeReasonsTest16EE.crt" resource_id="test.data.PKITS.certs.InvalidonlySomeReasonsTest16EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlySomeReasonsTest17EE.crt" resource_id="test.data.PKITS.certs.InvalidonlySomeReasonsTest17EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlySomeReasonsTest20EE.crt" resource_id="test.data.PKITS.certs.InvalidonlySomeReasonsTest20EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidonlySomeReasonsTest21EE.crt" resource_id="test.data.PKITS.certs.InvalidonlySomeReasonsTest21EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest11EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest12EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidpathLenConstraintTest9EE.crt" resource_id="test.data.PKITS.certs.InvalidpathLenConstraintTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidPolicyMappingTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidPolicyMappingTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidPolicyMappingTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidPolicyMappingTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidPolicyMappingTest4EE.crt" resource_id="test.data.PKITS.certs.InvalidPolicyMappingTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/Invalidpre2000CRLnextUpdateTest12EE.crt" resource_id="test.data.PKITS.certs.Invalidpre2000CRLnextUpdateTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/Invalidpre2000UTCEEnotAfterDateTest7EE.crt" resource_id="test.data.PKITS.certs.Invalidpre2000UTCEEnotAfterDateTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidrequireExplicitPolicyTest3EE.crt" resource_id="test.data.PKITS.certs.InvalidrequireExplicitPolicyTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidrequireExplicitPolicyTest5EE.crt" resource_id="test.data.PKITS.certs.InvalidrequireExplicitPolicyTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidRevokedCATest2EE.crt" resource_id="test.data.PKITS.certs.InvalidRevokedCATest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidRevokedEETest3EE.crt" resource_id="test.data.PKITS.certs.InvalidRevokedEETest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidRFC822nameConstraintsTest22EE.crt" resource_id="test.data.PKITS.certs.InvalidRFC822nameConstraintsTest22EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidRFC822nameConstraintsTest24EE.crt" resource_id="test.data.PKITS.certs.InvalidRFC822nameConstraintsTest24EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidRFC822nameConstraintsTest26EE.crt" resource_id="test.data.PKITS.certs.InvalidRFC822nameConstraintsTest26EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitAnyPolicyTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitAnyPolicyTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitAnyPolicyTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitAnyPolicyTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitPolicyMappingTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitPolicyMappingTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitPolicyMappingTest11EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitPolicyMappingTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitPolicyMappingTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitPolicyMappingTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedinhibitPolicyMappingTest9EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedinhibitPolicyMappingTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedpathLenConstraintTest16EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedpathLenConstraintTest16EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedrequireExplicitPolicyTest7EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedrequireExplicitPolicyTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSelfIssuedrequireExplicitPolicyTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidSelfIssuedrequireExplicitPolicyTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSeparateCertificateandCRLKeysTest20EE.crt" resource_id="test.data.PKITS.certs.InvalidSeparateCertificateandCRLKeysTest20EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidSeparateCertificateandCRLKeysTest21EE.crt" resource_id="test.data.PKITS.certs.InvalidSeparateCertificateandCRLKeysTest21EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidUnknownCriticalCertificateExtensionTest2EE.crt" resource_id="test.data.PKITS.certs.InvalidUnknownCriticalCertificateExtensionTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidUnknownCRLEntryExtensionTest8EE.crt" resource_id="test.data.PKITS.certs.InvalidUnknownCRLEntryExtensionTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidUnknownCRLExtensionTest10EE.crt" resource_id="test.data.PKITS.certs.InvalidUnknownCRLExtensionTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidUnknownCRLExtensionTest9EE.crt" resource_id="test.data.PKITS.certs.InvalidUnknownCRLExtensionTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidURInameConstraintsTest35EE.crt" resource_id="test.data.PKITS.certs.InvalidURInameConstraintsTest35EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidURInameConstraintsTest37EE.crt" resource_id="test.data.PKITS.certs.InvalidURInameConstraintsTest37EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/InvalidWrongCRLTest6EE.crt" resource_id="test.data.PKITS.certs.InvalidWrongCRLTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/keyUsageCriticalcRLSignFalseCACert.crt" resource_id="test.data.PKITS.certs.keyUsageCriticalcRLSignFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/keyUsageCriticalkeyCertSignFalseCACert.crt" resource_id="test.data.PKITS.certs.keyUsageCriticalkeyCertSignFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/keyUsageNotCriticalCACert.crt" resource_id="test.data.PKITS.certs.keyUsageNotCriticalCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/keyUsageNotCriticalcRLSignFalseCACert.crt" resource_id="test.data.PKITS.certs.keyUsageNotCriticalcRLSignFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/keyUsageNotCriticalkeyCertSignFalseCACert.crt" resource_id="test.data.PKITS.certs.keyUsageNotCriticalkeyCertSignFalseCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/LongSerialNumberCACert.crt" resource_id="test.data.PKITS.certs.LongSerialNumberCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/Mapping1to2CACert.crt" resource_id="test.data.PKITS.certs.Mapping1to2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/MappingFromanyPolicyCACert.crt" resource_id="test.data.PKITS.certs.MappingFromanyPolicyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/MappingToanyPolicyCACert.crt" resource_id="test.data.PKITS.certs.MappingToanyPolicyCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/MissingbasicConstraintsCACert.crt" resource_id="test.data.PKITS.certs.MissingbasicConstraintsCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN1CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN1SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN1SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN1subCA1Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN1subCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN1subCA2Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN1subCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN1subCA3Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN1subCA3Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN2CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN3CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN3CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN3subCA1Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN3subCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN3subCA2Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN3subCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN4CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN4CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDN5CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDN5CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDNS1CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDNS1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsDNS2CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsDNS2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsRFC822CA1Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsRFC822CA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsRFC822CA2Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsRFC822CA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsRFC822CA3Cert.crt" resource_id="test.data.PKITS.certs.nameConstraintsRFC822CA3Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsURI1CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsURI1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/nameConstraintsURI2CACert.crt" resource_id="test.data.PKITS.certs.nameConstraintsURI2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/NameOrderingCACert.crt" resource_id="test.data.PKITS.certs.NameOrderingCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/NegativeSerialNumberCACert.crt" resource_id="test.data.PKITS.certs.NegativeSerialNumberCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/NoCRLCACert.crt" resource_id="test.data.PKITS.certs.NoCRLCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/NoissuingDistributionPointCACert.crt" resource_id="test.data.PKITS.certs.NoissuingDistributionPointCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/NoPoliciesCACert.crt" resource_id="test.data.PKITS.certs.NoPoliciesCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/OldCRLnextUpdateCACert.crt" resource_id="test.data.PKITS.certs.OldCRLnextUpdateCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlyContainsAttributeCertsCACert.crt" resource_id="test.data.PKITS.certs.onlyContainsAttributeCertsCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlyContainsCACertsCACert.crt" resource_id="test.data.PKITS.certs.onlyContainsCACertsCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlyContainsUserCertsCACert.crt" resource_id="test.data.PKITS.certs.onlyContainsUserCertsCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlySomeReasonsCA1Cert.crt" resource_id="test.data.PKITS.certs.onlySomeReasonsCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlySomeReasonsCA2Cert.crt" resource_id="test.data.PKITS.certs.onlySomeReasonsCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlySomeReasonsCA3Cert.crt" resource_id="test.data.PKITS.certs.onlySomeReasonsCA3Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/onlySomeReasonsCA4Cert.crt" resource_id="test.data.PKITS.certs.onlySomeReasonsCA4Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/OverlappingPoliciesTest6EE.crt" resource_id="test.data.PKITS.certs.OverlappingPoliciesTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P12Mapping1to3CACert.crt" resource_id="test.data.PKITS.certs.P12Mapping1to3CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P12Mapping1to3subCACert.crt" resource_id="test.data.PKITS.certs.P12Mapping1to3subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P12Mapping1to3subsubCACert.crt" resource_id="test.data.PKITS.certs.P12Mapping1to3subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P1anyPolicyMapping1to2CACert.crt" resource_id="test.data.PKITS.certs.P1anyPolicyMapping1to2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P1Mapping1to234CACert.crt" resource_id="test.data.PKITS.certs.P1Mapping1to234CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/P1Mapping1to234subCACert.crt" resource_id="test.data.PKITS.certs.P1Mapping1to234subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PanyPolicyMapping1to2CACert.crt" resource_id="test.data.PKITS.certs.PanyPolicyMapping1to2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint0CACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint0CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint0SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint0SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint0subCA2Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint0subCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint0subCACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint0subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint1CACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint1CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint1SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint1SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint1SelfIssuedsubCACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint1SelfIssuedsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint1subCACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint1subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6CACert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subCA0Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subCA0Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subCA1Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subCA1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subCA4Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subCA4Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subsubCA00Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subsubCA00Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subsubCA11Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subsubCA11Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subsubCA41Cert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subsubCA41Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subsubsubCA11XCert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subsubsubCA11XCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pathLenConstraint6subsubsubCA41XCert.crt" resource_id="test.data.PKITS.certs.pathLenConstraint6subsubsubCA41XCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP1234CACert.crt" resource_id="test.data.PKITS.certs.PoliciesP1234CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP1234subCAP123Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP1234subCAP123Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP1234subsubCAP123P12Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP1234subsubCAP123P12Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP123CACert.crt" resource_id="test.data.PKITS.certs.PoliciesP123CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP123subCAP12Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP123subCAP12Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP123subsubCAP12P1Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP123subsubCAP12P1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP123subsubCAP12P2Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP123subsubCAP12P2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP123subsubsubCAP12P2P1Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP123subsubsubCAP12P2P1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP12CACert.crt" resource_id="test.data.PKITS.certs.PoliciesP12CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP12subCAP1Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP12subCAP1Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP12subsubCAP1P2Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP12subsubCAP1P2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP2subCA2Cert.crt" resource_id="test.data.PKITS.certs.PoliciesP2subCA2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP2subCACert.crt" resource_id="test.data.PKITS.certs.PoliciesP2subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/PoliciesP3CACert.crt" resource_id="test.data.PKITS.certs.PoliciesP3CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/pre2000CRLnextUpdateCACert.crt" resource_id="test.data.PKITS.certs.pre2000CRLnextUpdateCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy0CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy0CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy0subCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy0subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy0subsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy0subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy0subsubsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy0subsubsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy10CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy10CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy10subCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy10subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy10subsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy10subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy10subsubsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy10subsubsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy2CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy2CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy2SelfIssuedCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy2SelfIssuedCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy2SelfIssuedsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy2SelfIssuedsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy2subCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy2subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy4CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy4CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy4subCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy4subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy4subsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy4subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy4subsubsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy4subsubsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy5CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy5CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy5subCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy5subCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy5subsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy5subsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy5subsubsubCACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy5subsubsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy7CACert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy7CACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy7subCARE2Cert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy7subCARE2Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy7subsubCARE2RE4Cert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy7subsubCARE2RE4Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/requireExplicitPolicy7subsubsubCARE2RE4Cert.crt" resource_id="test.data.PKITS.certs.requireExplicitPolicy7subsubsubCARE2RE4Cert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/RevokedsubCACert.crt" resource_id="test.data.PKITS.certs.RevokedsubCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/RFC3280MandatoryAttributeTypesCACert.crt" resource_id="test.data.PKITS.certs.RFC3280MandatoryAttributeTypesCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/RFC3280OptionalAttributeTypesCACert.crt" resource_id="test.data.PKITS.certs.RFC3280OptionalAttributeTypesCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/RolloverfromPrintableStringtoUTF8StringCACert.crt" resource_id="test.data.PKITS.certs.RolloverfromPrintableStringtoUTF8StringCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/SeparateCertificateandCRLKeysCA2CertificateSigningCACert.crt" resource_id="test.data.PKITS.certs.SeparateCertificateandCRLKeysCA2CertificateSigningCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/SeparateCertificateandCRLKeysCA2CRLSigningCert.crt" resource_id="test.data.PKITS.certs.SeparateCertificateandCRLKeysCA2CRLSigningCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/SeparateCertificateandCRLKeysCertificateSigningCACert.crt" resource_id="test.data.PKITS.certs.SeparateCertificateandCRLKeysCertificateSigningCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/SeparateCertificateandCRLKeysCRLSigningCert.crt" resource_id="test.data.PKITS.certs.SeparateCertificateandCRLKeysCRLSigningCert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/TrustAnchorRootCertificate.crt" resource_id="test.data.PKITS.certs.TrustAnchorRootCertificate.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/TwoCRLsCACert.crt" resource_id="test.data.PKITS.certs.TwoCRLsCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UIDCACert.crt" resource_id="test.data.PKITS.certs.UIDCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UnknownCRLEntryExtensionCACert.crt" resource_id="test.data.PKITS.certs.UnknownCRLEntryExtensionCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UnknownCRLExtensionCACert.crt" resource_id="test.data.PKITS.certs.UnknownCRLExtensionCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UserNoticeQualifierTest15EE.crt" resource_id="test.data.PKITS.certs.UserNoticeQualifierTest15EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UserNoticeQualifierTest16EE.crt" resource_id="test.data.PKITS.certs.UserNoticeQualifierTest16EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UserNoticeQualifierTest17EE.crt" resource_id="test.data.PKITS.certs.UserNoticeQualifierTest17EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UserNoticeQualifierTest18EE.crt" resource_id="test.data.PKITS.certs.UserNoticeQualifierTest18EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UserNoticeQualifierTest19EE.crt" resource_id="test.data.PKITS.certs.UserNoticeQualifierTest19EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UTF8StringCaseInsensitiveMatchCACert.crt" resource_id="test.data.PKITS.certs.UTF8StringCaseInsensitiveMatchCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/UTF8StringEncodedNamesCACert.crt" resource_id="test.data.PKITS.certs.UTF8StringEncodedNamesCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidbasicConstraintsNotCriticalTest4EE.crt" resource_id="test.data.PKITS.certs.ValidbasicConstraintsNotCriticalTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidBasicSelfIssuedCRLSigningKeyTest6EE.crt" resource_id="test.data.PKITS.certs.ValidBasicSelfIssuedCRLSigningKeyTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidBasicSelfIssuedNewWithOldTest3EE.crt" resource_id="test.data.PKITS.certs.ValidBasicSelfIssuedNewWithOldTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidBasicSelfIssuedNewWithOldTest4EE.crt" resource_id="test.data.PKITS.certs.ValidBasicSelfIssuedNewWithOldTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidBasicSelfIssuedOldWithNewTest1EE.crt" resource_id="test.data.PKITS.certs.ValidBasicSelfIssuedOldWithNewTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidCertificatePathTest1EE.crt" resource_id="test.data.PKITS.certs.ValidCertificatePathTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidcRLIssuerTest28EE.crt" resource_id="test.data.PKITS.certs.ValidcRLIssuerTest28EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidcRLIssuerTest29EE.crt" resource_id="test.data.PKITS.certs.ValidcRLIssuerTest29EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidcRLIssuerTest30EE.crt" resource_id="test.data.PKITS.certs.ValidcRLIssuerTest30EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidcRLIssuerTest33EE.crt" resource_id="test.data.PKITS.certs.ValidcRLIssuerTest33EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddeltaCRLTest2EE.crt" resource_id="test.data.PKITS.certs.ValiddeltaCRLTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddeltaCRLTest5EE.crt" resource_id="test.data.PKITS.certs.ValiddeltaCRLTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddeltaCRLTest7EE.crt" resource_id="test.data.PKITS.certs.ValiddeltaCRLTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddeltaCRLTest8EE.crt" resource_id="test.data.PKITS.certs.ValiddeltaCRLTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddistributionPointTest1EE.crt" resource_id="test.data.PKITS.certs.ValiddistributionPointTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddistributionPointTest4EE.crt" resource_id="test.data.PKITS.certs.ValiddistributionPointTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddistributionPointTest5EE.crt" resource_id="test.data.PKITS.certs.ValiddistributionPointTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValiddistributionPointTest7EE.crt" resource_id="test.data.PKITS.certs.ValiddistributionPointTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNandRFC822nameConstraintsTest27EE.crt" resource_id="test.data.PKITS.certs.ValidDNandRFC822nameConstraintsTest27EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest11EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest14EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest18EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest18EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest19EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest19EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest1EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest4EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest5EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNnameConstraintsTest6EE.crt" resource_id="test.data.PKITS.certs.ValidDNnameConstraintsTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNSnameConstraintsTest30EE.crt" resource_id="test.data.PKITS.certs.ValidDNSnameConstraintsTest30EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDNSnameConstraintsTest32EE.crt" resource_id="test.data.PKITS.certs.ValidDNSnameConstraintsTest32EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDSAParameterInheritanceTest5EE.crt" resource_id="test.data.PKITS.certs.ValidDSAParameterInheritanceTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidDSASignaturesTest4EE.crt" resource_id="test.data.PKITS.certs.ValidDSASignaturesTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidGeneralizedTimeCRLnextUpdateTest13EE.crt" resource_id="test.data.PKITS.certs.ValidGeneralizedTimeCRLnextUpdateTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidGeneralizedTimenotAfterDateTest8EE.crt" resource_id="test.data.PKITS.certs.ValidGeneralizedTimenotAfterDateTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidGeneralizedTimenotBeforeDateTest4EE.crt" resource_id="test.data.PKITS.certs.ValidGeneralizedTimenotBeforeDateTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidIDPwithindirectCRLTest22EE.crt" resource_id="test.data.PKITS.certs.ValidIDPwithindirectCRLTest22EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidIDPwithindirectCRLTest24EE.crt" resource_id="test.data.PKITS.certs.ValidIDPwithindirectCRLTest24EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidIDPwithindirectCRLTest25EE.crt" resource_id="test.data.PKITS.certs.ValidIDPwithindirectCRLTest25EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidinhibitAnyPolicyTest2EE.crt" resource_id="test.data.PKITS.certs.ValidinhibitAnyPolicyTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidinhibitPolicyMappingTest2EE.crt" resource_id="test.data.PKITS.certs.ValidinhibitPolicyMappingTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidinhibitPolicyMappingTest4EE.crt" resource_id="test.data.PKITS.certs.ValidinhibitPolicyMappingTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidkeyUsageNotCriticalTest3EE.crt" resource_id="test.data.PKITS.certs.ValidkeyUsageNotCriticalTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidLongSerialNumberTest16EE.crt" resource_id="test.data.PKITS.certs.ValidLongSerialNumberTest16EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidLongSerialNumberTest17EE.crt" resource_id="test.data.PKITS.certs.ValidLongSerialNumberTest17EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNameChainingCapitalizationTest5EE.crt" resource_id="test.data.PKITS.certs.ValidNameChainingCapitalizationTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNameChainingWhitespaceTest3EE.crt" resource_id="test.data.PKITS.certs.ValidNameChainingWhitespaceTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNameChainingWhitespaceTest4EE.crt" resource_id="test.data.PKITS.certs.ValidNameChainingWhitespaceTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNameUIDsTest6EE.crt" resource_id="test.data.PKITS.certs.ValidNameUIDsTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNegativeSerialNumberTest14EE.crt" resource_id="test.data.PKITS.certs.ValidNegativeSerialNumberTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidNoissuingDistributionPointTest10EE.crt" resource_id="test.data.PKITS.certs.ValidNoissuingDistributionPointTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidonlyContainsCACertsTest13EE.crt" resource_id="test.data.PKITS.certs.ValidonlyContainsCACertsTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidonlySomeReasonsTest18EE.crt" resource_id="test.data.PKITS.certs.ValidonlySomeReasonsTest18EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidonlySomeReasonsTest19EE.crt" resource_id="test.data.PKITS.certs.ValidonlySomeReasonsTest19EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidpathLenConstraintTest13EE.crt" resource_id="test.data.PKITS.certs.ValidpathLenConstraintTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidpathLenConstraintTest14EE.crt" resource_id="test.data.PKITS.certs.ValidpathLenConstraintTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidpathLenConstraintTest7EE.crt" resource_id="test.data.PKITS.certs.ValidpathLenConstraintTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidpathLenConstraintTest8EE.crt" resource_id="test.data.PKITS.certs.ValidpathLenConstraintTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest11EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest12EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest12EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest13EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest13EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest14EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest14EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest1EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest3EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest5EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest5EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest6EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidPolicyMappingTest9EE.crt" resource_id="test.data.PKITS.certs.ValidPolicyMappingTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/Validpre2000UTCnotBeforeDateTest3EE.crt" resource_id="test.data.PKITS.certs.Validpre2000UTCnotBeforeDateTest3EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidrequireExplicitPolicyTest1EE.crt" resource_id="test.data.PKITS.certs.ValidrequireExplicitPolicyTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidrequireExplicitPolicyTest2EE.crt" resource_id="test.data.PKITS.certs.ValidrequireExplicitPolicyTest2EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidrequireExplicitPolicyTest4EE.crt" resource_id="test.data.PKITS.certs.ValidrequireExplicitPolicyTest4EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRFC3280MandatoryAttributeTypesTest7EE.crt" resource_id="test.data.PKITS.certs.ValidRFC3280MandatoryAttributeTypesTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRFC3280OptionalAttributeTypesTest8EE.crt" resource_id="test.data.PKITS.certs.ValidRFC3280OptionalAttributeTypesTest8EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRFC822nameConstraintsTest21EE.crt" resource_id="test.data.PKITS.certs.ValidRFC822nameConstraintsTest21EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRFC822nameConstraintsTest23EE.crt" resource_id="test.data.PKITS.certs.ValidRFC822nameConstraintsTest23EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRFC822nameConstraintsTest25EE.crt" resource_id="test.data.PKITS.certs.ValidRFC822nameConstraintsTest25EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidRolloverfromPrintableStringtoUTF8StringTest10EE.crt" resource_id="test.data.PKITS.certs.ValidRolloverfromPrintableStringtoUTF8StringTest10EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedinhibitAnyPolicyTest7EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedinhibitAnyPolicyTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedinhibitAnyPolicyTest9EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedinhibitAnyPolicyTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedinhibitPolicyMappingTest7EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedinhibitPolicyMappingTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedpathLenConstraintTest15EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedpathLenConstraintTest15EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedpathLenConstraintTest17EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedpathLenConstraintTest17EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSelfIssuedrequireExplicitPolicyTest6EE.crt" resource_id="test.data.PKITS.certs.ValidSelfIssuedrequireExplicitPolicyTest6EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidSeparateCertificateandCRLKeysTest19EE.crt" resource_id="test.data.PKITS.certs.ValidSeparateCertificateandCRLKeysTest19EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidTwoCRLsTest7EE.crt" resource_id="test.data.PKITS.certs.ValidTwoCRLsTest7EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidUnknownNotCriticalCertificateExtensionTest1EE.crt" resource_id="test.data.PKITS.certs.ValidUnknownNotCriticalCertificateExtensionTest1EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidURInameConstraintsTest34EE.crt" resource_id="test.data.PKITS.certs.ValidURInameConstraintsTest34EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidURInameConstraintsTest36EE.crt" resource_id="test.data.PKITS.certs.ValidURInameConstraintsTest36EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidUTF8StringCaseInsensitiveMatchTest11EE.crt" resource_id="test.data.PKITS.certs.ValidUTF8StringCaseInsensitiveMatchTest11EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/ValidUTF8StringEncodedNamesTest9EE.crt" resource_id="test.data.PKITS.certs.ValidUTF8StringEncodedNamesTest9EE.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/certs/WrongCRLCACert.crt" resource_id="test.data.PKITS.certs.WrongCRLCACert.crt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/anyPolicyCACRL.crl" resource_id="test.data.PKITS.crls.anyPolicyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BadCRLIssuerNameCACRL.crl" resource_id="test.data.PKITS.crls.BadCRLIssuerNameCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BadCRLSignatureCACRL.crl" resource_id="test.data.PKITS.crls.BadCRLSignatureCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BadnotAfterDateCACRL.crl" resource_id="test.data.PKITS.crls.BadnotAfterDateCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BadnotBeforeDateCACRL.crl" resource_id="test.data.PKITS.crls.BadnotBeforeDateCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BadSignedCACRL.crl" resource_id="test.data.PKITS.crls.BadSignedCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/basicConstraintsCriticalcAFalseCACRL.crl" resource_id="test.data.PKITS.crls.basicConstraintsCriticalcAFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/basicConstraintsNotCriticalCACRL.crl" resource_id="test.data.PKITS.crls.basicConstraintsNotCriticalCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/basicConstraintsNotCriticalcAFalseCACRL.crl" resource_id="test.data.PKITS.crls.basicConstraintsNotCriticalcAFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BasicSelfIssuedCRLSigningKeyCACRL.crl" resource_id="test.data.PKITS.crls.BasicSelfIssuedCRLSigningKeyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BasicSelfIssuedCRLSigningKeyCRLCertCRL.crl" resource_id="test.data.PKITS.crls.BasicSelfIssuedCRLSigningKeyCRLCertCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BasicSelfIssuedNewKeyCACRL.crl" resource_id="test.data.PKITS.crls.BasicSelfIssuedNewKeyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BasicSelfIssuedOldKeyCACRL.crl" resource_id="test.data.PKITS.crls.BasicSelfIssuedOldKeyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/BasicSelfIssuedOldKeySelfIssuedCertCRL.crl" resource_id="test.data.PKITS.crls.BasicSelfIssuedOldKeySelfIssuedCertCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA1CRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA1deltaCRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA1deltaCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA2CRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA2deltaCRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA2deltaCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA3CRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA3CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLCA3deltaCRL.crl" resource_id="test.data.PKITS.crls.deltaCRLCA3deltaCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/deltaCRLIndicatorNoBaseCACRL.crl" resource_id="test.data.PKITS.crls.deltaCRLIndicatorNoBaseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/distributionPoint1CACRL.crl" resource_id="test.data.PKITS.crls.distributionPoint1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/distributionPoint2CACRL.crl" resource_id="test.data.PKITS.crls.distributionPoint2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/DSACACRL.crl" resource_id="test.data.PKITS.crls.DSACACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/DSAParametersInheritedCACRL.crl" resource_id="test.data.PKITS.crls.DSAParametersInheritedCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/GeneralizedTimeCRLnextUpdateCACRL.crl" resource_id="test.data.PKITS.crls.GeneralizedTimeCRLnextUpdateCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/GoodCACRL.crl" resource_id="test.data.PKITS.crls.GoodCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/GoodsubCACRL.crl" resource_id="test.data.PKITS.crls.GoodsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/GoodsubCAPanyPolicyMapping1to2CACRL.crl" resource_id="test.data.PKITS.crls.GoodsubCAPanyPolicyMapping1to2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/indirectCRLCA1CRL.crl" resource_id="test.data.PKITS.crls.indirectCRLCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/indirectCRLCA3CRL.crl" resource_id="test.data.PKITS.crls.indirectCRLCA3CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/indirectCRLCA3cRLIssuerCRL.crl" resource_id="test.data.PKITS.crls.indirectCRLCA3cRLIssuerCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/indirectCRLCA4cRLIssuerCRL.crl" resource_id="test.data.PKITS.crls.indirectCRLCA4cRLIssuerCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/indirectCRLCA5CRL.crl" resource_id="test.data.PKITS.crls.indirectCRLCA5CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy0CACRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy0CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy1CACRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy1subCA1CRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy1subCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy1subCA2CRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy1subCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy1subCAIAP5CRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy1subCAIAP5CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy1subsubCA2CRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy1subsubCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy5CACRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy5CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy5subCACRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy5subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitAnyPolicy5subsubCACRL.crl" resource_id="test.data.PKITS.crls.inhibitAnyPolicy5subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping0CACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping0CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping0subCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping0subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P12CACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P12CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P12subCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P12subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P12subCAIPM5CRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P12subCAIPM5CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P12subsubCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P12subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P12subsubCAIPM5CRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P12subsubCAIPM5CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P1CACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P1subCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P1subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping1P1subsubCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping1P1subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping5CACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping5CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping5subCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping5subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping5subsubCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping5subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/inhibitPolicyMapping5subsubsubCACRL.crl" resource_id="test.data.PKITS.crls.inhibitPolicyMapping5subsubsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/keyUsageCriticalcRLSignFalseCACRL.crl" resource_id="test.data.PKITS.crls.keyUsageCriticalcRLSignFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/keyUsageCriticalkeyCertSignFalseCACRL.crl" resource_id="test.data.PKITS.crls.keyUsageCriticalkeyCertSignFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/keyUsageNotCriticalCACRL.crl" resource_id="test.data.PKITS.crls.keyUsageNotCriticalCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/keyUsageNotCriticalcRLSignFalseCACRL.crl" resource_id="test.data.PKITS.crls.keyUsageNotCriticalcRLSignFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/keyUsageNotCriticalkeyCertSignFalseCACRL.crl" resource_id="test.data.PKITS.crls.keyUsageNotCriticalkeyCertSignFalseCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/LongSerialNumberCACRL.crl" resource_id="test.data.PKITS.crls.LongSerialNumberCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/Mapping1to2CACRL.crl" resource_id="test.data.PKITS.crls.Mapping1to2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/MappingFromanyPolicyCACRL.crl" resource_id="test.data.PKITS.crls.MappingFromanyPolicyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/MappingToanyPolicyCACRL.crl" resource_id="test.data.PKITS.crls.MappingToanyPolicyCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/MissingbasicConstraintsCACRL.crl" resource_id="test.data.PKITS.crls.MissingbasicConstraintsCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN1CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN1subCA1CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN1subCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN1subCA2CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN1subCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN1subCA3CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN1subCA3CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN2CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN3CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN3CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN3subCA1CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN3subCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN3subCA2CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN3subCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN4CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN4CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDN5CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDN5CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDNS1CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDNS1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsDNS2CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsDNS2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsRFC822CA1CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsRFC822CA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsRFC822CA2CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsRFC822CA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsRFC822CA3CRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsRFC822CA3CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsURI1CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsURI1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/nameConstraintsURI2CACRL.crl" resource_id="test.data.PKITS.crls.nameConstraintsURI2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/NameOrderCACRL.crl" resource_id="test.data.PKITS.crls.NameOrderCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/NegativeSerialNumberCACRL.crl" resource_id="test.data.PKITS.crls.NegativeSerialNumberCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/NoissuingDistributionPointCACRL.crl" resource_id="test.data.PKITS.crls.NoissuingDistributionPointCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/NoPoliciesCACRL.crl" resource_id="test.data.PKITS.crls.NoPoliciesCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/OldCRLnextUpdateCACRL.crl" resource_id="test.data.PKITS.crls.OldCRLnextUpdateCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlyContainsAttributeCertsCACRL.crl" resource_id="test.data.PKITS.crls.onlyContainsAttributeCertsCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlyContainsCACertsCACRL.crl" resource_id="test.data.PKITS.crls.onlyContainsCACertsCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlyContainsUserCertsCACRL.crl" resource_id="test.data.PKITS.crls.onlyContainsUserCertsCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA1compromiseCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA1compromiseCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA1otherreasonsCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA1otherreasonsCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA2CRL1.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA2CRL1.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA2CRL2.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA2CRL2.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA3compromiseCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA3compromiseCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA3otherreasonsCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA3otherreasonsCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA4compromiseCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA4compromiseCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/onlySomeReasonsCA4otherreasonsCRL.crl" resource_id="test.data.PKITS.crls.onlySomeReasonsCA4otherreasonsCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P12Mapping1to3CACRL.crl" resource_id="test.data.PKITS.crls.P12Mapping1to3CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P12Mapping1to3subCACRL.crl" resource_id="test.data.PKITS.crls.P12Mapping1to3subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P12Mapping1to3subsubCACRL.crl" resource_id="test.data.PKITS.crls.P12Mapping1to3subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P1anyPolicyMapping1to2CACRL.crl" resource_id="test.data.PKITS.crls.P1anyPolicyMapping1to2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P1Mapping1to234CACRL.crl" resource_id="test.data.PKITS.crls.P1Mapping1to234CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/P1Mapping1to234subCACRL.crl" resource_id="test.data.PKITS.crls.P1Mapping1to234subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PanyPolicyMapping1to2CACRL.crl" resource_id="test.data.PKITS.crls.PanyPolicyMapping1to2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint0CACRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint0CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint0subCA2CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint0subCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint0subCACRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint0subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint1CACRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint1CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint1subCACRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint1subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6CACRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subCA0CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subCA0CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subCA1CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subCA1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subCA4CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subCA4CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subsubCA00CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subsubCA00CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subsubCA11CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subsubCA11CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subsubCA41CRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subsubCA41CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subsubsubCA11XCRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subsubsubCA11XCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pathLenConstraint6subsubsubCA41XCRL.crl" resource_id="test.data.PKITS.crls.pathLenConstraint6subsubsubCA41XCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP1234CACRL.crl" resource_id="test.data.PKITS.crls.PoliciesP1234CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP1234subCAP123CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP1234subCAP123CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP1234subsubCAP123P12CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP1234subsubCAP123P12CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP123CACRL.crl" resource_id="test.data.PKITS.crls.PoliciesP123CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP123subCAP12CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP123subCAP12CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP123subsubCAP12P1CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP123subsubCAP12P1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP123subsubCAP2P2CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP123subsubCAP2P2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP123subsubsubCAP12P2P1CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP123subsubsubCAP12P2P1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP12CACRL.crl" resource_id="test.data.PKITS.crls.PoliciesP12CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP12subCAP1CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP12subCAP1CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP12subsubCAP1P2CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP12subsubCAP1P2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP2subCA2CRL.crl" resource_id="test.data.PKITS.crls.PoliciesP2subCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP2subCACRL.crl" resource_id="test.data.PKITS.crls.PoliciesP2subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/PoliciesP3CACRL.crl" resource_id="test.data.PKITS.crls.PoliciesP3CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/pre2000CRLnextUpdateCACRL.crl" resource_id="test.data.PKITS.crls.pre2000CRLnextUpdateCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy0CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy0CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy0subCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy0subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy0subsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy0subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy0subsubsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy0subsubsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy10CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy10CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy10subCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy10subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy10subsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy10subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy10subsubsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy10subsubsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy2CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy2CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy2subCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy2subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy4CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy4CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy4subCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy4subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy4subsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy4subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy4subsubsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy4subsubsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy5CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy5CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy5subCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy5subCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy5subsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy5subsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy5subsubsubCACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy5subsubsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy7CACRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy7CACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy7subCARE2CRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy7subCARE2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy7subsubCARE2RE4CRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy7subsubCARE2RE4CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/requireExplicitPolicy7subsubsubCARE2RE4CRL.crl" resource_id="test.data.PKITS.crls.requireExplicitPolicy7subsubsubCARE2RE4CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/RevokedsubCACRL.crl" resource_id="test.data.PKITS.crls.RevokedsubCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/RFC3280MandatoryAttributeTypesCACRL.crl" resource_id="test.data.PKITS.crls.RFC3280MandatoryAttributeTypesCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/RFC3280OptionalAttributeTypesCACRL.crl" resource_id="test.data.PKITS.crls.RFC3280OptionalAttributeTypesCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/RolloverfromPrintableStringtoUTF8StringCACRL.crl" resource_id="test.data.PKITS.crls.RolloverfromPrintableStringtoUTF8StringCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/SeparateCertificateandCRLKeysCA2CRL.crl" resource_id="test.data.PKITS.crls.SeparateCertificateandCRLKeysCA2CRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/SeparateCertificateandCRLKeysCRL.crl" resource_id="test.data.PKITS.crls.SeparateCertificateandCRLKeysCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/TrustAnchorRootCRL.crl" resource_id="test.data.PKITS.crls.TrustAnchorRootCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/TwoCRLsCABadCRL.crl" resource_id="test.data.PKITS.crls.TwoCRLsCABadCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/TwoCRLsCAGoodCRL.crl" resource_id="test.data.PKITS.crls.TwoCRLsCAGoodCRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/UIDCACRL.crl" resource_id="test.data.PKITS.crls.UIDCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/UnknownCRLEntryExtensionCACRL.crl" resource_id="test.data.PKITS.crls.UnknownCRLEntryExtensionCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/UnknownCRLExtensionCACRL.crl" resource_id="test.data.PKITS.crls.UnknownCRLExtensionCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/UTF8StringCaseInsensitiveMatchCACRL.crl" resource_id="test.data.PKITS.crls.UTF8StringCaseInsensitiveMatchCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/UTF8StringEncodedNamesCACRL.crl" resource_id="test.data.PKITS.crls.UTF8StringEncodedNamesCACRL.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/PKITS/crls/WrongCRLCACRL.crl" resource_id="test.data.PKITS.crls.WrongCRLCACRL.crl" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/PKITS/README.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-A.p12" resource_id="test.data.rsa3.self-testcase-A.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-A.pem" resource_id="test.data.rsa3.self-testcase-A.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-B.p12" resource_id="test.data.rsa3.self-testcase-B.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-B.pem" resource_id="test.data.rsa3.self-testcase-B.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-C.p12" resource_id="test.data.rsa3.self-testcase-C.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-C.pem" resource_id="test.data.rsa3.self-testcase-C.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-D.p12" resource_id="test.data.rsa3.self-testcase-D.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-D.pem" resource_id="test.data.rsa3.self-testcase-D.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-E.p12" resource_id="test.data.rsa3.self-testcase-E.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-E.pem" resource_id="test.data.rsa3.self-testcase-E.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-F.p12" resource_id="test.data.rsa3.self-testcase-F.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-F.pem" resource_id="test.data.rsa3.self-testcase-F.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-G.p12" resource_id="test.data.rsa3.self-testcase-G.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-G.pem" resource_id="test.data.rsa3.self-testcase-G.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-H.p12" resource_id="test.data.rsa3.self-testcase-H.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-H.pem" resource_id="test.data.rsa3.self-testcase-H.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-I.p12" resource_id="test.data.rsa3.self-testcase-I.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-I.pem" resource_id="test.data.rsa3.self-testcase-I.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-J.p12" resource_id="test.data.rsa3.self-testcase-J.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-J.pem" resource_id="test.data.rsa3.self-testcase-J.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-L.p12" resource_id="test.data.rsa3.self-testcase-L.p12" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rsa3/self-testcase-L.pem" resource_id="test.data.rsa3.self-testcase-L.pem" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/rsa3/testcases.README" />
-    <File subtype="Directory" buildaction="Compile" name="test/data/hc256/hc128" />
-    <File subtype="Directory" buildaction="Compile" name="test/data/hc256/hc256" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/hc256/hc128/ecrypt_HC-128.txt" resource_id="test.data.hc256.hc128.ecrypt_HC-128.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/hc256/hc256/ecrypt_HC-256_128K_128IV.txt" resource_id="test.data.hc256.hc256.ecrypt_HC-256_128K_128IV.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/hc256/hc256/ecrypt_HC-256_128K_256IV.txt" resource_id="test.data.hc256.hc256.ecrypt_HC-256_128K_256IV.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/hc256/hc256/ecrypt_HC-256_256K_128IV.txt" resource_id="test.data.hc256.hc256.ecrypt_HC-256_256K_128IV.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/hc256/hc256/ecrypt_HC-256_256K_256IV.txt" resource_id="test.data.hc256.hc256.ecrypt_HC-256_256K_256IV.txt" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/HCFamilyVecTest.cs" />
-    <File subtype="Directory" buildaction="Compile" name="src/crypto/util" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/util/Pack.cs" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/keys/README.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And128BitRC2_CBC.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And128BitRC2_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And128BitRC4.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And128BitRC4.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And2_Key_TripleDES_CBC.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And2_Key_TripleDES_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And3_Key_TripleDES_CBC.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And3_Key_TripleDES_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And40BitRC2_CBC.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And40BitRC2_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbe_WithSHA1And40BitRC4.key" resource_id="test.data.keys.pbes1.pbe_WithSHA1And40BitRC4.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithMD2AndDES_CBC.key" resource_id="test.data.keys.pbes1.pbeWithMD2AndDES_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithMD2AndRC2_CBC.key" resource_id="test.data.keys.pbes1.pbeWithMD2AndRC2_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithMD5AndDES_CBC.key" resource_id="test.data.keys.pbes1.pbeWithMD5AndDES_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithMD5AndRC2_CBC.key" resource_id="test.data.keys.pbes1.pbeWithMD5AndRC2_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithSHA1AndDES_CBC.key" resource_id="test.data.keys.pbes1.pbeWithSHA1AndDES_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes1/pbeWithSHA1AndRC2_CBC.key" resource_id="test.data.keys.pbes1.pbeWithSHA1AndRC2_CBC.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes128.key" resource_id="test.data.keys.pbes2.pbes2.aes128.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-cbc.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-cfb.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-cfb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-cfb1.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-cfb1.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-cfb8.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-cfb8.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-ecb.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-ecb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-128-ofb.key" resource_id="test.data.keys.pbes2.pbes2.aes-128-ofb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes192.key" resource_id="test.data.keys.pbes2.pbes2.aes192.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-cbc.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-cfb.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-cfb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-cfb1.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-cfb1.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-cfb8.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-cfb8.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-ecb.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-ecb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-192-ofb.key" resource_id="test.data.keys.pbes2.pbes2.aes-192-ofb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes256.key" resource_id="test.data.keys.pbes2.pbes2.aes256.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-cbc.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-cfb.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-cfb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-cfb1.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-cfb1.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-cfb8.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-cfb8.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-ecb.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-ecb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.aes-256-ofb.key" resource_id="test.data.keys.pbes2.pbes2.aes-256-ofb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.bf.key" resource_id="test.data.keys.pbes2.pbes2.bf.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.bf-cbc.key" resource_id="test.data.keys.pbes2.pbes2.bf-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.blowfish.key" resource_id="test.data.keys.pbes2.pbes2.blowfish.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.cast.key" resource_id="test.data.keys.pbes2.pbes2.cast.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.cast5-cbc.key" resource_id="test.data.keys.pbes2.pbes2.cast5-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.cast-cbc.key" resource_id="test.data.keys.pbes2.pbes2.cast-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des.key" resource_id="test.data.keys.pbes2.pbes2.des.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des3.key" resource_id="test.data.keys.pbes2.pbes2.des3.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-cbc.key" resource_id="test.data.keys.pbes2.pbes2.des-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-cfb.key" resource_id="test.data.keys.pbes2.pbes2.des-cfb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-cfb1.key" resource_id="test.data.keys.pbes2.pbes2.des-cfb1.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-cfb8.key" resource_id="test.data.keys.pbes2.pbes2.des-cfb8.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-ecb.key" resource_id="test.data.keys.pbes2.pbes2.des-ecb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-ede.key" resource_id="test.data.keys.pbes2.pbes2.des-ede.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-ede3-cbc.key" resource_id="test.data.keys.pbes2.pbes2.des-ede3-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.des-ofb.key" resource_id="test.data.keys.pbes2.pbes2.des-ofb.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.rc2.key" resource_id="test.data.keys.pbes2.pbes2.rc2.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.rc2-40-cbc.key" resource_id="test.data.keys.pbes2.pbes2.rc2-40-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.rc2-64-cbc.key" resource_id="test.data.keys.pbes2.pbes2.rc2-64-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/keys/pbes2/pbes2.rc2-cbc.key" resource_id="test.data.keys.pbes2.pbes2.rc2-cbc.key" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/scrypt/TestVectors.txt" resource_id="test.data.scrypt.TestVectors.txt" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/tls/keystores/client_store.dsa" resource_id="test.data.tls.keystores.client_store.dsa" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/tls/keystores/client_store.rsa" resource_id="test.data.tls.keystores.client_store.rsa" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/tls/keystores/server_store.dsa" resource_id="test.data.tls.keystores.server_store.dsa" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/tls/keystores/server_store.rsa" resource_id="test.data.tls.keystores.server_store.rsa" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/AuthEnvelopedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/AuthEnvelopedDataParser.cs" />
-    <File subtype="Directory" buildaction="Compile" name="src/crypto/modes/gcm" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/BasicGcmMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/GcmUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/IGcmMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/Tables64kGcmMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/Tables8kGcmMultiplier.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthenticatedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthenticatedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthenticatedGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthenticatedDataGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/CMSAuthenticatedDataStreamGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/AuthenticatedDataTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/AuthenticatedDataStreamTest.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignData.data" resource_id="test.data.cms.sigs.PSSSignData.data" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA1.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA1.sig" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA1Enc.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA1Enc.sig" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA256.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA256.sig" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA256Enc.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA256Enc.sig" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA512.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA512.sig" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/PSSSignDataSHA512Enc.sig" resource_id="test.data.cms.sigs.PSSSignDataSHA512Enc.sig" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/SubjectKeyIdentifierTest.cs" />
-    <File subtype="Directory" buildaction="Compile" name="src/asn1/cms/ecc" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/ecc/MQVuserKeyingMaterial.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/RecipientInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KEKRecipientInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KeyTransRecipientInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/KeyAgreeRecipientInfoGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/PasswordRecipientInfoGenerator.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/3.1.bin" resource_id="test.data.rfc4134.3.1.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/3.2.bin" resource_id="test.data.rfc4134.3.2.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.1.bin" resource_id="test.data.rfc4134.4.1.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.10.bin" resource_id="test.data.rfc4134.4.10.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.11.bin" resource_id="test.data.rfc4134.4.11.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.2.bin" resource_id="test.data.rfc4134.4.2.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.3.bin" resource_id="test.data.rfc4134.4.3.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.4.bin" resource_id="test.data.rfc4134.4.4.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.5.bin" resource_id="test.data.rfc4134.4.5.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.6.bin" resource_id="test.data.rfc4134.4.6.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.7.bin" resource_id="test.data.rfc4134.4.7.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.8.eml" resource_id="test.data.rfc4134.4.8.eml" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/4.9.eml" resource_id="test.data.rfc4134.4.9.eml" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/5.1.bin" resource_id="test.data.rfc4134.5.1.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/5.2.bin" resource_id="test.data.rfc4134.5.2.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/5.3.eml" resource_id="test.data.rfc4134.5.3.eml" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/6.0.bin" resource_id="test.data.rfc4134.6.0.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/7.1.bin" resource_id="test.data.rfc4134.7.1.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/7.2.bin" resource_id="test.data.rfc4134.7.2.bin" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/AliceDSSSignByCarlNoInherit.cer" resource_id="test.data.rfc4134.AliceDSSSignByCarlNoInherit.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/AlicePrivDSSSign.pri" resource_id="test.data.rfc4134.AlicePrivDSSSign.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/AlicePrivRSASign.pri" resource_id="test.data.rfc4134.AlicePrivRSASign.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/AliceRSASignByCarl.cer" resource_id="test.data.rfc4134.AliceRSASignByCarl.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/BobPrivRSAEncrypt.pri" resource_id="test.data.rfc4134.BobPrivRSAEncrypt.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/BobRSASignByCarl.cer" resource_id="test.data.rfc4134.BobRSASignByCarl.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlDSSCRLEmpty.crl" resource_id="test.data.rfc4134.CarlDSSCRLEmpty.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlDSSCRLForAll.crl" resource_id="test.data.rfc4134.CarlDSSCRLForAll.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlDSSCRLForCarl.crl" resource_id="test.data.rfc4134.CarlDSSCRLForCarl.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlDSSSelf.cer" resource_id="test.data.rfc4134.CarlDSSSelf.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlPrivDSSSign.pri" resource_id="test.data.rfc4134.CarlPrivDSSSign.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlPrivRSASign.pri" resource_id="test.data.rfc4134.CarlPrivRSASign.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlRSACRLEmpty.crl" resource_id="test.data.rfc4134.CarlRSACRLEmpty.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlRSACRLForAll.crl" resource_id="test.data.rfc4134.CarlRSACRLForAll.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlRSACRLForCarl.crl" resource_id="test.data.rfc4134.CarlRSACRLForCarl.crl" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/CarlRSASelf.cer" resource_id="test.data.rfc4134.CarlRSASelf.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/DianeDSSSignByCarlInherit.cer" resource_id="test.data.rfc4134.DianeDSSSignByCarlInherit.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/DianePrivDSSSign.pri" resource_id="test.data.rfc4134.DianePrivDSSSign.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/DianePrivRSASignEncrypt.pri" resource_id="test.data.rfc4134.DianePrivRSASignEncrypt.pri" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/DianeRSASignByCarl.cer" resource_id="test.data.rfc4134.DianeRSASignByCarl.cer" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/rfc4134/ExContent.bin" resource_id="test.data.rfc4134.ExContent.bin" />
-    <File subtype="Code" buildaction="Nothing" name="test/data/rfc4134/rfc4134.txt" />
-    <File subtype="Code" buildaction="Compile" name="test/src/cms/test/Rfc4134Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/StreamOverflowException.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/pkcs/examples/PKCS12Example.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERExternal.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/DERExternalParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/MqvPrivateParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/MqvPublicParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/ECMqvBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/agreement/ECMqvWithKdfBasicAgreement.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/MqvTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/bc/BCObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/EssCertIDv2UnitTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/Pkcs12Utilities.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/cms/sigs/counterSig.p7m" resource_id="test.data.cms.sigs.counterSig.p7m" />
-    <File subtype="Code" buildaction="Compile" name="src/pkcs/Pkcs10CertificationRequestDelaySigned.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/pkcs8/openssl_pkcs8_rsa.pem" resource_id="test.data.openssl.pkcs8.openssl_pkcs8_rsa.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/pkcs8/openssl_pkcs8_rsa_enc.pem" resource_id="test.data.openssl.pkcs8.openssl_pkcs8_rsa_enc.pem" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsClient.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/SecurityParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsNullCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/DefaultTlsClient.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsBlockCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsStreamCipher.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDHKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsSrpKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsRsaKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/IGcmExponentiator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/BasicGcmExponentiator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/modes/gcm/Tables1kGcmExponentiator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1Exception.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/Asn1ParsingException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/pkix/PkixCrlUtilities.cs" />
-    <File subtype="Directory" buildaction="Compile" name="src/util/io/pem" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemObjectGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemObjectParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemGenerationException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemObject.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/LinkedDictionary.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableDictionary.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableDictionaryProxy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemWriter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemReader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/MiscPemGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/openssl/Pkcs8Generator.cs" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/eckey.pem" resource_id="test.data.openssl.eckey.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/enckey.pem" resource_id="test.data.openssl.enckey.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/pkcs7.pem" resource_id="test.data.openssl.pkcs7.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/pkcs8test.pem" resource_id="test.data.openssl.pkcs8test.pem" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/openssl/test.pem" resource_id="test.data.openssl.test.pem" />
-    <File subtype="Code" buildaction="Compile" name="test/src/test/CMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openssl/test/AllTests.cs" />
-    <File subtype="Directory" buildaction="Compile" name="test/src/util/io" />
-    <File subtype="Directory" buildaction="Compile" name="test/src/util/io/pem" />
-    <File subtype="Directory" buildaction="Compile" name="test/src/util/io/pem/test" />
-    <File subtype="Code" buildaction="Compile" name="test/src/util/io/pem/test/AllTests.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/pem/PemHeader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableList.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableListProxy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/AlertDescription.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/AlertLevel.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/CompressionMethod.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ContentType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ECCurveType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ECPointFormat.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ExtensionType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/HandshakeType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/ClientCertificateType.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/NamedCurve.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/CipherSuite.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDheKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDsaSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsECDsaSigner.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsECDheKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsECDHKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/asn1/test/CscaMasterListTest.cs" />
-    <File subtype="Directory" buildaction="Compile" name="test/data/asn1" />
-    <File subtype="Code" buildaction="EmbedAsResource" name="test/data/asn1/masterlist-content.data" resource_id="test.data.asn1.masterlist-content.data" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/CertificateRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/KeyExchangeAlgorithm.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/DigestAlgorithm.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/EncryptionAlgorithm.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsAuthentication.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsCredentials.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsSignerCredentials.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsAgreementCredentials.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsFatalAlert.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsClientContext.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsClientContextImpl.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/DefaultTlsSignerCredentials.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/DefaultTlsAgreementCredentials.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/LegacyTlsAuthentication.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsCipherFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/DefaultTlsCipherFactory.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/LegacyTlsClient.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/SrpTlsClient.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsCompression.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsNullCompression.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/io/TeeInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDeflateCompression.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/ZOutputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/zlib/ZInputStream.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/icao/LDSVersionInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/openpgp/examples/PgpExampleUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/Attributes.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableSet.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/collections/UnmodifiableSetProxy.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/cms/DefaultAuthenticatedAttributeTableGenerator.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/MetaData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/Evidence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/TimeStampAndCRL.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/TimeStampedData.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/TimeStampedDataParser.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cms/TimeStampTokenEvidence.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/Enums.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/AttributeTypeAndValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertId.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertReqMessages.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertReqMsg.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertRequest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertTemplate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CertTemplateBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/Controls.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/CrmfObjectIdentifiers.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/EncKeyWithID.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/EncryptedKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/EncryptedValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/OptionalValidity.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PKIArchiveOptions.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PKIPublicationInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PKMacValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PopoPrivKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PopoSigningKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/PopoSigningKeyInput.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/ProofOfPossession.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/SinglePubInfo.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/crmf/SubsequentMessage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CmpCertificate.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/InfoTypeAndValue.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIBody.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIHeader.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIMessage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIMessages.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PbmParameter.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertConfirmContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertStatus.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertRepMessage.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertResponse.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertifiedKeyPair.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CertOrEncCert.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CAKeyUpdAnnContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/Challenge.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/CrlAnnContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/ErrorMsgContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/GenMsgContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/GenRepContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIConfirmContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/KeyRecRepContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/RevAnnContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/OobCertHash.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PKIHeaderBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PollRepContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PollReqContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/ProtectedPart.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PopoDecKeyChallContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/PopoDecKeyRespContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/RevDetails.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/RevRepContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/RevReqContent.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/asn1/cmp/RevRepContentBuilder.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsDHUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsRsaUtilities.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsPskIdentity.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/TlsPskKeyExchange.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/PskTlsClient.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/tls/Ssl3Mac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/RevocationKey.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/RevocationReason.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/RevocationReasonTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/bcpg/sig/RevocationKeyTags.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/engines/ThreefishEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/TweakableBlockCipherParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Threefish256Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Threefish512Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Threefish1024Test.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/parameters/SkeinParameters.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/SkeinDigest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/SkeinEngine.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SkeinDigestTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/SkeinMacTest.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/macs/SkeinMac.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/IMemoable.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/util/MemoableResetException.cs" />
-    <File subtype="Code" buildaction="Compile" name="src/crypto/digests/Sm3Digest.cs" />
-    <File subtype="Code" buildaction="Compile" name="test/src/crypto/test/Sm3DigestTest.cs" />
-  </Contents>
-  <References>
-    <ProjectReference type="Assembly" localcopy="True" refto="test/lib/nunit.core.dll" />
-    <ProjectReference type="Assembly" localcopy="True" refto="test/lib/nunit.core.interfaces.dll" />
-    <ProjectReference type="Assembly" localcopy="True" refto="test/lib/nunit.framework.dll" />
-    <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  </References>
-  <DeploymentInformation strategy="File" />
-</Project>
diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs
index 4e85daa95..ce84074f2 100644
--- a/crypto/src/AssemblyInfo.cs
+++ b/crypto/src/AssemblyInfo.cs
@@ -9,17 +9,12 @@ using System.Runtime.InteropServices;
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 //
-#if INCLUDE_IDEA
-[assembly: AssemblyTitle("BouncyCastle.CryptoExt")]
-[assembly: AssemblyDescription("Bouncy Castle Cryptography API (Extended)")]
-#else
 [assembly: AssemblyTitle("BouncyCastle.Crypto")]
 [assembly: AssemblyDescription("Bouncy Castle Cryptography API")]
-#endif
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("The Legion of the Bouncy Castle")]
 [assembly: AssemblyProduct("Bouncy Castle for .NET")]
-[assembly: AssemblyCopyright("Copyright (C) 2000-2011")]
+[assembly: AssemblyCopyright("Copyright (C) 2000-2013")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
diff --git a/crypto/src/asn1/Asn1InputStream.cs b/crypto/src/asn1/Asn1InputStream.cs
index a72049b56..5d5590655 100644
--- a/crypto/src/asn1/Asn1InputStream.cs
+++ b/crypto/src/asn1/Asn1InputStream.cs
@@ -319,9 +319,9 @@ namespace Org.BouncyCastle.Asn1
             switch (tagNo)
             {
                 case Asn1Tags.Boolean:
-                    return new DerBoolean(GetBuffer(defIn, tmpBuffers));
+                    return DerBoolean.FromOctetString(GetBuffer(defIn, tmpBuffers));
                 case Asn1Tags.Enumerated:
-                    return new DerEnumerated(GetBuffer(defIn, tmpBuffers));
+                    return DerEnumerated.FromOctetString(GetBuffer(defIn, tmpBuffers));
                 case Asn1Tags.ObjectIdentifier:
                     return DerObjectIdentifier.FromOctetString(GetBuffer(defIn, tmpBuffers));
             }
diff --git a/crypto/src/asn1/DerBoolean.cs b/crypto/src/asn1/DerBoolean.cs
index 41ccae8a1..66791d16c 100644
--- a/crypto/src/asn1/DerBoolean.cs
+++ b/crypto/src/asn1/DerBoolean.cs
@@ -7,10 +7,10 @@ namespace Org.BouncyCastle.Asn1
     {
         private readonly byte value;
 
-		public static readonly DerBoolean False = new DerBoolean(false);
+        public static readonly DerBoolean False = new DerBoolean(false);
         public static readonly DerBoolean True  = new DerBoolean(true);
 
-		/**
+        /**
          * return a bool from the passed in object.
          *
          * @exception ArgumentException if the object cannot be converted.
@@ -23,10 +23,10 @@ namespace Org.BouncyCastle.Asn1
                 return (DerBoolean) obj;
             }
 
-			throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name);
+            throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name);
         }
 
-		/**
+        /**
          * return a DerBoolean from the passed in bool.
          */
         public static DerBoolean GetInstance(
@@ -35,7 +35,7 @@ namespace Org.BouncyCastle.Asn1
             return value ? True : False;
         }
 
-		/**
+        /**
          * return a Boolean from a tagged object.
          *
          * @param obj the tagged object holding the object we want
@@ -48,63 +48,75 @@ namespace Org.BouncyCastle.Asn1
             Asn1TaggedObject	obj,
             bool				isExplicit)
         {
-			Asn1Object o = obj.GetObject();
+            Asn1Object o = obj.GetObject();
 
-			if (isExplicit || o is DerBoolean)
-			{
-				return GetInstance(o);
-			}
+            if (isExplicit || o is DerBoolean)
+            {
+                return GetInstance(o);
+            }
 
-			return new DerBoolean(((Asn1OctetString)o).GetOctets());
+            return FromOctetString(((Asn1OctetString)o).GetOctets());
         }
 
-		public DerBoolean(
+        public DerBoolean(
             byte[] val)
         {
-			if (val.Length != 1)
-				throw new ArgumentException("byte value should have 1 byte in it", "val");
+            if (val.Length != 1)
+                throw new ArgumentException("byte value should have 1 byte in it", "val");
 
-			// TODO Are there any constraints on the possible byte values?
+            // TODO Are there any constraints on the possible byte values?
             this.value = val[0];
         }
 
-		private DerBoolean(
+        private DerBoolean(
             bool value)
         {
             this.value = value ? (byte)0xff : (byte)0;
         }
 
-		public bool IsTrue
-		{
-			get { return value != 0; }
-		}
+        public bool IsTrue
+        {
+            get { return value != 0; }
+        }
 
-		internal override void Encode(
+        internal override void Encode(
             DerOutputStream derOut)
         {
-			// TODO Should we make sure the byte value is one of '0' or '0xff' here?
-			derOut.WriteEncoded(Asn1Tags.Boolean, new byte[]{ value });
+            // TODO Should we make sure the byte value is one of '0' or '0xff' here?
+            derOut.WriteEncoded(Asn1Tags.Boolean, new byte[]{ value });
         }
 
-		protected override bool Asn1Equals(
-			Asn1Object asn1Object)
+        protected override bool Asn1Equals(
+            Asn1Object asn1Object)
         {
-			DerBoolean other = asn1Object as DerBoolean;
+            DerBoolean other = asn1Object as DerBoolean;
 
-			if (other == null)
-				return false;
+            if (other == null)
+                return false;
 
-			return IsTrue == other.IsTrue;
+            return IsTrue == other.IsTrue;
+        }
+
+        protected override int Asn1GetHashCode()
+        {
+            return IsTrue.GetHashCode();
         }
 
-		protected override int Asn1GetHashCode()
-		{
-			return IsTrue.GetHashCode();
+        public override string ToString()
+        {
+            return IsTrue ? "TRUE" : "FALSE";
         }
 
-		public override string ToString()
-		{
-			return IsTrue ? "TRUE" : "FALSE";
-		}
-	}
+        internal static DerBoolean FromOctetString(byte[] value)
+        {
+            if (value.Length != 1)
+            {
+                throw new ArgumentException("BOOLEAN value should have 1 byte in it", "value");
+            }
+
+            byte b = value[0];
+
+            return b == 0 ? False : b == 0xFF ? True : new DerBoolean(value);
+        }
+    }
 }
diff --git a/crypto/src/asn1/DerEnumerated.cs b/crypto/src/asn1/DerEnumerated.cs
index 0e67e6dbe..2638b0205 100644
--- a/crypto/src/asn1/DerEnumerated.cs
+++ b/crypto/src/asn1/DerEnumerated.cs
@@ -10,7 +10,7 @@ namespace Org.BouncyCastle.Asn1
     {
         private readonly byte[] bytes;
 
-		/**
+        /**
          * return an integer from the passed in object
          *
          * @exception ArgumentException if the object cannot be converted.
@@ -39,14 +39,14 @@ namespace Org.BouncyCastle.Asn1
             Asn1TaggedObject	obj,
             bool				isExplicit)
         {
-			Asn1Object o = obj.GetObject();
+            Asn1Object o = obj.GetObject();
 
-			if (isExplicit || o is DerEnumerated)
-			{
-				return GetInstance(o);
-			}
+            if (isExplicit || o is DerEnumerated)
+            {
+                return GetInstance(o);
+            }
 
-			return new DerEnumerated(((Asn1OctetString)o).GetOctets());
+            return FromOctetString(((Asn1OctetString)o).GetOctets());
         }
 
         public DerEnumerated(
@@ -69,32 +69,56 @@ namespace Org.BouncyCastle.Asn1
 
         public BigInteger Value
         {
-            get
-            {
-                return new BigInteger(bytes);
-            }
+            get { return new BigInteger(bytes); }
         }
 
-		internal override void Encode(
+        internal override void Encode(
             DerOutputStream derOut)
         {
             derOut.WriteEncoded(Asn1Tags.Enumerated, bytes);
         }
 
-		protected override bool Asn1Equals(
-			Asn1Object asn1Object)
+        protected override bool Asn1Equals(
+            Asn1Object asn1Object)
         {
-			DerEnumerated other = asn1Object as DerEnumerated;
+            DerEnumerated other = asn1Object as DerEnumerated;
+
+            if (other == null)
+                return false;
 
-			if (other == null)
-				return false;
+            return Arrays.AreEqual(this.bytes, other.bytes);
+        }
 
-			return Arrays.AreEqual(this.bytes, other.bytes);
+        protected override int Asn1GetHashCode()
+        {
+            return Arrays.GetHashCode(bytes);
         }
 
-		protected override int Asn1GetHashCode()
-		{
-			return Arrays.GetHashCode(bytes);
+        private static readonly DerEnumerated[] cache = new DerEnumerated[12];
+
+        internal static DerEnumerated FromOctetString(byte[] enc)
+        {
+            if (enc.Length == 0)
+            {
+                throw new ArgumentException("ENUMERATED has zero length", "enc");
+            }
+
+            if (enc.Length == 1)
+            {
+                int value = enc[0];
+                if (value < cache.Length)
+                {
+                    DerEnumerated cached = cache[value];
+                    if (cached != null)
+                    {
+                        return cached;
+                    }
+
+                    return cache[value] = new DerEnumerated(Arrays.Clone(enc));
+                }
+            }
+
+            return new DerEnumerated(Arrays.Clone(enc));
         }
     }
 }
diff --git a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs
index 0185b2a62..f322ef88f 100644
--- a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs
+++ b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs
Binary files differdiff --git a/crypto/src/asn1/sec/SECNamedCurves.cs b/crypto/src/asn1/sec/SECNamedCurves.cs
index c8d952b2e..b9302823f 100644
--- a/crypto/src/asn1/sec/SECNamedCurves.cs
+++ b/crypto/src/asn1/sec/SECNamedCurves.cs
@@ -11,1181 +11,1181 @@ using Org.BouncyCastle.Utilities.Encoders;
 
 namespace Org.BouncyCastle.Asn1.Sec
 {
-	public sealed class SecNamedCurves
-	{
-		private SecNamedCurves()
-		{
-		}
-
-		private static BigInteger FromHex(
-			string hex)
-		{
-			return new BigInteger(1, Hex.Decode(hex));
-		}
-
-		/*
-		 * secp112r1
-		 */
-		internal class Secp112r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp112r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp112r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = (2^128 - 3) / 76439
-				BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B");
-				BigInteger a = FromHex("DB7C2ABF62E35E668076BEAD2088");
-				BigInteger b = FromHex("659EF8BA043916EEDE8911702B22");
-				byte[] S = Hex.Decode("00F50B028E4D696E676875615175290472783FB1");
-				BigInteger n = FromHex("DB7C2ABF62E35E7628DFAC6561C5");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "09487239995A5EE76B55F9C2F098"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "09487239995A5EE76B55F9C2F098"
-					+ "A89CE5AF8724C0A23E0E0FF77500"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp112r2
-		 */
-		internal class Secp112r2Holder
-			: X9ECParametersHolder
-		{
-			private Secp112r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp112r2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = (2^128 - 3) / 76439
-				BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B");
-				BigInteger a = FromHex("6127C24C05F38A0AAAF65C0EF02C");
-				BigInteger b = FromHex("51DEF1815DB5ED74FCC34C85D709");
-				byte[] S = Hex.Decode("002757A1114D696E6768756151755316C05E0BD4");
-				BigInteger n = FromHex("36DF0AAFD8B8D7597CA10520D04B");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "4BA30AB5E892B4E1649DD0928643"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "4BA30AB5E892B4E1649DD0928643"
-					+ "ADCD46F5882E3747DEF36E956E97"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp128r1
-		 */
-		internal class Secp128r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp128r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp128r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^128 - 2^97 - 1
-				BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
-				BigInteger a = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
-				BigInteger b = FromHex("E87579C11079F43DD824993C2CEE5ED3");
-				byte[] S = Hex.Decode("000E0D4D696E6768756151750CC03A4473D03679");
-				BigInteger n = FromHex("FFFFFFFE0000000075A30D1B9038A115");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "161FF7528B899B2D0C28607CA52C5B86"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "161FF7528B899B2D0C28607CA52C5B86"
-					+ "CF5AC8395BAFEB13C02DA292DDED7A83"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp128r2
-		 */
-		internal class Secp128r2Holder
-			: X9ECParametersHolder
-		{
-			private Secp128r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp128r2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^128 - 2^97 - 1
-				BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
-				BigInteger a = FromHex("D6031998D1B3BBFEBF59CC9BBFF9AEE1");
-				BigInteger b = FromHex("5EEEFCA380D02919DC2C6558BB6D8A5D");
-				byte[] S = Hex.Decode("004D696E67687561517512D8F03431FCE63B88F4");
-				BigInteger n = FromHex("3FFFFFFF7FFFFFFFBE0024720613B5A3");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "7B6AA5D85E572983E6FB32A7CDEBC140"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "7B6AA5D85E572983E6FB32A7CDEBC140"
-					+ "27B6916A894D3AEE7106FE805FC34B44"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp160k1
-		 */
-		internal class Secp160k1Holder
-			: X9ECParametersHolder
-		{
-			private Secp160k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp160k1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(7);
-				byte[] S = null;
-				BigInteger n = FromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-					//+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
-					+ "938CF935318FDCED6BC28286531733C3F03C4FEE"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp160r1
-		 */
-		internal class Secp160r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp160r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp160r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^160 - 2^31 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
-				BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
-				BigInteger b = FromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
-				byte[] S = Hex.Decode("1053CDE42C14D696E67687561517533BF3F83345");
-				BigInteger n = FromHex("0100000000000000000001F4C8F927AED3CA752257");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-					//+ "4A96B5688EF573284664698968C38BB913CBFC82"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "4A96B5688EF573284664698968C38BB913CBFC82"
-					+ "23A628553168947D59DCC912042351377AC5FB32"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp160r2
-		 */
-		internal class Secp160r2Holder
-			: X9ECParametersHolder
-		{
-			private Secp160r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp160r2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
-				BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70");
-				BigInteger b = FromHex("B4E134D3FB59EB8BAB57274904664D5AF50388BA");
-				byte[] S = Hex.Decode("B99B99B099B323E02709A4D696E6768756151751");
-				BigInteger n = FromHex("0100000000000000000000351EE786A818F3A1A16B");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "52DCB034293A117E1F4FF11B30F7199D3144CE6D"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "52DCB034293A117E1F4FF11B30F7199D3144CE6D"
-					+ "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp192k1
-		 */
-		internal class Secp192k1Holder
-			: X9ECParametersHolder
-		{
-			private Secp192k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp192k1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(3);
-				byte[] S = null;
-				BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"
-					+ "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp192r1
-		 */
-		internal class Secp192r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp192r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp192r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^192 - 2^64 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
-				BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
-				BigInteger b = FromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
-				byte[] S = Hex.Decode("3045AE6FC8422F64ED579528D38120EAE12196D5");
-				BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"
-					+ "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp224k1
-		 */
-		internal class Secp224k1Holder
-			: X9ECParametersHolder
-		{
-			private Secp224k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp224k1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^224 - 2^32 - 2^12 - 2^11 - 2^9 - 2^7 - 2^4 - 2 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D");
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(5);
-				byte[] S = null;
-				BigInteger n = FromHex("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C"
-					+ "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp224r1
-		 */
-		internal class Secp224r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp224r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp224r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^224 - 2^96 + 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
-				BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
-				BigInteger b = FromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
-				byte[] S = Hex.Decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5");
-				BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"
-					+ "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp256k1
-		 */
-		internal class Secp256k1Holder
-			: X9ECParametersHolder
-		{
-			private Secp256k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp256k1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F");
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(7);
-				byte[] S = null;
-				BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"
-					+ "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp256r1
-		 */
-		internal class Secp256r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp256r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp256r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1
-				BigInteger p = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
-				BigInteger a = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
-				BigInteger b = FromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
-				byte[] S = Hex.Decode("C49D360886E704936A6678E1139D26B7819F7E90");
-				BigInteger n = FromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"
-					+ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp384r1
-		 */
-		internal class Secp384r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp384r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp384r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^384 - 2^128 - 2^96 + 2^32 - 1
-				BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF");
-				BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC");
-				BigInteger b = FromHex("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF");
-				byte[] S = Hex.Decode("A335926AA319A27A1D00896A6773A4827ACDAC73");
-				BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7"
-					+ "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * secp521r1
-		 */
-		internal class Secp521r1Holder
-			: X9ECParametersHolder
-		{
-			private Secp521r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Secp521r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				// p = 2^521 - 1
-				BigInteger p = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
-				BigInteger a = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC");
-				BigInteger b = FromHex("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00");
-				byte[] S = Hex.Decode("D09E8800291CB85396CC6717393284AAA0DA64BA");
-				BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409");
-				BigInteger h = BigInteger.ValueOf(1);
-
-				ECCurve curve = new FpCurve(p, a, b);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66"
-					+ "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect113r1
-		 */
-		internal class Sect113r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect113r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect113r1Holder();
-
-			private const int m = 113;
-			private const int k = 9;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("003088250CA6E7C7FE649CE85820F7");
-				BigInteger b = FromHex("00E8BEE4D3E2260744188BE0E9C723");
-				byte[] S = Hex.Decode("10E723AB14D696E6768756151756FEBF8FCB49A9");
-				BigInteger n = FromHex("0100000000000000D9CCEC8A39E56F");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "009D73616F35F4AB1407D73562C10F"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "009D73616F35F4AB1407D73562C10F"
-					+ "00A52830277958EE84D1315ED31886"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect113r2
-		 */
-		internal class Sect113r2Holder
-			: X9ECParametersHolder
-		{
-			private Sect113r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect113r2Holder();
-
-			private const int m = 113;
-			private const int k = 9;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("00689918DBEC7E5A0DD6DFC0AA55C7");
-				BigInteger b = FromHex("0095E9A9EC9B297BD4BF36E059184F");
-				byte[] S = Hex.Decode("10C0FB15760860DEF1EEF4D696E676875615175D");
-				BigInteger n = FromHex("010000000000000108789B2496AF93");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "01A57A6A7B26CA5EF52FCDB8164797"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "01A57A6A7B26CA5EF52FCDB8164797"
-					+ "00B3ADC94ED1FE674C06E695BABA1D"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect131r1
-		 */
-		internal class Sect131r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect131r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect131r1Holder();
-
-			private const int m = 131;
-			private const int k1 = 2;
-			private const int k2 = 3;
-			private const int k3 = 8;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("07A11B09A76B562144418FF3FF8C2570B8");
-				BigInteger b = FromHex("0217C05610884B63B9C6C7291678F9D341");
-				byte[] S = Hex.Decode("4D696E676875615175985BD3ADBADA21B43A97E2");
-				BigInteger n = FromHex("0400000000000000023123953A9464B54D");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "0081BAF91FDF9833C40F9C181343638399"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0081BAF91FDF9833C40F9C181343638399"
-					+ "078C6E7EA38C001F73C8134B1B4EF9E150"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect131r2
-		 */
-		internal class Sect131r2Holder
-			: X9ECParametersHolder
-		{
-			private Sect131r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect131r2Holder();
-
-			private const int m = 131;
-			private const int k1 = 2;
-			private const int k2 = 3;
-			private const int k3 = 8;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("03E5A88919D7CAFCBF415F07C2176573B2");
-				BigInteger b = FromHex("04B8266A46C55657AC734CE38F018F2192");
-				byte[] S = Hex.Decode("985BD3ADBAD4D696E676875615175A21B43A97E3");
-				BigInteger n = FromHex("0400000000000000016954A233049BA98F");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "0356DCD8F2F95031AD652D23951BB366A8"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0356DCD8F2F95031AD652D23951BB366A8"
-					+ "0648F06D867940A5366D9E265DE9EB240F"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect163k1
-		 */
-		internal class Sect163k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect163k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect163k1Holder();
-
-			private const int m = 163;
-			private const int k1 = 3;
-			private const int k2 = 6;
-			private const int k3 = 7;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("04000000000000000000020108A2E0CC0D99F8A5EF");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8"
-					+ "0289070FB05D38FF58321F2E800536D538CCDAA3D9"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect163r1
-		 */
-		internal class Sect163r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect163r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect163r1Holder();
-
-			private const int m = 163;
-			private const int k1 = 3;
-			private const int k2 = 6;
-			private const int k3 = 7;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("07B6882CAAEFA84F9554FF8428BD88E246D2782AE2");
-				BigInteger b = FromHex("0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9");
-				byte[] S = Hex.Decode("24B7B137C8A14D696E6768756151756FD0DA2E5C");
-				BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "0369979697AB43897789566789567F787A7876A654"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0369979697AB43897789566789567F787A7876A654"
-					+ "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect163r2
-		 */
-		internal class Sect163r2Holder
-			: X9ECParametersHolder
-		{
-			private Sect163r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect163r2Holder();
-
-			private const int m = 163;
-			private const int k1 = 3;
-			private const int k2 = 6;
-			private const int k3 = 7;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = FromHex("020A601907B8C953CA1481EB10512F78744A3205FD");
-				byte[] S = Hex.Decode("85E25BFE5C86226CDB12016F7553F9D0E693A268");
-				BigInteger n = FromHex("040000000000000000000292FE77E70C12A4234C33");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "03F0EBA16286A2D57EA0991168D4994637E8343E36"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "03F0EBA16286A2D57EA0991168D4994637E8343E36"
-					+ "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect193r1
-		 */
-		internal class Sect193r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect193r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect193r1Holder();
-
-			private const int m = 193;
-			private const int k = 15;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01");
-				BigInteger b = FromHex("00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814");
-				byte[] S = Hex.Decode("103FAEC74D696E676875615175777FC5B191EF30");
-				BigInteger n = FromHex("01000000000000000000000000C7F34A778F443ACC920EBA49");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1"
-					+ "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect193r2
-		 */
-		internal class Sect193r2Holder
-			: X9ECParametersHolder
-		{
-			private Sect193r2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect193r2Holder();
-
-			private const int m = 193;
-			private const int k = 15;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = FromHex("0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B");
-				BigInteger b = FromHex("00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE");
-				byte[] S = Hex.Decode("10B7B4D696E676875615175137C8A16FD0DA2211");
-				BigInteger n = FromHex("010000000000000000000000015AAB561B005413CCD4EE99D5");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F"
-					+ "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect233k1
-		 */
-		internal class Sect233k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect233k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect233k1Holder();
-
-			private const int m = 233;
-			private const int k = 74;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"
-					+ "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect233r1
-		 */
-		internal class Sect233r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect233r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect233r1Holder();
-
-			private const int m = 233;
-			private const int k = 74;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = FromHex("0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD");
-				byte[] S = Hex.Decode("74D59FF07F6B413D0EA14B344B20A2DB049B50C3");
-				BigInteger n = FromHex("01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B"
-					+ "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect239k1
-		 */
-		internal class Sect239k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect239k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect239k1Holder();
-
-			private const int m = 239;
-			private const int k = 158;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC"
-					+ "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect283k1
-		 */
-		internal class Sect283k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect283k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect283k1Holder();
-
-			private const int m = 283;
-			private const int k1 = 5;
-			private const int k2 = 7;
-			private const int k3 = 12;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836"
-					+ "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect283r1
-		 */
-		internal class Sect283r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect283r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect283r1Holder();
-
-			private const int m = 283;
-			private const int k1 = 5;
-			private const int k2 = 7;
-			private const int k3 = 12;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = FromHex("027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5");
-				byte[] S = Hex.Decode("77E2B07370EB0F832A6DD5B62DFC88CD06BB84BE");
-				BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053"
-					+ "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect409k1
-		 */
-		internal class Sect409k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect409k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect409k1Holder();
-
-			private const int m = 409;
-			private const int k = 87;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746"
-					+ "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect409r1
-		 */
-		internal class Sect409r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect409r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect409r1Holder();
-
-			private const int m = 409;
-			private const int k = 87;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = FromHex("0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F");
-				byte[] S = Hex.Decode("4099B5A457F9D69F79213D094C4BCD4D4262210B");
-				BigInteger n = FromHex("010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7"
-					+ "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect571k1
-		 */
-		internal class Sect571k1Holder
-			: X9ECParametersHolder
-		{
-			private Sect571k1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect571k1Holder();
-
-			private const int m = 571;
-			private const int k1 = 2;
-			private const int k2 = 5;
-			private const int k3 = 10;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.Zero;
-				BigInteger b = BigInteger.ValueOf(1);
-				byte[] S = null;
-				BigInteger n = FromHex("020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001");
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("02"
-				//+ "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972"
-					+ "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-		/*
-		 * sect571r1
-		 */
-		internal class Sect571r1Holder
-			: X9ECParametersHolder
-		{
-			private Sect571r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Sect571r1Holder();
-
-			private const int m = 571;
-			private const int k1 = 2;
-			private const int k2 = 5;
-			private const int k3 = 10;
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger a = BigInteger.ValueOf(1);
-				BigInteger b = FromHex("02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A");
-				byte[] S = Hex.Decode("2AA058F73A0E33AB486B0F610410C53A7F132310");
-				BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47");
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
-				//ECPoint G = curve.DecodePoint(Hex.Decode("03"
-				//+ "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19"));
-				ECPoint G = curve.DecodePoint(Hex.Decode("04"
-					+ "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19"
-					+ "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B"));
-
-				return new X9ECParameters(curve, G, n, h, S);
-			}
-		}
-
-
-		private static readonly IDictionary objIds = Platform.CreateHashtable();
+    public sealed class SecNamedCurves
+    {
+        private SecNamedCurves()
+        {
+        }
+
+        private static BigInteger FromHex(
+            string hex)
+        {
+            return new BigInteger(1, Hex.Decode(hex));
+        }
+
+        /*
+         * secp112r1
+         */
+        internal class Secp112r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp112r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp112r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = (2^128 - 3) / 76439
+                BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B");
+                BigInteger a = FromHex("DB7C2ABF62E35E668076BEAD2088");
+                BigInteger b = FromHex("659EF8BA043916EEDE8911702B22");
+                byte[] S = Hex.Decode("00F50B028E4D696E676875615175290472783FB1");
+                BigInteger n = FromHex("DB7C2ABF62E35E7628DFAC6561C5");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "09487239995A5EE76B55F9C2F098"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "09487239995A5EE76B55F9C2F098"
+                    + "A89CE5AF8724C0A23E0E0FF77500"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp112r2
+         */
+        internal class Secp112r2Holder
+            : X9ECParametersHolder
+        {
+            private Secp112r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp112r2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = (2^128 - 3) / 76439
+                BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B");
+                BigInteger a = FromHex("6127C24C05F38A0AAAF65C0EF02C");
+                BigInteger b = FromHex("51DEF1815DB5ED74FCC34C85D709");
+                byte[] S = Hex.Decode("002757A1114D696E6768756151755316C05E0BD4");
+                BigInteger n = FromHex("36DF0AAFD8B8D7597CA10520D04B");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "4BA30AB5E892B4E1649DD0928643"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "4BA30AB5E892B4E1649DD0928643"
+                    + "ADCD46F5882E3747DEF36E956E97"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp128r1
+         */
+        internal class Secp128r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp128r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp128r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^128 - 2^97 - 1
+                BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
+                BigInteger a = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
+                BigInteger b = FromHex("E87579C11079F43DD824993C2CEE5ED3");
+                byte[] S = Hex.Decode("000E0D4D696E6768756151750CC03A4473D03679");
+                BigInteger n = FromHex("FFFFFFFE0000000075A30D1B9038A115");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "161FF7528B899B2D0C28607CA52C5B86"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "161FF7528B899B2D0C28607CA52C5B86"
+                    + "CF5AC8395BAFEB13C02DA292DDED7A83"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp128r2
+         */
+        internal class Secp128r2Holder
+            : X9ECParametersHolder
+        {
+            private Secp128r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp128r2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^128 - 2^97 - 1
+                BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
+                BigInteger a = FromHex("D6031998D1B3BBFEBF59CC9BBFF9AEE1");
+                BigInteger b = FromHex("5EEEFCA380D02919DC2C6558BB6D8A5D");
+                byte[] S = Hex.Decode("004D696E67687561517512D8F03431FCE63B88F4");
+                BigInteger n = FromHex("3FFFFFFF7FFFFFFFBE0024720613B5A3");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "7B6AA5D85E572983E6FB32A7CDEBC140"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "7B6AA5D85E572983E6FB32A7CDEBC140"
+                    + "27B6916A894D3AEE7106FE805FC34B44"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp160k1
+         */
+        internal class Secp160k1Holder
+            : X9ECParametersHolder
+        {
+            private Secp160k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp160k1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(7);
+                byte[] S = null;
+                BigInteger n = FromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                    //+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
+                    + "938CF935318FDCED6BC28286531733C3F03C4FEE"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp160r1
+         */
+        internal class Secp160r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp160r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp160r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^160 - 2^31 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
+                BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
+                BigInteger b = FromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
+                byte[] S = Hex.Decode("1053CDE42C14D696E67687561517533BF3F83345");
+                BigInteger n = FromHex("0100000000000000000001F4C8F927AED3CA752257");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                    //+ "4A96B5688EF573284664698968C38BB913CBFC82"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "4A96B5688EF573284664698968C38BB913CBFC82"
+                    + "23A628553168947D59DCC912042351377AC5FB32"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp160r2
+         */
+        internal class Secp160r2Holder
+            : X9ECParametersHolder
+        {
+            private Secp160r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp160r2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
+                BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70");
+                BigInteger b = FromHex("B4E134D3FB59EB8BAB57274904664D5AF50388BA");
+                byte[] S = Hex.Decode("B99B99B099B323E02709A4D696E6768756151751");
+                BigInteger n = FromHex("0100000000000000000000351EE786A818F3A1A16B");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "52DCB034293A117E1F4FF11B30F7199D3144CE6D"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "52DCB034293A117E1F4FF11B30F7199D3144CE6D"
+                    + "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp192k1
+         */
+        internal class Secp192k1Holder
+            : X9ECParametersHolder
+        {
+            private Secp192k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp192k1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(3);
+                byte[] S = null;
+                BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"
+                    + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp192r1
+         */
+        internal class Secp192r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp192r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp192r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^192 - 2^64 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
+                BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
+                BigInteger b = FromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
+                byte[] S = Hex.Decode("3045AE6FC8422F64ED579528D38120EAE12196D5");
+                BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"
+                    + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp224k1
+         */
+        internal class Secp224k1Holder
+            : X9ECParametersHolder
+        {
+            private Secp224k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp224k1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^224 - 2^32 - 2^12 - 2^11 - 2^9 - 2^7 - 2^4 - 2 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D");
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(5);
+                byte[] S = null;
+                BigInteger n = FromHex("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C"
+                    + "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp224r1
+         */
+        internal class Secp224r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp224r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp224r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^224 - 2^96 + 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
+                BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
+                BigInteger b = FromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
+                byte[] S = Hex.Decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5");
+                BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"
+                    + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp256k1
+         */
+        internal class Secp256k1Holder
+            : X9ECParametersHolder
+        {
+            private Secp256k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp256k1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F");
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(7);
+                byte[] S = null;
+                BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798"
+                    + "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp256r1
+         */
+        internal class Secp256r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp256r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp256r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1
+                BigInteger p = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
+                BigInteger a = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
+                BigInteger b = FromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
+                byte[] S = Hex.Decode("C49D360886E704936A6678E1139D26B7819F7E90");
+                BigInteger n = FromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"
+                    + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp384r1
+         */
+        internal class Secp384r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp384r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp384r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^384 - 2^128 - 2^96 + 2^32 - 1
+                BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF");
+                BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC");
+                BigInteger b = FromHex("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF");
+                byte[] S = Hex.Decode("A335926AA319A27A1D00896A6773A4827ACDAC73");
+                BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7"
+                    + "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * secp521r1
+         */
+        internal class Secp521r1Holder
+            : X9ECParametersHolder
+        {
+            private Secp521r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Secp521r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                // p = 2^521 - 1
+                BigInteger p = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
+                BigInteger a = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC");
+                BigInteger b = FromHex("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00");
+                byte[] S = Hex.Decode("D09E8800291CB85396CC6717393284AAA0DA64BA");
+                BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409");
+                BigInteger h = BigInteger.ValueOf(1);
+
+                ECCurve curve = new FpCurve(p, a, b);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66"
+                    + "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect113r1
+         */
+        internal class Sect113r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect113r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect113r1Holder();
+
+            private const int m = 113;
+            private const int k = 9;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("003088250CA6E7C7FE649CE85820F7");
+                BigInteger b = FromHex("00E8BEE4D3E2260744188BE0E9C723");
+                byte[] S = Hex.Decode("10E723AB14D696E6768756151756FEBF8FCB49A9");
+                BigInteger n = FromHex("0100000000000000D9CCEC8A39E56F");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "009D73616F35F4AB1407D73562C10F"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "009D73616F35F4AB1407D73562C10F"
+                    + "00A52830277958EE84D1315ED31886"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect113r2
+         */
+        internal class Sect113r2Holder
+            : X9ECParametersHolder
+        {
+            private Sect113r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect113r2Holder();
+
+            private const int m = 113;
+            private const int k = 9;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("00689918DBEC7E5A0DD6DFC0AA55C7");
+                BigInteger b = FromHex("0095E9A9EC9B297BD4BF36E059184F");
+                byte[] S = Hex.Decode("10C0FB15760860DEF1EEF4D696E676875615175D");
+                BigInteger n = FromHex("010000000000000108789B2496AF93");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "01A57A6A7B26CA5EF52FCDB8164797"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "01A57A6A7B26CA5EF52FCDB8164797"
+                    + "00B3ADC94ED1FE674C06E695BABA1D"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect131r1
+         */
+        internal class Sect131r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect131r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect131r1Holder();
+
+            private const int m = 131;
+            private const int k1 = 2;
+            private const int k2 = 3;
+            private const int k3 = 8;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("07A11B09A76B562144418FF3FF8C2570B8");
+                BigInteger b = FromHex("0217C05610884B63B9C6C7291678F9D341");
+                byte[] S = Hex.Decode("4D696E676875615175985BD3ADBADA21B43A97E2");
+                BigInteger n = FromHex("0400000000000000023123953A9464B54D");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "0081BAF91FDF9833C40F9C181343638399"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0081BAF91FDF9833C40F9C181343638399"
+                    + "078C6E7EA38C001F73C8134B1B4EF9E150"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect131r2
+         */
+        internal class Sect131r2Holder
+            : X9ECParametersHolder
+        {
+            private Sect131r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect131r2Holder();
+
+            private const int m = 131;
+            private const int k1 = 2;
+            private const int k2 = 3;
+            private const int k3 = 8;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("03E5A88919D7CAFCBF415F07C2176573B2");
+                BigInteger b = FromHex("04B8266A46C55657AC734CE38F018F2192");
+                byte[] S = Hex.Decode("985BD3ADBAD4D696E676875615175A21B43A97E3");
+                BigInteger n = FromHex("0400000000000000016954A233049BA98F");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "0356DCD8F2F95031AD652D23951BB366A8"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0356DCD8F2F95031AD652D23951BB366A8"
+                    + "0648F06D867940A5366D9E265DE9EB240F"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect163k1
+         */
+        internal class Sect163k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect163k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect163k1Holder();
+
+            private const int m = 163;
+            private const int k1 = 3;
+            private const int k2 = 6;
+            private const int k3 = 7;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("04000000000000000000020108A2E0CC0D99F8A5EF");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8"
+                    + "0289070FB05D38FF58321F2E800536D538CCDAA3D9"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect163r1
+         */
+        internal class Sect163r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect163r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect163r1Holder();
+
+            private const int m = 163;
+            private const int k1 = 3;
+            private const int k2 = 6;
+            private const int k3 = 7;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("07B6882CAAEFA84F9554FF8428BD88E246D2782AE2");
+                BigInteger b = FromHex("0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9");
+                byte[] S = Hex.Decode("24B7B137C8A14D696E6768756151756FD0DA2E5C");
+                BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "0369979697AB43897789566789567F787A7876A654"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0369979697AB43897789566789567F787A7876A654"
+                    + "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect163r2
+         */
+        internal class Sect163r2Holder
+            : X9ECParametersHolder
+        {
+            private Sect163r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect163r2Holder();
+
+            private const int m = 163;
+            private const int k1 = 3;
+            private const int k2 = 6;
+            private const int k3 = 7;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = FromHex("020A601907B8C953CA1481EB10512F78744A3205FD");
+                byte[] S = Hex.Decode("85E25BFE5C86226CDB12016F7553F9D0E693A268");
+                BigInteger n = FromHex("040000000000000000000292FE77E70C12A4234C33");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "03F0EBA16286A2D57EA0991168D4994637E8343E36"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "03F0EBA16286A2D57EA0991168D4994637E8343E36"
+                    + "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect193r1
+         */
+        internal class Sect193r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect193r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect193r1Holder();
+
+            private const int m = 193;
+            private const int k = 15;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01");
+                BigInteger b = FromHex("00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814");
+                byte[] S = Hex.Decode("103FAEC74D696E676875615175777FC5B191EF30");
+                BigInteger n = FromHex("01000000000000000000000000C7F34A778F443ACC920EBA49");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1"
+                    + "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect193r2
+         */
+        internal class Sect193r2Holder
+            : X9ECParametersHolder
+        {
+            private Sect193r2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect193r2Holder();
+
+            private const int m = 193;
+            private const int k = 15;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = FromHex("0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B");
+                BigInteger b = FromHex("00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE");
+                byte[] S = Hex.Decode("10B7B4D696E676875615175137C8A16FD0DA2211");
+                BigInteger n = FromHex("010000000000000000000000015AAB561B005413CCD4EE99D5");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F"
+                    + "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect233k1
+         */
+        internal class Sect233k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect233k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect233k1Holder();
+
+            private const int m = 233;
+            private const int k = 74;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126"
+                    + "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect233r1
+         */
+        internal class Sect233r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect233r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect233r1Holder();
+
+            private const int m = 233;
+            private const int k = 74;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = FromHex("0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD");
+                byte[] S = Hex.Decode("74D59FF07F6B413D0EA14B344B20A2DB049B50C3");
+                BigInteger n = FromHex("01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B"
+                    + "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect239k1
+         */
+        internal class Sect239k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect239k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect239k1Holder();
+
+            private const int m = 239;
+            private const int k = 158;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC"
+                    + "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect283k1
+         */
+        internal class Sect283k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect283k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect283k1Holder();
+
+            private const int m = 283;
+            private const int k1 = 5;
+            private const int k2 = 7;
+            private const int k3 = 12;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836"
+                    + "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect283r1
+         */
+        internal class Sect283r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect283r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect283r1Holder();
+
+            private const int m = 283;
+            private const int k1 = 5;
+            private const int k2 = 7;
+            private const int k3 = 12;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = FromHex("027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5");
+                byte[] S = Hex.Decode("77E2B07370EB0F832A6DD5B62DFC88CD06BB84BE");
+                BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053"
+                    + "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect409k1
+         */
+        internal class Sect409k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect409k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect409k1Holder();
+
+            private const int m = 409;
+            private const int k = 87;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746"
+                    + "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect409r1
+         */
+        internal class Sect409r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect409r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect409r1Holder();
+
+            private const int m = 409;
+            private const int k = 87;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = FromHex("0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F");
+                byte[] S = Hex.Decode("4099B5A457F9D69F79213D094C4BCD4D4262210B");
+                BigInteger n = FromHex("010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7"
+                    + "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect571k1
+         */
+        internal class Sect571k1Holder
+            : X9ECParametersHolder
+        {
+            private Sect571k1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect571k1Holder();
+
+            private const int m = 571;
+            private const int k1 = 2;
+            private const int k2 = 5;
+            private const int k3 = 10;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.Zero;
+                BigInteger b = BigInteger.ValueOf(1);
+                byte[] S = null;
+                BigInteger n = FromHex("020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001");
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("02"
+                //+ "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972"
+                    + "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+        /*
+         * sect571r1
+         */
+        internal class Sect571r1Holder
+            : X9ECParametersHolder
+        {
+            private Sect571r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Sect571r1Holder();
+
+            private const int m = 571;
+            private const int k1 = 2;
+            private const int k2 = 5;
+            private const int k3 = 10;
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger a = BigInteger.ValueOf(1);
+                BigInteger b = FromHex("02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A");
+                byte[] S = Hex.Decode("2AA058F73A0E33AB486B0F610410C53A7F132310");
+                BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47");
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h);
+                //ECPoint G = curve.DecodePoint(Hex.Decode("03"
+                //+ "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19"));
+                ECPoint G = curve.DecodePoint(Hex.Decode("04"
+                    + "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19"
+                    + "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B"));
+
+                return new X9ECParameters(curve, G, n, h, S);
+            }
+        }
+
+
+        private static readonly IDictionary objIds = Platform.CreateHashtable();
         private static readonly IDictionary curves = Platform.CreateHashtable();
         private static readonly IDictionary names = Platform.CreateHashtable();
 
-		private static void DefineCurve(
-			string					name,
-			DerObjectIdentifier		oid,
-			X9ECParametersHolder	holder)
-		{
-			objIds.Add(name, oid);
-			names.Add(oid, name);
-			curves.Add(oid, holder);
-		}
-
-		static SecNamedCurves()
-		{
-			DefineCurve("secp112r1", SecObjectIdentifiers.SecP112r1, Secp112r1Holder.Instance);
-			DefineCurve("secp112r2", SecObjectIdentifiers.SecP112r2, Secp112r2Holder.Instance);
-			DefineCurve("secp128r1", SecObjectIdentifiers.SecP128r1, Secp128r1Holder.Instance);
-			DefineCurve("secp128r2", SecObjectIdentifiers.SecP128r2, Secp128r2Holder.Instance);
-			DefineCurve("secp160k1", SecObjectIdentifiers.SecP160k1, Secp160k1Holder.Instance);
-			DefineCurve("secp160r1", SecObjectIdentifiers.SecP160r1, Secp160r1Holder.Instance);
-			DefineCurve("secp160r2", SecObjectIdentifiers.SecP160r2, Secp160r2Holder.Instance);
-			DefineCurve("secp192k1", SecObjectIdentifiers.SecP192k1, Secp192k1Holder.Instance);
-			DefineCurve("secp192r1", SecObjectIdentifiers.SecP192r1, Secp192r1Holder.Instance);
-			DefineCurve("secp224k1", SecObjectIdentifiers.SecP224k1, Secp224k1Holder.Instance);
-			DefineCurve("secp224r1", SecObjectIdentifiers.SecP224r1, Secp224r1Holder.Instance);
-			DefineCurve("secp256k1", SecObjectIdentifiers.SecP256k1, Secp256k1Holder.Instance);
-			DefineCurve("secp256r1", SecObjectIdentifiers.SecP256r1, Secp256r1Holder.Instance);
-			DefineCurve("secp384r1", SecObjectIdentifiers.SecP384r1, Secp384r1Holder.Instance);
-			DefineCurve("secp521r1", SecObjectIdentifiers.SecP521r1, Secp521r1Holder.Instance);
-
-			DefineCurve("sect113r1", SecObjectIdentifiers.SecT113r1, Sect113r1Holder.Instance);
-			DefineCurve("sect113r2", SecObjectIdentifiers.SecT113r2, Sect113r2Holder.Instance);
-			DefineCurve("sect131r1", SecObjectIdentifiers.SecT131r1, Sect131r1Holder.Instance);
-			DefineCurve("sect131r2", SecObjectIdentifiers.SecT131r2, Sect131r2Holder.Instance);
-			DefineCurve("sect163k1", SecObjectIdentifiers.SecT163k1, Sect163k1Holder.Instance);
-			DefineCurve("sect163r1", SecObjectIdentifiers.SecT163r1, Sect163r1Holder.Instance);
-			DefineCurve("sect163r2", SecObjectIdentifiers.SecT163r2, Sect163r2Holder.Instance);
-			DefineCurve("sect193r1", SecObjectIdentifiers.SecT193r1, Sect193r1Holder.Instance);
-			DefineCurve("sect193r2", SecObjectIdentifiers.SecT193r2, Sect193r2Holder.Instance);
-			DefineCurve("sect233k1", SecObjectIdentifiers.SecT233k1, Sect233k1Holder.Instance);
-			DefineCurve("sect233r1", SecObjectIdentifiers.SecT233r1, Sect233r1Holder.Instance);
-			DefineCurve("sect239k1", SecObjectIdentifiers.SecT239k1, Sect239k1Holder.Instance);
-			DefineCurve("sect283k1", SecObjectIdentifiers.SecT283k1, Sect283k1Holder.Instance);
-			DefineCurve("sect283r1", SecObjectIdentifiers.SecT283r1, Sect283r1Holder.Instance);
-			DefineCurve("sect409k1", SecObjectIdentifiers.SecT409k1, Sect409k1Holder.Instance);
-			DefineCurve("sect409r1", SecObjectIdentifiers.SecT409r1, Sect409r1Holder.Instance);
-			DefineCurve("sect571k1", SecObjectIdentifiers.SecT571k1, Sect571k1Holder.Instance);
-			DefineCurve("sect571r1", SecObjectIdentifiers.SecT571r1, Sect571r1Holder.Instance);
-		}
-
-		public static X9ECParameters GetByName(
-			string name)
-		{
-			DerObjectIdentifier oid = (DerObjectIdentifier)
-				objIds[Platform.ToLowerInvariant(name)];
-
-			return oid == null ? null : GetByOid(oid);
-		}
-
-		/**
-		 * return the X9ECParameters object for the named curve represented by
-		 * the passed in object identifier. Null if the curve isn't present.
-		 *
-		 * @param oid an object identifier representing a named curve, if present.
-		 */
-		public static X9ECParameters GetByOid(
-			DerObjectIdentifier oid)
-		{
-			X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid];
-
-			return holder == null ? null : holder.Parameters;
-		}
-
-		/**
-		 * return the object identifier signified by the passed in name. Null
-		 * if there is no object identifier associated with name.
-		 *
-		 * @return the object identifier associated with name, if present.
-		 */
-		public static DerObjectIdentifier GetOid(
-			string name)
-		{
+        private static void DefineCurve(
+            string					name,
+            DerObjectIdentifier		oid,
+            X9ECParametersHolder	holder)
+        {
+            objIds.Add(name, oid);
+            names.Add(oid, name);
+            curves.Add(oid, holder);
+        }
+
+        static SecNamedCurves()
+        {
+            DefineCurve("secp112r1", SecObjectIdentifiers.SecP112r1, Secp112r1Holder.Instance);
+            DefineCurve("secp112r2", SecObjectIdentifiers.SecP112r2, Secp112r2Holder.Instance);
+            DefineCurve("secp128r1", SecObjectIdentifiers.SecP128r1, Secp128r1Holder.Instance);
+            DefineCurve("secp128r2", SecObjectIdentifiers.SecP128r2, Secp128r2Holder.Instance);
+            DefineCurve("secp160k1", SecObjectIdentifiers.SecP160k1, Secp160k1Holder.Instance);
+            DefineCurve("secp160r1", SecObjectIdentifiers.SecP160r1, Secp160r1Holder.Instance);
+            DefineCurve("secp160r2", SecObjectIdentifiers.SecP160r2, Secp160r2Holder.Instance);
+            DefineCurve("secp192k1", SecObjectIdentifiers.SecP192k1, Secp192k1Holder.Instance);
+            DefineCurve("secp192r1", SecObjectIdentifiers.SecP192r1, Secp192r1Holder.Instance);
+            DefineCurve("secp224k1", SecObjectIdentifiers.SecP224k1, Secp224k1Holder.Instance);
+            DefineCurve("secp224r1", SecObjectIdentifiers.SecP224r1, Secp224r1Holder.Instance);
+            DefineCurve("secp256k1", SecObjectIdentifiers.SecP256k1, Secp256k1Holder.Instance);
+            DefineCurve("secp256r1", SecObjectIdentifiers.SecP256r1, Secp256r1Holder.Instance);
+            DefineCurve("secp384r1", SecObjectIdentifiers.SecP384r1, Secp384r1Holder.Instance);
+            DefineCurve("secp521r1", SecObjectIdentifiers.SecP521r1, Secp521r1Holder.Instance);
+
+            DefineCurve("sect113r1", SecObjectIdentifiers.SecT113r1, Sect113r1Holder.Instance);
+            DefineCurve("sect113r2", SecObjectIdentifiers.SecT113r2, Sect113r2Holder.Instance);
+            DefineCurve("sect131r1", SecObjectIdentifiers.SecT131r1, Sect131r1Holder.Instance);
+            DefineCurve("sect131r2", SecObjectIdentifiers.SecT131r2, Sect131r2Holder.Instance);
+            DefineCurve("sect163k1", SecObjectIdentifiers.SecT163k1, Sect163k1Holder.Instance);
+            DefineCurve("sect163r1", SecObjectIdentifiers.SecT163r1, Sect163r1Holder.Instance);
+            DefineCurve("sect163r2", SecObjectIdentifiers.SecT163r2, Sect163r2Holder.Instance);
+            DefineCurve("sect193r1", SecObjectIdentifiers.SecT193r1, Sect193r1Holder.Instance);
+            DefineCurve("sect193r2", SecObjectIdentifiers.SecT193r2, Sect193r2Holder.Instance);
+            DefineCurve("sect233k1", SecObjectIdentifiers.SecT233k1, Sect233k1Holder.Instance);
+            DefineCurve("sect233r1", SecObjectIdentifiers.SecT233r1, Sect233r1Holder.Instance);
+            DefineCurve("sect239k1", SecObjectIdentifiers.SecT239k1, Sect239k1Holder.Instance);
+            DefineCurve("sect283k1", SecObjectIdentifiers.SecT283k1, Sect283k1Holder.Instance);
+            DefineCurve("sect283r1", SecObjectIdentifiers.SecT283r1, Sect283r1Holder.Instance);
+            DefineCurve("sect409k1", SecObjectIdentifiers.SecT409k1, Sect409k1Holder.Instance);
+            DefineCurve("sect409r1", SecObjectIdentifiers.SecT409r1, Sect409r1Holder.Instance);
+            DefineCurve("sect571k1", SecObjectIdentifiers.SecT571k1, Sect571k1Holder.Instance);
+            DefineCurve("sect571r1", SecObjectIdentifiers.SecT571r1, Sect571r1Holder.Instance);
+        }
+
+        public static X9ECParameters GetByName(
+            string name)
+        {
+            DerObjectIdentifier oid = (DerObjectIdentifier)
+                objIds[Platform.ToLowerInvariant(name)];
+
+            return oid == null ? null : GetByOid(oid);
+        }
+
+        /**
+         * return the X9ECParameters object for the named curve represented by
+         * the passed in object identifier. Null if the curve isn't present.
+         *
+         * @param oid an object identifier representing a named curve, if present.
+         */
+        public static X9ECParameters GetByOid(
+            DerObjectIdentifier oid)
+        {
+            X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid];
+
+            return holder == null ? null : holder.Parameters;
+        }
+
+        /**
+         * return the object identifier signified by the passed in name. Null
+         * if there is no object identifier associated with name.
+         *
+         * @return the object identifier associated with name, if present.
+         */
+        public static DerObjectIdentifier GetOid(
+            string name)
+        {
             return (DerObjectIdentifier)objIds[Platform.ToLowerInvariant(name)];
-		}
-
-		/**
-		 * return the named curve name represented by the given object identifier.
-		 */
-		public static string GetName(
-			DerObjectIdentifier oid)
-		{
-			return (string) names[oid];
-		}
-
-		/**
-		 * returns an enumeration containing the name strings for curves
-		 * contained in this structure.
-		 */
-		public static IEnumerable Names
-		{
-			get { return new EnumerableProxy(objIds.Keys); }
-		}
-	}
+        }
+
+        /**
+         * return the named curve name represented by the given object identifier.
+         */
+        public static string GetName(
+            DerObjectIdentifier oid)
+        {
+            return (string) names[oid];
+        }
+
+        /**
+         * returns an enumeration containing the name strings for curves
+         * contained in this structure.
+         */
+        public static IEnumerable Names
+        {
+            get { return new EnumerableProxy(objIds.Keys); }
+        }
+    }
 }
diff --git a/crypto/src/asn1/x9/ECNamedCurveTable.cs b/crypto/src/asn1/x9/ECNamedCurveTable.cs
new file mode 100644
index 000000000..0030d376b
--- /dev/null
+++ b/crypto/src/asn1/x9/ECNamedCurveTable.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections;
+
+using Org.BouncyCastle.Asn1.Nist;
+using Org.BouncyCastle.Asn1.Sec;
+using Org.BouncyCastle.Asn1.TeleTrust;
+using Org.BouncyCastle.Utilities;
+using Org.BouncyCastle.Utilities.Collections;
+
+namespace Org.BouncyCastle.Asn1.X9
+{
+    /**
+     * A general class that reads all X9.62 style EC curve tables.
+     */
+    public class ECNamedCurveTable
+    {
+        /**
+         * return a X9ECParameters object representing the passed in named
+         * curve. The routine returns null if the curve is not present.
+         *
+         * @param name the name of the curve requested
+         * @return an X9ECParameters object or null if the curve is not available.
+         */
+        public static X9ECParameters GetByName(string name)
+        {
+            X9ECParameters ecP = X962NamedCurves.GetByName(name);
+
+            if (ecP == null)
+            {
+                ecP = SecNamedCurves.GetByName(name);
+            }
+
+            if (ecP == null)
+            {
+                ecP = TeleTrusTNamedCurves.GetByName(name);
+            }
+
+            if (ecP == null)
+            {
+                ecP = NistNamedCurves.GetByName(name);
+            }
+
+            return ecP;
+        }
+
+        /**
+         * return the object identifier signified by the passed in name. Null
+         * if there is no object identifier associated with name.
+         *
+         * @return the object identifier associated with name, if present.
+         */
+        public static DerObjectIdentifier GetOid(string name)
+        {
+            DerObjectIdentifier oid = X962NamedCurves.GetOid(name);
+
+            if (oid == null)
+            {
+                oid = SecNamedCurves.GetOid(name);
+            }
+
+            if (oid == null)
+            {
+                oid = TeleTrusTNamedCurves.GetOid(name);
+            }
+
+            if (oid == null)
+            {
+                oid = NistNamedCurves.GetOid(name);
+            }
+
+            return oid;
+        }
+
+        /**
+         * return a X9ECParameters object representing the passed in named
+         * curve.
+         *
+         * @param oid the object id of the curve requested
+         * @return an X9ECParameters object or null if the curve is not available.
+         */
+        public static X9ECParameters GetByOid(DerObjectIdentifier oid)
+        {
+            X9ECParameters ecP = X962NamedCurves.GetByOid(oid);
+
+            if (ecP == null)
+            {
+                ecP = SecNamedCurves.GetByOid(oid);
+            }
+
+            if (ecP == null)
+            {
+                ecP = TeleTrusTNamedCurves.GetByOid(oid);
+            }
+
+            // NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup
+
+            return ecP;
+        }
+
+        /**
+         * return an enumeration of the names of the available curves.
+         *
+         * @return an enumeration of the names of the available curves.
+         */
+        public static IEnumerable Names
+        {
+            get
+            {
+                IList v = Platform.CreateArrayList();
+                CollectionUtilities.AddRange(v, X962NamedCurves.Names);
+                CollectionUtilities.AddRange(v, SecNamedCurves.Names);
+                CollectionUtilities.AddRange(v, NistNamedCurves.Names);
+                CollectionUtilities.AddRange(v, TeleTrusTNamedCurves.Names);
+                return v;
+            }
+        }
+    }
+}
diff --git a/crypto/src/asn1/x9/X962NamedCurves.cs b/crypto/src/asn1/x9/X962NamedCurves.cs
index 221300277..489483cb8 100644
--- a/crypto/src/asn1/x9/X962NamedCurves.cs
+++ b/crypto/src/asn1/x9/X962NamedCurves.cs
@@ -9,724 +9,724 @@ using Org.BouncyCastle.Utilities.Encoders;
 
 namespace Org.BouncyCastle.Asn1.X9
 {
-	/**
-	 * table of the current named curves defined in X.962 EC-DSA.
-	 */
-	public sealed class X962NamedCurves
-	{
-		private X962NamedCurves()
-		{
-		}
-
-		internal class Prime192v1Holder
-			: X9ECParametersHolder
-		{
-			private Prime192v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime192v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp192v1 = new FpCurve(
-					new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
-					new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
-					new BigInteger("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", 16));
-
-				return new X9ECParameters(
-					cFp192v1,
-					cFp192v1.DecodePoint(
-						Hex.Decode("03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012")),
-					new BigInteger("ffffffffffffffffffffffff99def836146bc9b1b4d22831", 16),
-					BigInteger.One,
-					Hex.Decode("3045AE6FC8422f64ED579528D38120EAE12196D5"));
-			}
-		}
-
-		internal class Prime192v2Holder
-			: X9ECParametersHolder
-		{
-			private Prime192v2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime192v2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp192v2 = new FpCurve(
-					new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
-					new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
-					new BigInteger("cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953", 16));
-
-				return new X9ECParameters(
-					cFp192v2,
-					cFp192v2.DecodePoint(
-						Hex.Decode("03eea2bae7e1497842f2de7769cfe9c989c072ad696f48034a")),
-					new BigInteger("fffffffffffffffffffffffe5fb1a724dc80418648d8dd31", 16),
-					BigInteger.One,
-					Hex.Decode("31a92ee2029fd10d901b113e990710f0d21ac6b6"));
-			}
-		}
-
-		internal class Prime192v3Holder
-			: X9ECParametersHolder
-		{
-			private Prime192v3Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime192v3Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp192v3 = new FpCurve(
-					new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
-					new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
-					new BigInteger("22123dc2395a05caa7423daeccc94760a7d462256bd56916", 16));
-
-				return new X9ECParameters(
-					cFp192v3,
-					cFp192v3.DecodePoint(
-						Hex.Decode("027d29778100c65a1da1783716588dce2b8b4aee8e228f1896")),
-					new BigInteger("ffffffffffffffffffffffff7a62d031c83f4294f640ec13", 16),
-					BigInteger.One,
-					Hex.Decode("c469684435deb378c4b65ca9591e2a5763059a2e"));
-			}
-		}
-
-		internal class Prime239v1Holder
-			: X9ECParametersHolder
-		{
-			private Prime239v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime239v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp239v1 = new FpCurve(
-					new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
-					new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
-					new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16));
-
-				return new X9ECParameters(
-					cFp239v1,
-					cFp239v1.DecodePoint(
-						Hex.Decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")),
-					new BigInteger("7fffffffffffffffffffffff7fffff9e5e9a9f5d9071fbd1522688909d0b", 16),
-					BigInteger.One,
-					Hex.Decode("e43bb460f0b80cc0c0b075798e948060f8321b7d"));
-			}
-		}
-
-		internal class Prime239v2Holder
-			: X9ECParametersHolder
-		{
-			private Prime239v2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime239v2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp239v2 = new FpCurve(
-					new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
-					new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
-					new BigInteger("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c", 16));
-
-				return new X9ECParameters(
-					cFp239v2,
-					cFp239v2.DecodePoint(
-						Hex.Decode("0238af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7")),
-					new BigInteger("7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063", 16),
-					BigInteger.One,
-					Hex.Decode("e8b4011604095303ca3b8099982be09fcb9ae616"));
-			}
-		}
-
-		internal class Prime239v3Holder
-			: X9ECParametersHolder
-		{
-			private Prime239v3Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime239v3Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp239v3 = new FpCurve(
-					new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
-					new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
-					new BigInteger("255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e", 16));
-
-				return new X9ECParameters(
-					cFp239v3,
-					cFp239v3.DecodePoint(
-						Hex.Decode("036768ae8e18bb92cfcf005c949aa2c6d94853d0e660bbf854b1c9505fe95a")),
-					new BigInteger("7fffffffffffffffffffffff7fffff975deb41b3a6057c3c432146526551", 16),
-					BigInteger.One,
-					Hex.Decode("7d7374168ffe3471b60a857686a19475d3bfa2ff"));
-			}
-		}
-
-		internal class Prime256v1Holder
-			: X9ECParametersHolder
-		{
-			private Prime256v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new Prime256v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				ECCurve cFp256v1 = new FpCurve(
-					new BigInteger("115792089210356248762697446949407573530086143415290314195533631308867097853951"),
-					new BigInteger("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", 16),
-					new BigInteger("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16));
-
-				return new X9ECParameters(
-					cFp256v1,
-					cFp256v1.DecodePoint(
-						Hex.Decode("036b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296")),
-					new BigInteger("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", 16),
-					BigInteger.One,
-					Hex.Decode("c49d360886e704936a6678e1139d26b7819f7e90"));
-			}
-		}
-
-		/*
-		 * F2m Curves
-		 */
-		internal class C2pnb163v1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb163v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb163v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0400000000000000000001E60FC8821CC74DAEAFC1", 16);
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve c2m163v1 = new F2mCurve(
-					163,
-					1, 2, 8,
-					new BigInteger("072546B5435234A422E0789675F432C89435DE5242", 16),
-					new BigInteger("00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m163v1,
-					c2m163v1.DecodePoint(
-						Hex.Decode("0307AF69989546103D79329FCC3D74880F33BBE803CB")),
-					n, h,
-					Hex.Decode("D2COFB15760860DEF1EEF4D696E6768756151754"));
-			}
-		}
-
-		internal class C2pnb163v2Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb163v2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb163v2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7", 16);
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve c2m163v2 = new F2mCurve(
-					163,
-					1, 2, 8,
-					new BigInteger("0108B39E77C4B108BED981ED0E890E117C511CF072", 16),
-					new BigInteger("0667ACEB38AF4E488C407433FFAE4F1C811638DF20", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m163v2,
-					c2m163v2.DecodePoint(
-						Hex.Decode("030024266E4EB5106D0A964D92C4860E2671DB9B6CC5")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb163v3Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb163v3Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb163v3Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", 16);
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve c2m163v3 = new F2mCurve(
-					163,
-					1, 2, 8,
-					new BigInteger("07A526C63D3E25A256A007699F5447E32AE456B50E", 16),
-					new BigInteger("03F7061798EB99E238FD6F1BF95B48FEEB4854252B", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m163v3,
-					c2m163v3.DecodePoint(Hex.Decode("0202F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb176w1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb176w1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb176w1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("010092537397ECA4F6145799D62B0A19CE06FE26AD", 16);
-				BigInteger h = BigInteger.ValueOf(0xFF6E);
-
-				ECCurve c2m176w1 = new F2mCurve(
-					176,
-					1, 2, 43,
-					new BigInteger("00E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B", 16),
-					new BigInteger("005DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m176w1,
-					c2m176w1.DecodePoint(
-						Hex.Decode("038D16C2866798B600F9F08BB4A8E860F3298CE04A5798")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb191v1Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb191v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb191v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("40000000000000000000000004A20E90C39067C893BBB9A5", 16);
-				BigInteger h = BigInteger.ValueOf(2);
-
-				ECCurve c2m191v1 = new F2mCurve(
-					191,
-					9,
-					new BigInteger("2866537B676752636A68F56554E12640276B649EF7526267", 16),
-					new BigInteger("2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m191v1,
-					c2m191v1.DecodePoint(
-						Hex.Decode("0236B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D")),
-					n, h,
-					Hex.Decode("4E13CA542744D696E67687561517552F279A8C84"));
-			}
-		}
-
-		internal class C2tnb191v2Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb191v2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb191v2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("20000000000000000000000050508CB89F652824E06B8173", 16);
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve c2m191v2 = new F2mCurve(
-					191,
-					9,
-					new BigInteger("401028774D7777C7B7666D1366EA432071274F89FF01E718", 16),
-					new BigInteger("0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m191v2,
-					c2m191v2.DecodePoint(
-						Hex.Decode("023809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb191v3Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb191v3Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb191v3Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("155555555555555555555555610C0B196812BFB6288A3EA3", 16);
-				BigInteger h = BigInteger.ValueOf(6);
-
-				ECCurve c2m191v3 = new F2mCurve(
-					191,
-					9,
-					new BigInteger("6C01074756099122221056911C77D77E77A777E7E7E77FCB", 16),
-					new BigInteger("71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m191v3,
-					c2m191v3.DecodePoint(
-						Hex.Decode("03375D4CE24FDE434489DE8746E71786015009E66E38A926DD")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb208w1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb208w1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb208w1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D", 16);
-				BigInteger h = BigInteger.ValueOf(0xFE48);
-
-				ECCurve c2m208w1 = new F2mCurve(
-					208,
-					1, 2, 83,
-					new BigInteger("0", 16),
-					new BigInteger("00C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m208w1,
-					c2m208w1.DecodePoint(
-						Hex.Decode("0289FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb239v1Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb239v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb239v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447", 16);
-				BigInteger h = BigInteger.ValueOf(4);
-
-				ECCurve c2m239v1 = new F2mCurve(
-					239,
-					36,
-					new BigInteger("32010857077C5431123A46B808906756F543423E8D27877578125778AC76", 16),
-					new BigInteger("790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m239v1,
-					c2m239v1.DecodePoint(
-						Hex.Decode("0257927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb239v2Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb239v2Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb239v2Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("1555555555555555555555555555553C6F2885259C31E3FCDF154624522D", 16);
-				BigInteger h = BigInteger.ValueOf(6);
-
-				ECCurve c2m239v2 = new F2mCurve(
-					239,
-					36,
-					new BigInteger("4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F", 16),
-					new BigInteger("5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m239v2,
-					c2m239v2.DecodePoint(
-						Hex.Decode("0228F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb239v3Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb239v3Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb239v3Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF", 16);
-				BigInteger h = BigInteger.ValueOf(10);
-
-				ECCurve c2m239v3 = new F2mCurve(
-					239,
-					36,
-					new BigInteger("01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F", 16),
-					new BigInteger("6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m239v3,
-					c2m239v3.DecodePoint(
-						Hex.Decode("0370F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb272w1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb272w1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb272w1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521", 16);
-				BigInteger h = BigInteger.ValueOf(0xFF06);
-
-				ECCurve c2m272w1 = new F2mCurve(
-					272,
-					1, 3, 56,
-					new BigInteger("0091A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20", 16),
-					new BigInteger("7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m272w1,
-					c2m272w1.DecodePoint(
-						Hex.Decode("026108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb304w1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb304w1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb304w1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D", 16);
-				BigInteger h = BigInteger.ValueOf(0xFE2E);
-
-				ECCurve c2m304w1 = new F2mCurve(
-					304,
-					1, 2, 11,
-					new BigInteger("00FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681", 16),
-					new BigInteger("00BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m304w1,
-					c2m304w1.DecodePoint(
-						Hex.Decode("02197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb359v1Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb359v1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb359v1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B", 16);
-				BigInteger h = BigInteger.ValueOf(0x4C);
-
-				ECCurve c2m359v1 = new F2mCurve(
-					359,
-					68,
-					new BigInteger("5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557", 16),
-					new BigInteger("2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m359v1,
-					c2m359v1.DecodePoint(
-						Hex.Decode("033C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2pnb368w1Holder
-			: X9ECParametersHolder
-		{
-			private C2pnb368w1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2pnb368w1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967", 16);
-				BigInteger h = BigInteger.ValueOf(0xFF70);
-
-				ECCurve c2m368w1 = new F2mCurve(
-					368,
-					1, 2, 85,
-					new BigInteger("00E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D", 16),
-					new BigInteger("00FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m368w1,
-					c2m368w1.DecodePoint(
-						Hex.Decode("021085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F")),
-					n, h,
-					null);
-			}
-		}
-
-		internal class C2tnb431r1Holder
-			: X9ECParametersHolder
-		{
-			private C2tnb431r1Holder() {}
-
-			internal static readonly X9ECParametersHolder Instance = new C2tnb431r1Holder();
-
-			protected override X9ECParameters CreateParameters()
-			{
-				BigInteger n = new BigInteger("0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91", 16);
-				BigInteger h = BigInteger.ValueOf(0x2760);
-
-				ECCurve c2m431r1 = new F2mCurve(
-					431,
-					120,
-					new BigInteger("1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F", 16),
-					new BigInteger("10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618", 16),
-					n, h);
-
-				return new X9ECParameters(
-					c2m431r1,
-					c2m431r1.DecodePoint(
-						Hex.Decode("02120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7")),
-					n, h,
-					null);
-			}
-		}
-
-		private static readonly IDictionary objIds = Platform.CreateHashtable();
+    /**
+     * table of the current named curves defined in X.962 EC-DSA.
+     */
+    public sealed class X962NamedCurves
+    {
+        private X962NamedCurves()
+        {
+        }
+
+        internal class Prime192v1Holder
+            : X9ECParametersHolder
+        {
+            private Prime192v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime192v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp192v1 = new FpCurve(
+                    new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
+                    new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
+                    new BigInteger("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", 16));
+
+                return new X9ECParameters(
+                    cFp192v1,
+                    cFp192v1.DecodePoint(
+                        Hex.Decode("03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012")),
+                    new BigInteger("ffffffffffffffffffffffff99def836146bc9b1b4d22831", 16),
+                    BigInteger.One,
+                    Hex.Decode("3045AE6FC8422f64ED579528D38120EAE12196D5"));
+            }
+        }
+
+        internal class Prime192v2Holder
+            : X9ECParametersHolder
+        {
+            private Prime192v2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime192v2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp192v2 = new FpCurve(
+                    new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
+                    new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
+                    new BigInteger("cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953", 16));
+
+                return new X9ECParameters(
+                    cFp192v2,
+                    cFp192v2.DecodePoint(
+                        Hex.Decode("03eea2bae7e1497842f2de7769cfe9c989c072ad696f48034a")),
+                    new BigInteger("fffffffffffffffffffffffe5fb1a724dc80418648d8dd31", 16),
+                    BigInteger.One,
+                    Hex.Decode("31a92ee2029fd10d901b113e990710f0d21ac6b6"));
+            }
+        }
+
+        internal class Prime192v3Holder
+            : X9ECParametersHolder
+        {
+            private Prime192v3Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime192v3Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp192v3 = new FpCurve(
+                    new BigInteger("6277101735386680763835789423207666416083908700390324961279"),
+                    new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16),
+                    new BigInteger("22123dc2395a05caa7423daeccc94760a7d462256bd56916", 16));
+
+                return new X9ECParameters(
+                    cFp192v3,
+                    cFp192v3.DecodePoint(
+                        Hex.Decode("027d29778100c65a1da1783716588dce2b8b4aee8e228f1896")),
+                    new BigInteger("ffffffffffffffffffffffff7a62d031c83f4294f640ec13", 16),
+                    BigInteger.One,
+                    Hex.Decode("c469684435deb378c4b65ca9591e2a5763059a2e"));
+            }
+        }
+
+        internal class Prime239v1Holder
+            : X9ECParametersHolder
+        {
+            private Prime239v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime239v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp239v1 = new FpCurve(
+                    new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
+                    new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
+                    new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16));
+
+                return new X9ECParameters(
+                    cFp239v1,
+                    cFp239v1.DecodePoint(
+                        Hex.Decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")),
+                    new BigInteger("7fffffffffffffffffffffff7fffff9e5e9a9f5d9071fbd1522688909d0b", 16),
+                    BigInteger.One,
+                    Hex.Decode("e43bb460f0b80cc0c0b075798e948060f8321b7d"));
+            }
+        }
+
+        internal class Prime239v2Holder
+            : X9ECParametersHolder
+        {
+            private Prime239v2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime239v2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp239v2 = new FpCurve(
+                    new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
+                    new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
+                    new BigInteger("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c", 16));
+
+                return new X9ECParameters(
+                    cFp239v2,
+                    cFp239v2.DecodePoint(
+                        Hex.Decode("0238af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7")),
+                    new BigInteger("7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063", 16),
+                    BigInteger.One,
+                    Hex.Decode("e8b4011604095303ca3b8099982be09fcb9ae616"));
+            }
+        }
+
+        internal class Prime239v3Holder
+            : X9ECParametersHolder
+        {
+            private Prime239v3Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime239v3Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp239v3 = new FpCurve(
+                    new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"),
+                    new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16),
+                    new BigInteger("255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e", 16));
+
+                return new X9ECParameters(
+                    cFp239v3,
+                    cFp239v3.DecodePoint(
+                        Hex.Decode("036768ae8e18bb92cfcf005c949aa2c6d94853d0e660bbf854b1c9505fe95a")),
+                    new BigInteger("7fffffffffffffffffffffff7fffff975deb41b3a6057c3c432146526551", 16),
+                    BigInteger.One,
+                    Hex.Decode("7d7374168ffe3471b60a857686a19475d3bfa2ff"));
+            }
+        }
+
+        internal class Prime256v1Holder
+            : X9ECParametersHolder
+        {
+            private Prime256v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new Prime256v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                ECCurve cFp256v1 = new FpCurve(
+                    new BigInteger("115792089210356248762697446949407573530086143415290314195533631308867097853951"),
+                    new BigInteger("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", 16),
+                    new BigInteger("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16));
+
+                return new X9ECParameters(
+                    cFp256v1,
+                    cFp256v1.DecodePoint(
+                        Hex.Decode("036b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296")),
+                    new BigInteger("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", 16),
+                    BigInteger.One,
+                    Hex.Decode("c49d360886e704936a6678e1139d26b7819f7e90"));
+            }
+        }
+
+        /*
+         * F2m Curves
+         */
+        internal class C2pnb163v1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb163v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb163v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0400000000000000000001E60FC8821CC74DAEAFC1", 16);
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve c2m163v1 = new F2mCurve(
+                    163,
+                    1, 2, 8,
+                    new BigInteger("072546B5435234A422E0789675F432C89435DE5242", 16),
+                    new BigInteger("00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m163v1,
+                    c2m163v1.DecodePoint(
+                        Hex.Decode("0307AF69989546103D79329FCC3D74880F33BBE803CB")),
+                    n, h,
+                    Hex.Decode("D2COFB15760860DEF1EEF4D696E6768756151754"));
+            }
+        }
+
+        internal class C2pnb163v2Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb163v2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb163v2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7", 16);
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve c2m163v2 = new F2mCurve(
+                    163,
+                    1, 2, 8,
+                    new BigInteger("0108B39E77C4B108BED981ED0E890E117C511CF072", 16),
+                    new BigInteger("0667ACEB38AF4E488C407433FFAE4F1C811638DF20", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m163v2,
+                    c2m163v2.DecodePoint(
+                        Hex.Decode("030024266E4EB5106D0A964D92C4860E2671DB9B6CC5")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb163v3Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb163v3Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb163v3Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", 16);
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve c2m163v3 = new F2mCurve(
+                    163,
+                    1, 2, 8,
+                    new BigInteger("07A526C63D3E25A256A007699F5447E32AE456B50E", 16),
+                    new BigInteger("03F7061798EB99E238FD6F1BF95B48FEEB4854252B", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m163v3,
+                    c2m163v3.DecodePoint(Hex.Decode("0202F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb176w1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb176w1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb176w1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("010092537397ECA4F6145799D62B0A19CE06FE26AD", 16);
+                BigInteger h = BigInteger.ValueOf(0xFF6E);
+
+                ECCurve c2m176w1 = new F2mCurve(
+                    176,
+                    1, 2, 43,
+                    new BigInteger("00E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B", 16),
+                    new BigInteger("005DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m176w1,
+                    c2m176w1.DecodePoint(
+                        Hex.Decode("038D16C2866798B600F9F08BB4A8E860F3298CE04A5798")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb191v1Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb191v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb191v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("40000000000000000000000004A20E90C39067C893BBB9A5", 16);
+                BigInteger h = BigInteger.ValueOf(2);
+
+                ECCurve c2m191v1 = new F2mCurve(
+                    191,
+                    9,
+                    new BigInteger("2866537B676752636A68F56554E12640276B649EF7526267", 16),
+                    new BigInteger("2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m191v1,
+                    c2m191v1.DecodePoint(
+                        Hex.Decode("0236B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D")),
+                    n, h,
+                    Hex.Decode("4E13CA542744D696E67687561517552F279A8C84"));
+            }
+        }
+
+        internal class C2tnb191v2Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb191v2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb191v2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("20000000000000000000000050508CB89F652824E06B8173", 16);
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve c2m191v2 = new F2mCurve(
+                    191,
+                    9,
+                    new BigInteger("401028774D7777C7B7666D1366EA432071274F89FF01E718", 16),
+                    new BigInteger("0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m191v2,
+                    c2m191v2.DecodePoint(
+                        Hex.Decode("023809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb191v3Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb191v3Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb191v3Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("155555555555555555555555610C0B196812BFB6288A3EA3", 16);
+                BigInteger h = BigInteger.ValueOf(6);
+
+                ECCurve c2m191v3 = new F2mCurve(
+                    191,
+                    9,
+                    new BigInteger("6C01074756099122221056911C77D77E77A777E7E7E77FCB", 16),
+                    new BigInteger("71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m191v3,
+                    c2m191v3.DecodePoint(
+                        Hex.Decode("03375D4CE24FDE434489DE8746E71786015009E66E38A926DD")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb208w1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb208w1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb208w1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D", 16);
+                BigInteger h = BigInteger.ValueOf(0xFE48);
+
+                ECCurve c2m208w1 = new F2mCurve(
+                    208,
+                    1, 2, 83,
+                    new BigInteger("0", 16),
+                    new BigInteger("00C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m208w1,
+                    c2m208w1.DecodePoint(
+                        Hex.Decode("0289FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb239v1Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb239v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb239v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447", 16);
+                BigInteger h = BigInteger.ValueOf(4);
+
+                ECCurve c2m239v1 = new F2mCurve(
+                    239,
+                    36,
+                    new BigInteger("32010857077C5431123A46B808906756F543423E8D27877578125778AC76", 16),
+                    new BigInteger("790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m239v1,
+                    c2m239v1.DecodePoint(
+                        Hex.Decode("0257927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb239v2Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb239v2Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb239v2Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("1555555555555555555555555555553C6F2885259C31E3FCDF154624522D", 16);
+                BigInteger h = BigInteger.ValueOf(6);
+
+                ECCurve c2m239v2 = new F2mCurve(
+                    239,
+                    36,
+                    new BigInteger("4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F", 16),
+                    new BigInteger("5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m239v2,
+                    c2m239v2.DecodePoint(
+                        Hex.Decode("0228F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb239v3Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb239v3Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb239v3Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF", 16);
+                BigInteger h = BigInteger.ValueOf(10);
+
+                ECCurve c2m239v3 = new F2mCurve(
+                    239,
+                    36,
+                    new BigInteger("01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F", 16),
+                    new BigInteger("6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m239v3,
+                    c2m239v3.DecodePoint(
+                        Hex.Decode("0370F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb272w1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb272w1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb272w1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521", 16);
+                BigInteger h = BigInteger.ValueOf(0xFF06);
+
+                ECCurve c2m272w1 = new F2mCurve(
+                    272,
+                    1, 3, 56,
+                    new BigInteger("0091A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20", 16),
+                    new BigInteger("7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m272w1,
+                    c2m272w1.DecodePoint(
+                        Hex.Decode("026108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb304w1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb304w1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb304w1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D", 16);
+                BigInteger h = BigInteger.ValueOf(0xFE2E);
+
+                ECCurve c2m304w1 = new F2mCurve(
+                    304,
+                    1, 2, 11,
+                    new BigInteger("00FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681", 16),
+                    new BigInteger("00BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m304w1,
+                    c2m304w1.DecodePoint(
+                        Hex.Decode("02197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb359v1Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb359v1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb359v1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B", 16);
+                BigInteger h = BigInteger.ValueOf(0x4C);
+
+                ECCurve c2m359v1 = new F2mCurve(
+                    359,
+                    68,
+                    new BigInteger("5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557", 16),
+                    new BigInteger("2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m359v1,
+                    c2m359v1.DecodePoint(
+                        Hex.Decode("033C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2pnb368w1Holder
+            : X9ECParametersHolder
+        {
+            private C2pnb368w1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2pnb368w1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967", 16);
+                BigInteger h = BigInteger.ValueOf(0xFF70);
+
+                ECCurve c2m368w1 = new F2mCurve(
+                    368,
+                    1, 2, 85,
+                    new BigInteger("00E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D", 16),
+                    new BigInteger("00FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m368w1,
+                    c2m368w1.DecodePoint(
+                        Hex.Decode("021085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F")),
+                    n, h,
+                    null);
+            }
+        }
+
+        internal class C2tnb431r1Holder
+            : X9ECParametersHolder
+        {
+            private C2tnb431r1Holder() {}
+
+            internal static readonly X9ECParametersHolder Instance = new C2tnb431r1Holder();
+
+            protected override X9ECParameters CreateParameters()
+            {
+                BigInteger n = new BigInteger("0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91", 16);
+                BigInteger h = BigInteger.ValueOf(0x2760);
+
+                ECCurve c2m431r1 = new F2mCurve(
+                    431,
+                    120,
+                    new BigInteger("1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F", 16),
+                    new BigInteger("10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618", 16),
+                    n, h);
+
+                return new X9ECParameters(
+                    c2m431r1,
+                    c2m431r1.DecodePoint(
+                        Hex.Decode("02120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7")),
+                    n, h,
+                    null);
+            }
+        }
+
+        private static readonly IDictionary objIds = Platform.CreateHashtable();
         private static readonly IDictionary curves = Platform.CreateHashtable();
         private static readonly IDictionary names = Platform.CreateHashtable();
 
-		private static void DefineCurve(
-			string					name,
-			DerObjectIdentifier		oid,
-			X9ECParametersHolder	holder)
-		{
-			objIds.Add(name, oid);
-			names.Add(oid, name);
-			curves.Add(oid, holder);
-		}
-
-		static X962NamedCurves()
-		{
-			DefineCurve("prime192v1", X9ObjectIdentifiers.Prime192v1, Prime192v1Holder.Instance);
-			DefineCurve("prime192v2", X9ObjectIdentifiers.Prime192v2, Prime192v2Holder.Instance);
-			DefineCurve("prime192v3", X9ObjectIdentifiers.Prime192v3, Prime192v3Holder.Instance);
-			DefineCurve("prime239v1", X9ObjectIdentifiers.Prime239v1, Prime239v1Holder.Instance);
-			DefineCurve("prime239v2", X9ObjectIdentifiers.Prime239v2, Prime239v2Holder.Instance);
-			DefineCurve("prime239v3", X9ObjectIdentifiers.Prime239v3, Prime239v3Holder.Instance);
-			DefineCurve("prime256v1", X9ObjectIdentifiers.Prime256v1, Prime256v1Holder.Instance);
-			DefineCurve("c2pnb163v1", X9ObjectIdentifiers.C2Pnb163v1, C2pnb163v1Holder.Instance);
-			DefineCurve("c2pnb163v2", X9ObjectIdentifiers.C2Pnb163v2, C2pnb163v2Holder.Instance);
-			DefineCurve("c2pnb163v3", X9ObjectIdentifiers.C2Pnb163v3, C2pnb163v3Holder.Instance);
-			DefineCurve("c2pnb176w1", X9ObjectIdentifiers.C2Pnb176w1, C2pnb176w1Holder.Instance);
-			DefineCurve("c2tnb191v1", X9ObjectIdentifiers.C2Tnb191v1, C2tnb191v1Holder.Instance);
-			DefineCurve("c2tnb191v2", X9ObjectIdentifiers.C2Tnb191v2, C2tnb191v2Holder.Instance);
-			DefineCurve("c2tnb191v3", X9ObjectIdentifiers.C2Tnb191v3, C2tnb191v3Holder.Instance);
-			DefineCurve("c2pnb208w1", X9ObjectIdentifiers.C2Pnb208w1, C2pnb208w1Holder.Instance);
-			DefineCurve("c2tnb239v1", X9ObjectIdentifiers.C2Tnb239v1, C2tnb239v1Holder.Instance);
-			DefineCurve("c2tnb239v2", X9ObjectIdentifiers.C2Tnb239v2, C2tnb239v2Holder.Instance);
-			DefineCurve("c2tnb239v3", X9ObjectIdentifiers.C2Tnb239v3, C2tnb239v3Holder.Instance);
-			DefineCurve("c2pnb272w1", X9ObjectIdentifiers.C2Pnb272w1, C2pnb272w1Holder.Instance);
-			DefineCurve("c2pnb304w1", X9ObjectIdentifiers.C2Pnb304w1, C2pnb304w1Holder.Instance);
-			DefineCurve("c2tnb359v1", X9ObjectIdentifiers.C2Tnb359v1, C2tnb359v1Holder.Instance);
-			DefineCurve("c2pnb368w1", X9ObjectIdentifiers.C2Pnb368w1, C2pnb368w1Holder.Instance);
-			DefineCurve("c2tnb431r1", X9ObjectIdentifiers.C2Tnb431r1, C2tnb431r1Holder.Instance);
-		}
-
-		public static X9ECParameters GetByName(
-			string name)
-		{
+        private static void DefineCurve(
+            string					name,
+            DerObjectIdentifier		oid,
+            X9ECParametersHolder	holder)
+        {
+            objIds.Add(name, oid);
+            names.Add(oid, name);
+            curves.Add(oid, holder);
+        }
+
+        static X962NamedCurves()
+        {
+            DefineCurve("prime192v1", X9ObjectIdentifiers.Prime192v1, Prime192v1Holder.Instance);
+            DefineCurve("prime192v2", X9ObjectIdentifiers.Prime192v2, Prime192v2Holder.Instance);
+            DefineCurve("prime192v3", X9ObjectIdentifiers.Prime192v3, Prime192v3Holder.Instance);
+            DefineCurve("prime239v1", X9ObjectIdentifiers.Prime239v1, Prime239v1Holder.Instance);
+            DefineCurve("prime239v2", X9ObjectIdentifiers.Prime239v2, Prime239v2Holder.Instance);
+            DefineCurve("prime239v3", X9ObjectIdentifiers.Prime239v3, Prime239v3Holder.Instance);
+            DefineCurve("prime256v1", X9ObjectIdentifiers.Prime256v1, Prime256v1Holder.Instance);
+            DefineCurve("c2pnb163v1", X9ObjectIdentifiers.C2Pnb163v1, C2pnb163v1Holder.Instance);
+            DefineCurve("c2pnb163v2", X9ObjectIdentifiers.C2Pnb163v2, C2pnb163v2Holder.Instance);
+            DefineCurve("c2pnb163v3", X9ObjectIdentifiers.C2Pnb163v3, C2pnb163v3Holder.Instance);
+            DefineCurve("c2pnb176w1", X9ObjectIdentifiers.C2Pnb176w1, C2pnb176w1Holder.Instance);
+            DefineCurve("c2tnb191v1", X9ObjectIdentifiers.C2Tnb191v1, C2tnb191v1Holder.Instance);
+            DefineCurve("c2tnb191v2", X9ObjectIdentifiers.C2Tnb191v2, C2tnb191v2Holder.Instance);
+            DefineCurve("c2tnb191v3", X9ObjectIdentifiers.C2Tnb191v3, C2tnb191v3Holder.Instance);
+            DefineCurve("c2pnb208w1", X9ObjectIdentifiers.C2Pnb208w1, C2pnb208w1Holder.Instance);
+            DefineCurve("c2tnb239v1", X9ObjectIdentifiers.C2Tnb239v1, C2tnb239v1Holder.Instance);
+            DefineCurve("c2tnb239v2", X9ObjectIdentifiers.C2Tnb239v2, C2tnb239v2Holder.Instance);
+            DefineCurve("c2tnb239v3", X9ObjectIdentifiers.C2Tnb239v3, C2tnb239v3Holder.Instance);
+            DefineCurve("c2pnb272w1", X9ObjectIdentifiers.C2Pnb272w1, C2pnb272w1Holder.Instance);
+            DefineCurve("c2pnb304w1", X9ObjectIdentifiers.C2Pnb304w1, C2pnb304w1Holder.Instance);
+            DefineCurve("c2tnb359v1", X9ObjectIdentifiers.C2Tnb359v1, C2tnb359v1Holder.Instance);
+            DefineCurve("c2pnb368w1", X9ObjectIdentifiers.C2Pnb368w1, C2pnb368w1Holder.Instance);
+            DefineCurve("c2tnb431r1", X9ObjectIdentifiers.C2Tnb431r1, C2tnb431r1Holder.Instance);
+        }
+
+        public static X9ECParameters GetByName(
+            string name)
+        {
             DerObjectIdentifier oid = (DerObjectIdentifier)objIds[Platform.ToLowerInvariant(name)];
 
-			return oid == null ? null : GetByOid(oid);
-		}
-
-		/**
-		 * return the X9ECParameters object for the named curve represented by
-		 * the passed in object identifier. Null if the curve isn't present.
-		 *
-		 * @param oid an object identifier representing a named curve, if present.
-		 */
-		public static X9ECParameters GetByOid(
-			DerObjectIdentifier oid)
-		{
-			X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid];
-
-			return holder == null ? null : holder.Parameters;
-		}
-
-		/**
-		 * return the object identifier signified by the passed in name. Null
-		 * if there is no object identifier associated with name.
-		 *
-		 * @return the object identifier associated with name, if present.
-		 */
-		public static DerObjectIdentifier GetOid(
-			string name)
-		{
+            return oid == null ? null : GetByOid(oid);
+        }
+
+        /**
+         * return the X9ECParameters object for the named curve represented by
+         * the passed in object identifier. Null if the curve isn't present.
+         *
+         * @param oid an object identifier representing a named curve, if present.
+         */
+        public static X9ECParameters GetByOid(
+            DerObjectIdentifier oid)
+        {
+            X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid];
+
+            return holder == null ? null : holder.Parameters;
+        }
+
+        /**
+         * return the object identifier signified by the passed in name. Null
+         * if there is no object identifier associated with name.
+         *
+         * @return the object identifier associated with name, if present.
+         */
+        public static DerObjectIdentifier GetOid(
+            string name)
+        {
             return (DerObjectIdentifier)objIds[Platform.ToLowerInvariant(name)];
-		}
-
-		/**
-		 * return the named curve name represented by the given object identifier.
-		 */
-		public static string GetName(
-			DerObjectIdentifier oid)
-		{
-			return (string) names[oid];
-		}
-
-		/**
-		 * returns an enumeration containing the name strings for curves
-		 * contained in this structure.
-		 */
-		public static IEnumerable Names
-		{
-			get { return new EnumerableProxy(objIds.Keys); }
-		}
-	}
+        }
+
+        /**
+         * return the named curve name represented by the given object identifier.
+         */
+        public static string GetName(
+            DerObjectIdentifier oid)
+        {
+            return (string) names[oid];
+        }
+
+        /**
+         * returns an enumeration containing the name strings for curves
+         * contained in this structure.
+         */
+        public static IEnumerable Names
+        {
+            get { return new EnumerableProxy(objIds.Keys); }
+        }
+    }
 }
diff --git a/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs b/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
index 7633b1dba..e05a48616 100644
--- a/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
+++ b/crypto/src/bcpg/SymmetricKeyAlgorithmTags.cs
@@ -5,16 +5,19 @@ namespace Org.BouncyCastle.Bcpg
     */
     public enum SymmetricKeyAlgorithmTag
     {
-        Null = 0,        // Plaintext or unencrypted data
-        Idea = 1,        // IDEA [IDEA]
-        TripleDes = 2,  // Triple-DES (DES-EDE, as per spec -168 bit key derived from 192)
-        Cast5 = 3,       // Cast5 (128 bit key, as per RFC 2144)
-        Blowfish = 4,    // Blowfish (128 bit key, 16 rounds) [Blowfish]
-        Safer = 5,       // Safer-SK128 (13 rounds) [Safer]
-        Des = 6,         // Reserved for DES/SK
-        Aes128 = 7,     // Reserved for AES with 128-bit key
-        Aes192 = 8,     // Reserved for AES with 192-bit key
-        Aes256 = 9,     // Reserved for AES with 256-bit key
-        Twofish = 10     // Reserved for Twofish
+        Null = 0,         // Plaintext or unencrypted data
+        Idea = 1,         // IDEA [IDEA]
+        TripleDes = 2,    // Triple-DES (DES-EDE, as per spec -168 bit key derived from 192)
+        Cast5 = 3,        // Cast5 (128 bit key, as per RFC 2144)
+        Blowfish = 4,     // Blowfish (128 bit key, 16 rounds) [Blowfish]
+        Safer = 5,        // Safer-SK128 (13 rounds) [Safer]
+        Des = 6,          // Reserved for DES/SK
+        Aes128 = 7,       // Reserved for AES with 128-bit key
+        Aes192 = 8,       // Reserved for AES with 192-bit key
+        Aes256 = 9,       // Reserved for AES with 256-bit key
+        Twofish = 10,     // Reserved for Twofish
+        Camellia128 = 11, // Reserved for AES with 128-bit key
+        Camellia192 = 12, // Reserved for AES with 192-bit key
+        Camellia256 = 13  // Reserved for AES with 256-bit key
     }
 }
diff --git a/crypto/src/cms/CMSSignedDataParser.cs b/crypto/src/cms/CMSSignedDataParser.cs
index 35a125196..e5674a4cf 100644
--- a/crypto/src/cms/CMSSignedDataParser.cs
+++ b/crypto/src/cms/CMSSignedDataParser.cs
@@ -170,11 +170,6 @@ namespace Org.BouncyCastle.Cms
 			{
 				throw new CmsException("io exception: " + e.Message, e);
 			}
-
-			if (_digests.Count < 1)
-			{
-				throw new CmsException("no digests could be created for message.");
-			}
 		}
 
 		/**
diff --git a/crypto/src/crypto/ec/CustomNamedCurves.cs b/crypto/src/crypto/ec/CustomNamedCurves.cs
new file mode 100644
index 000000000..ab609fdb9
--- /dev/null
+++ b/crypto/src/crypto/ec/CustomNamedCurves.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections;
+
+using Org.BouncyCastle.Asn1;
+using Org.BouncyCastle.Asn1.X9;
+using Org.BouncyCastle.Math.EC;
+using Org.BouncyCastle.Utilities;
+using Org.BouncyCastle.Utilities.Collections;
+
+namespace Org.BouncyCastle.Crypto.EC
+{
+    public sealed class CustomNamedCurves
+    {
+        private CustomNamedCurves()
+        {
+        }
+
+        private static ECCurve ConfigureCurve(ECCurve curve)
+        {
+            return curve;
+        }
+
+        private static readonly IDictionary objIds = Platform.CreateHashtable();
+        private static readonly IDictionary curves = Platform.CreateHashtable();
+        private static readonly IDictionary names = Platform.CreateHashtable();
+
+        private static void DefineCurve(
+            string					name,
+            DerObjectIdentifier		oid,
+            X9ECParametersHolder	holder)
+        {
+            objIds.Add(name, oid);
+            names.Add(oid, name);
+            curves.Add(oid, holder);
+        }
+
+        static CustomNamedCurves()
+        {
+        }
+
+        public static X9ECParameters GetByName(
+            string name)
+        {
+            DerObjectIdentifier oid = (DerObjectIdentifier)
+                objIds[Platform.ToLowerInvariant(name)];
+
+            return oid == null ? null : GetByOid(oid);
+        }
+
+
+        /**
+         * return the X9ECParameters object for the named curve represented by
+         * the passed in object identifier. Null if the curve isn't present.
+         *
+         * @param oid an object identifier representing a named curve, if present.
+         */
+        public static X9ECParameters GetByOid(
+            DerObjectIdentifier oid)
+        {
+            X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid];
+
+            return holder == null ? null : holder.Parameters;
+        }
+
+        /**
+         * return the object identifier signified by the passed in name. Null
+         * if there is no object identifier associated with name.
+         *
+         * @return the object identifier associated with name, if present.
+         */
+        public static DerObjectIdentifier GetOid(
+            string name)
+        {
+            return (DerObjectIdentifier)objIds[Platform.ToLowerInvariant(name)];
+        }
+
+        /**
+         * return the named curve name represented by the given object identifier.
+         */
+        public static string GetName(
+            DerObjectIdentifier oid)
+        {
+            return (string)names[oid];
+        }
+
+        /**
+         * returns an enumeration containing the name strings for curves
+         * contained in this structure.
+         */
+        public static IEnumerable Names
+        {
+            get { return new EnumerableProxy(objIds.Keys); }
+        }
+    }
+}
diff --git a/crypto/src/crypto/engines/ChaChaEngine.cs b/crypto/src/crypto/engines/ChaChaEngine.cs
new file mode 100644
index 000000000..f4a7b8fe1
--- /dev/null
+++ b/crypto/src/crypto/engines/ChaChaEngine.cs
@@ -0,0 +1,189 @@
+using System;
+using Org.BouncyCastle.Crypto.Utilities;
+
+namespace Org.BouncyCastle.Crypto.Engines
+{
+	/// <summary>
+	/// Implementation of Daniel J. Bernstein's ChaCha stream cipher.
+	/// </summary>
+	public class ChaChaEngine
+		: Salsa20Engine
+	{
+
+		/// <summary>
+		/// Creates a 20 rounds ChaCha engine.
+		/// </summary>
+		public ChaChaEngine()
+		{
+		}
+
+		/// <summary>
+		/// Creates a ChaCha engine with a specific number of rounds.
+		/// </summary>
+		/// <param name="rounds">the number of rounds (must be an even number).</param>
+		public ChaChaEngine(int rounds)
+			: base(rounds)
+		{
+		}
+
+		public override string AlgorithmName
+		{
+			get { return "ChaCha" + rounds; }
+		}
+
+		protected override void AdvanceCounter()
+		{
+			if (++engineState[12] == 0)
+			{
+				++engineState[13];
+			}
+		}
+
+		protected override void ResetCounter()
+		{
+			engineState[12] = engineState[13] = 0;
+		}
+
+		protected override void SetKey(byte[] keyBytes, byte[] ivBytes)
+		{
+			if ((keyBytes.Length != 16) && (keyBytes.Length != 32))
+			{
+				throw new ArgumentException(AlgorithmName + " requires 128 bit or 256 bit key");
+			}
+
+			int offset = 0;
+			byte[] constants;
+
+			// Key
+			engineState[4] = Pack.LE_To_UInt32(keyBytes, 0);
+			engineState[5] = Pack.LE_To_UInt32(keyBytes, 4);
+			engineState[6] = Pack.LE_To_UInt32(keyBytes, 8);
+			engineState[7] = Pack.LE_To_UInt32(keyBytes, 12);
+
+			if (keyBytes.Length == 32)
+			{
+				constants = sigma;
+				offset = 16;
+			} else
+			{
+				constants = tau;
+			}
+
+			engineState[8] = Pack.LE_To_UInt32(keyBytes, offset);
+			engineState[9] = Pack.LE_To_UInt32(keyBytes, offset + 4);
+			engineState[10] = Pack.LE_To_UInt32(keyBytes, offset + 8);
+			engineState[11] = Pack.LE_To_UInt32(keyBytes, offset + 12);
+
+			engineState[0] = Pack.LE_To_UInt32(constants, 0);
+			engineState[1] = Pack.LE_To_UInt32(constants, 4);
+			engineState[2] = Pack.LE_To_UInt32(constants, 8);
+			engineState[3] = Pack.LE_To_UInt32(constants, 12);
+
+			// Counter
+			engineState[12] = engineState[13] = 0;
+
+			// IV
+			engineState[14] = Pack.LE_To_UInt32(ivBytes, 0);
+			engineState[15] = Pack.LE_To_UInt32(ivBytes, 4);
+		}
+
+		protected override void GenerateKeyStream(byte[] output)
+		{
+			ChachaCore(rounds, engineState, x);
+			Pack.UInt32_To_LE(x, output, 0);
+		}
+
+		/// <summary>
+		/// ChacCha function.
+		/// </summary>
+		/// <param name="rounds">The number of ChaCha rounds to execute</param>
+		/// <param name="input">The input words.</param>
+		/// <param name="x">The ChaCha state to modify.</param>
+		internal static void ChachaCore(int rounds, uint[] input, uint[] x)
+		{
+			if (input.Length != 16) {
+				throw new ArgumentException();
+			}
+			if (x.Length != 16) {
+				throw new ArgumentException();
+			}
+			if (rounds % 2 != 0) {
+				throw new ArgumentException("Number of rounds must be even");
+			}
+
+			uint x00 = input[ 0];
+			uint x01 = input[ 1];
+			uint x02 = input[ 2];
+			uint x03 = input[ 3];
+			uint x04 = input[ 4];
+			uint x05 = input[ 5];
+			uint x06 = input[ 6];
+			uint x07 = input[ 7];
+			uint x08 = input[ 8];
+			uint x09 = input[ 9];
+			uint x10 = input[10];
+			uint x11 = input[11];
+			uint x12 = input[12];
+			uint x13 = input[13];
+			uint x14 = input[14];
+			uint x15 = input[15];
+
+			for (int i = rounds; i > 0; i -= 2)
+			{
+				x00 += x04; x12 = R(x12 ^ x00, 16);
+				x08 += x12; x04 = R(x04 ^ x08, 12);
+				x00 += x04; x12 = R(x12 ^ x00, 8);
+				x08 += x12; x04 = R(x04 ^ x08, 7);
+				x01 += x05; x13 = R(x13 ^ x01, 16);
+				x09 += x13; x05 = R(x05 ^ x09, 12);
+				x01 += x05; x13 = R(x13 ^ x01, 8);
+				x09 += x13; x05 = R(x05 ^ x09, 7);
+				x02 += x06; x14 = R(x14 ^ x02, 16);
+				x10 += x14; x06 = R(x06 ^ x10, 12);
+				x02 += x06; x14 = R(x14 ^ x02, 8);
+				x10 += x14; x06 = R(x06 ^ x10, 7);
+				x03 += x07; x15 = R(x15 ^ x03, 16);
+				x11 += x15; x07 = R(x07 ^ x11, 12);
+				x03 += x07; x15 = R(x15 ^ x03, 8);
+				x11 += x15; x07 = R(x07 ^ x11, 7);
+				x00 += x05; x15 = R(x15 ^ x00, 16);
+				x10 += x15; x05 = R(x05 ^ x10, 12);
+				x00 += x05; x15 = R(x15 ^ x00, 8);
+				x10 += x15; x05 = R(x05 ^ x10, 7);
+				x01 += x06; x12 = R(x12 ^ x01, 16);
+				x11 += x12; x06 = R(x06 ^ x11, 12);
+				x01 += x06; x12 = R(x12 ^ x01, 8);
+				x11 += x12; x06 = R(x06 ^ x11, 7);
+				x02 += x07; x13 = R(x13 ^ x02, 16);
+				x08 += x13; x07 = R(x07 ^ x08, 12);
+				x02 += x07; x13 = R(x13 ^ x02, 8);
+				x08 += x13; x07 = R(x07 ^ x08, 7);
+				x03 += x04; x14 = R(x14 ^ x03, 16);
+				x09 += x14; x04 = R(x04 ^ x09, 12);
+				x03 += x04; x14 = R(x14 ^ x03, 8);
+				x09 += x14; x04 = R(x04 ^ x09, 7);
+
+			}
+
+			x[ 0] = x00 + input[ 0];
+			x[ 1] = x01 + input[ 1];
+			x[ 2] = x02 + input[ 2];
+			x[ 3] = x03 + input[ 3];
+			x[ 4] = x04 + input[ 4];
+			x[ 5] = x05 + input[ 5];
+			x[ 6] = x06 + input[ 6];
+			x[ 7] = x07 + input[ 7];
+			x[ 8] = x08 + input[ 8];
+			x[ 9] = x09 + input[ 9];
+			x[10] = x10 + input[10];
+			x[11] = x11 + input[11];
+			x[12] = x12 + input[12];
+			x[13] = x13 + input[13];
+			x[14] = x14 + input[14];
+			x[15] = x15 + input[15];
+		}
+
+	}
+
+}
+
diff --git a/crypto/src/crypto/engines/IdeaEngine.cs b/crypto/src/crypto/engines/IdeaEngine.cs
index f763c5939..46b5a787c 100644
--- a/crypto/src/crypto/engines/IdeaEngine.cs
+++ b/crypto/src/crypto/engines/IdeaEngine.cs
@@ -1,5 +1,3 @@
-#if INCLUDE_IDEA
-
 using System;
 
 using Org.BouncyCastle.Crypto.Parameters;
@@ -12,26 +10,26 @@ namespace Org.BouncyCastle.Crypto.Engines
     * This implementation is based on the "HOWTO: INTERNATIONAL DATA ENCRYPTION ALGORITHM"
     * implementation summary by Fauzan Mirza (F.U.Mirza@sheffield.ac.uk). (baring 1 typo at the
     * end of the mulinv function!).
-	* </p>
+    * </p>
     * <p>
     * It can be found at ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/idea/
-	* </p>
+    * </p>
     * <p>
-	* Note 1: This algorithm is patented in the USA, Japan, and Europe including
+    * Note 1: This algorithm is patented in the USA, Japan, and Europe including
     * at least Austria, France, Germany, Italy, Netherlands, Spain, Sweden, Switzerland
     * and the United Kingdom. Non-commercial use is free, however any commercial
     * products are liable for royalties. Please see
     * <a href="http://www.mediacrypt.com">www.mediacrypt.com</a> for
     * further details. This announcement has been included at the request of
     * the patent holders.
-	* </p>
-	* <p>
-	* Note 2: Due to the requests concerning the above, this algorithm is now only
-	* included in the extended assembly. It is not included in the default distributions.
-	* </p>
+    * </p>
+    * <p>
+    * Note 2: Due to the requests concerning the above, this algorithm is now only
+    * included in the extended assembly. It is not included in the default distributions.
+    * </p>
     */
     public class IdeaEngine
-		: IBlockCipher
+        : IBlockCipher
     {
         private const int  BLOCK_SIZE = 8;
         private int[] workingKey;
@@ -54,28 +52,28 @@ namespace Org.BouncyCastle.Crypto.Engines
             ICipherParameters	parameters)
         {
             if (!(parameters is KeyParameter))
-				throw new ArgumentException("invalid parameter passed to IDEA init - " + parameters.GetType().ToString());
+                throw new ArgumentException("invalid parameter passed to IDEA init - " + parameters.GetType().ToString());
 
-			workingKey = GenerateWorkingKey(forEncryption,
-				((KeyParameter)parameters).GetKey());
+            workingKey = GenerateWorkingKey(forEncryption,
+                ((KeyParameter)parameters).GetKey());
         }
 
-		public string AlgorithmName
+        public string AlgorithmName
         {
             get { return "IDEA"; }
         }
 
-		public bool IsPartialBlockOkay
-		{
-			get { return false; }
-		}
+        public bool IsPartialBlockOkay
+        {
+            get { return false; }
+        }
 
-		public int GetBlockSize()
+        public int GetBlockSize()
         {
             return BLOCK_SIZE;
         }
 
-		public int ProcessBlock(
+        public int ProcessBlock(
             byte[] input,
             int inOff,
             byte[] output,
@@ -228,7 +226,7 @@ namespace Org.BouncyCastle.Crypto.Engines
         * Common Divisor algorithm. Zero and one are self inverse.
         * <p>
         * i.e. x * MulInv(x) == 1 (modulo BASE)
-		* </p>
+        * </p>
         */
         private int MulInv(
             int x)
@@ -261,7 +259,7 @@ namespace Org.BouncyCastle.Crypto.Engines
         * Return the additive inverse of x.
         * <p>
         * i.e. x + AddInv(x) == 0
-		* </p>
+        * </p>
         */
         int AddInv(
             int x)
@@ -337,5 +335,3 @@ namespace Org.BouncyCastle.Crypto.Engines
         }
     }
 }
-
-#endif
diff --git a/crypto/src/crypto/engines/Salsa20Engine.cs b/crypto/src/crypto/engines/Salsa20Engine.cs
index 7d68deab1..81884d603 100644
--- a/crypto/src/crypto/engines/Salsa20Engine.cs
+++ b/crypto/src/crypto/engines/Salsa20Engine.cs
@@ -7,44 +7,60 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Engines
 {
-	/**
-	 * Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005
-	 */
+	/// <summary>
+	/// Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005
+	/// </summary>
 	public class Salsa20Engine
 		: IStreamCipher
 	{
+		public static readonly int DEFAULT_ROUNDS = 20;
+
 		/** Constants */
 		private const int StateSize = 16; // 16, 32 bit ints = 64 bytes
 
-		private readonly static byte[]
+		protected readonly static byte[]
 			sigma = Strings.ToAsciiByteArray("expand 32-byte k"),
 			tau = Strings.ToAsciiByteArray("expand 16-byte k");
 
+		protected int rounds;
+
 		/*
 		 * variables to hold the state of the engine
 		 * during encryption and decryption
 		 */
-		private int		index = 0;
-		private uint[]  engineState = new uint[StateSize]; // state
-		private uint[]  x = new uint[StateSize]; // internal buffer
-		private byte[]  keyStream = new byte[StateSize * 4], // expanded state, 64 bytes
-						workingKey  = null,
-						workingIV   = null;
-		private bool	initialised = false;
+		private int		 index = 0;
+		internal uint[] engineState = new uint[StateSize]; // state
+		internal uint[] x = new uint[StateSize]; // internal buffer
+		private byte[]	 keyStream = new byte[StateSize * 4]; // expanded state, 64 bytes
+		private bool	 initialised = false;
 
 		/*
 		 * internal counter
 		 */
 		private uint cW0, cW1, cW2;
 
-		/**
-		 * initialise a Salsa20 cipher.
-		 *
-		 * @param forEncryption whether or not we are for encryption.
-		 * @param params the parameters required to set up the cipher.
-		 * @exception ArgumentException if the params argument is
-		 * inappropriate.
-		 */
+		/// <summary>
+		/// Creates a 20 round Salsa20 engine.
+		/// </summary>
+		public Salsa20Engine()
+			: this(DEFAULT_ROUNDS)
+		{
+		}
+
+		/// <summary>
+		/// Creates a Salsa20 engine with a specific number of rounds.
+		/// </summary>
+		/// <param name="rounds">the number of rounds (must be an even number).</param>
+		public Salsa20Engine(int rounds)
+		{
+			if (rounds <= 0 || (rounds & 1) != 0)
+			{
+				throw new ArgumentException("'rounds' must be a positive, even number");
+			}
+
+			this.rounds = rounds;
+		}
+
 		public void Init(
 			bool				forEncryption, 
 			ICipherParameters	parameters)
@@ -58,27 +74,38 @@ namespace Org.BouncyCastle.Crypto.Engines
 			ParametersWithIV ivParams = parameters as ParametersWithIV;
 
 			if (ivParams == null)
-				throw new ArgumentException("Salsa20 Init requires an IV", "parameters");
+				throw new ArgumentException(AlgorithmName + " Init requires an IV", "parameters");
 
 			byte[] iv = ivParams.GetIV();
 
-			if (iv == null || iv.Length != 8)
-				throw new ArgumentException("Salsa20 requires exactly 8 bytes of IV");
+			if (iv == null || iv.Length != NonceSize)
+				throw new ArgumentException(AlgorithmName + " requires exactly " + NonceSize + " bytes of IV");
 
 			KeyParameter key = ivParams.Parameters as KeyParameter;
 
 			if (key == null)
-				throw new ArgumentException("Salsa20 Init requires a key", "parameters");
+				throw new ArgumentException(AlgorithmName + " Init requires a key", "parameters");
 
-			workingKey = key.GetKey();
-			workingIV = iv;
+			SetKey(key.GetKey(), iv);
+			Reset();
+			initialised = true;
+		}
 
-			SetKey(workingKey, workingIV);
+		protected virtual int NonceSize
+		{
+			get { return 8; }
 		}
 
-		public string AlgorithmName
+		public virtual string AlgorithmName
 		{
-			get { return "Salsa20"; }
+			get { 
+				string name = "Salsa20";
+				if (rounds != DEFAULT_ROUNDS)
+				{
+					name += "/" + rounds;
+				}
+				return name;
+			}
 		}
 
 		public byte ReturnByte(
@@ -92,11 +119,7 @@ namespace Org.BouncyCastle.Crypto.Engines
 			if (index == 0)
 			{
 				GenerateKeyStream(keyStream);
-
-				if (++engineState[8] == 0)
-				{
-					++engineState[9];
-				}
+				AdvanceCounter();
 			}
 
 			byte output = (byte)(keyStream[index] ^ input);
@@ -105,6 +128,14 @@ namespace Org.BouncyCastle.Crypto.Engines
 			return output;
 		}
 
+		protected virtual void AdvanceCounter()
+		{
+			if (++engineState[8] == 0)
+			{
+				++engineState[9];
+			}
+		}
+
 		public void ProcessBytes(
 			byte[]	inBytes, 
 			int		inOff, 
@@ -137,11 +168,7 @@ namespace Org.BouncyCastle.Crypto.Engines
 				if (index == 0)
 				{
 					GenerateKeyStream(keyStream);
-
-					if (++engineState[8] == 0)
-					{
-						++engineState[9];
-					}
+					AdvanceCounter();
 				}
 				outBytes[i+outOff] = (byte)(keyStream[index]^inBytes[i+inOff]);
 				index = (index + 1) & 63;
@@ -150,28 +177,32 @@ namespace Org.BouncyCastle.Crypto.Engines
 
 		public void Reset()
 		{
-			SetKey(workingKey, workingIV);
+			index = 0;
+			ResetLimitCounter();
+			ResetCounter();
 		}
 
-		// Private implementation
+		protected virtual void ResetCounter()
+		{
+			engineState[8] = engineState[9] = 0;
+		}
 
-		private void SetKey(byte[] keyBytes, byte[] ivBytes)
+		protected virtual void SetKey(byte[] keyBytes, byte[] ivBytes)
 		{
-			workingKey = keyBytes;
-			workingIV  = ivBytes;
+			if ((keyBytes.Length != 16) && (keyBytes.Length != 32)) {
+				throw new ArgumentException(AlgorithmName + " requires 128 bit or 256 bit key");
+			}
 
-			index = 0;
-			ResetCounter();
 			int offset = 0;
 			byte[] constants;
 
 			// Key
-			engineState[1] = Pack.LE_To_UInt32(workingKey, 0);
-			engineState[2] = Pack.LE_To_UInt32(workingKey, 4);
-			engineState[3] = Pack.LE_To_UInt32(workingKey, 8);
-			engineState[4] = Pack.LE_To_UInt32(workingKey, 12);
+			engineState[1] = Pack.LE_To_UInt32(keyBytes, 0);
+			engineState[2] = Pack.LE_To_UInt32(keyBytes, 4);
+			engineState[3] = Pack.LE_To_UInt32(keyBytes, 8);
+			engineState[4] = Pack.LE_To_UInt32(keyBytes, 12);
 
-			if (workingKey.Length == 32)
+			if (keyBytes.Length == 32)
 			{
 				constants = sigma;
 				offset = 16;
@@ -181,83 +212,125 @@ namespace Org.BouncyCastle.Crypto.Engines
 				constants = tau;
 			}
 
-			engineState[11] = Pack.LE_To_UInt32(workingKey, offset);
-			engineState[12] = Pack.LE_To_UInt32(workingKey, offset + 4);
-			engineState[13] = Pack.LE_To_UInt32(workingKey, offset + 8);
-			engineState[14] = Pack.LE_To_UInt32(workingKey, offset + 12);
+			engineState[11] = Pack.LE_To_UInt32(keyBytes, offset);
+			engineState[12] = Pack.LE_To_UInt32(keyBytes, offset + 4);
+			engineState[13] = Pack.LE_To_UInt32(keyBytes, offset + 8);
+			engineState[14] = Pack.LE_To_UInt32(keyBytes, offset + 12);
 			engineState[0] = Pack.LE_To_UInt32(constants, 0);
 			engineState[5] = Pack.LE_To_UInt32(constants, 4);
 			engineState[10] = Pack.LE_To_UInt32(constants, 8);
 			engineState[15] = Pack.LE_To_UInt32(constants, 12);
 
 			// IV
-			engineState[6] = Pack.LE_To_UInt32(workingIV, 0);
-			engineState[7] = Pack.LE_To_UInt32(workingIV, 4);
-			engineState[8] = engineState[9] = 0;
-
-			initialised = true;
+			engineState[6] = Pack.LE_To_UInt32(ivBytes, 0);
+			engineState[7] = Pack.LE_To_UInt32(ivBytes, 4);
+			ResetCounter();
 		}
 
-		private void GenerateKeyStream(byte[] output)
+		protected virtual void GenerateKeyStream(byte[] output)
 		{
-			SalsaCore(20, engineState, x);
+			SalsaCore(rounds, engineState, x);
 			Pack.UInt32_To_LE(x, output, 0);
 		}
 
-		internal static void SalsaCore(int rounds, uint[] state, uint[] x)
+		internal static void SalsaCore(int rounds, uint[] input, uint[] x)
 		{
-            // TODO Exception if rounds odd?
+			if (input.Length != 16) {
+				throw new ArgumentException();
+			}
+			if (x.Length != 16) {
+				throw new ArgumentException();
+			}
+			if (rounds % 2 != 0) {
+				throw new ArgumentException("Number of rounds must be even");
+			}
 
-            Array.Copy(state, 0, x, 0, state.Length);
+			uint x00 = input[ 0];
+			uint x01 = input[ 1];
+			uint x02 = input[ 2];
+			uint x03 = input[ 3];
+			uint x04 = input[ 4];
+			uint x05 = input[ 5];
+			uint x06 = input[ 6];
+			uint x07 = input[ 7];
+			uint x08 = input[ 8];
+			uint x09 = input[ 9];
+			uint x10 = input[10];
+			uint x11 = input[11];
+			uint x12 = input[12];
+			uint x13 = input[13];
+			uint x14 = input[14];
+			uint x15 = input[15];
 
 			for (int i = rounds; i > 0; i -= 2)
 			{
-				x[ 4] ^= R((x[ 0]+x[12]), 7);
-				x[ 8] ^= R((x[ 4]+x[ 0]), 9);
-				x[12] ^= R((x[ 8]+x[ 4]),13);
-				x[ 0] ^= R((x[12]+x[ 8]),18);
-				x[ 9] ^= R((x[ 5]+x[ 1]), 7);
-				x[13] ^= R((x[ 9]+x[ 5]), 9);
-				x[ 1] ^= R((x[13]+x[ 9]),13);
-				x[ 5] ^= R((x[ 1]+x[13]),18);
-				x[14] ^= R((x[10]+x[ 6]), 7);
-				x[ 2] ^= R((x[14]+x[10]), 9);
-				x[ 6] ^= R((x[ 2]+x[14]),13);
-				x[10] ^= R((x[ 6]+x[ 2]),18);
-				x[ 3] ^= R((x[15]+x[11]), 7);
-				x[ 7] ^= R((x[ 3]+x[15]), 9);
-				x[11] ^= R((x[ 7]+x[ 3]),13);
-				x[15] ^= R((x[11]+x[ 7]),18);
-				x[ 1] ^= R((x[ 0]+x[ 3]), 7);
-				x[ 2] ^= R((x[ 1]+x[ 0]), 9);
-				x[ 3] ^= R((x[ 2]+x[ 1]),13);
-				x[ 0] ^= R((x[ 3]+x[ 2]),18);
-				x[ 6] ^= R((x[ 5]+x[ 4]), 7);
-				x[ 7] ^= R((x[ 6]+x[ 5]), 9);
-				x[ 4] ^= R((x[ 7]+x[ 6]),13);
-				x[ 5] ^= R((x[ 4]+x[ 7]),18);
-				x[11] ^= R((x[10]+x[ 9]), 7);
-				x[ 8] ^= R((x[11]+x[10]), 9);
-				x[ 9] ^= R((x[ 8]+x[11]),13);
-				x[10] ^= R((x[ 9]+x[ 8]),18);
-				x[12] ^= R((x[15]+x[14]), 7);
-				x[13] ^= R((x[12]+x[15]), 9);
-				x[14] ^= R((x[13]+x[12]),13);
-				x[15] ^= R((x[14]+x[13]),18);
+				x04 ^= R((x00+x12), 7);
+				x08 ^= R((x04+x00), 9);
+				x12 ^= R((x08+x04),13);
+				x00 ^= R((x12+x08),18);
+				x09 ^= R((x05+x01), 7);
+				x13 ^= R((x09+x05), 9);
+				x01 ^= R((x13+x09),13);
+				x05 ^= R((x01+x13),18);
+				x14 ^= R((x10+x06), 7);
+				x02 ^= R((x14+x10), 9);
+				x06 ^= R((x02+x14),13);
+				x10 ^= R((x06+x02),18);
+				x03 ^= R((x15+x11), 7);
+				x07 ^= R((x03+x15), 9);
+				x11 ^= R((x07+x03),13);
+				x15 ^= R((x11+x07),18);
+
+				x01 ^= R((x00+x03), 7);
+				x02 ^= R((x01+x00), 9);
+				x03 ^= R((x02+x01),13);
+				x00 ^= R((x03+x02),18);
+				x06 ^= R((x05+x04), 7);
+				x07 ^= R((x06+x05), 9);
+				x04 ^= R((x07+x06),13);
+				x05 ^= R((x04+x07),18);
+				x11 ^= R((x10+x09), 7);
+				x08 ^= R((x11+x10), 9);
+				x09 ^= R((x08+x11),13);
+				x10 ^= R((x09+x08),18);
+				x12 ^= R((x15+x14), 7);
+				x13 ^= R((x12+x15), 9);
+				x14 ^= R((x13+x12),13);
+				x15 ^= R((x14+x13),18);
 			}
 
-			for (int i = 0; i < StateSize; ++i)
-			{
-				x[i] += state[i];
-			}
+			x[ 0] = x00 + input[ 0];
+			x[ 1] = x01 + input[ 1];
+			x[ 2] = x02 + input[ 2];
+			x[ 3] = x03 + input[ 3];
+			x[ 4] = x04 + input[ 4];
+			x[ 5] = x05 + input[ 5];
+			x[ 6] = x06 + input[ 6];
+			x[ 7] = x07 + input[ 7];
+			x[ 8] = x08 + input[ 8];
+			x[ 9] = x09 + input[ 9];
+			x[10] = x10 + input[10];
+			x[11] = x11 + input[11];
+			x[12] = x12 + input[12];
+			x[13] = x13 + input[13];
+			x[14] = x14 + input[14];
+			x[15] = x15 + input[15];
 		}
 
-		private static uint R(uint x, int y)
+		/**
+		 * Rotate left
+		 *
+		 * @param   x   value to rotate
+		 * @param   y   amount to rotate x
+		 *
+		 * @return  rotated x
+		 */
+		internal static uint R(uint x, int y)
 		{
 			return (x << y) | (x >> (32 - y));
 		}
 
-		private void ResetCounter()
+		private void ResetLimitCounter()
 		{
 			cW0 = 0;
 			cW1 = 0;
diff --git a/crypto/src/crypto/engines/XSalsa20Engine.cs b/crypto/src/crypto/engines/XSalsa20Engine.cs
new file mode 100644
index 000000000..fc6630905
--- /dev/null
+++ b/crypto/src/crypto/engines/XSalsa20Engine.cs
@@ -0,0 +1,71 @@
+using System;
+
+using Org.BouncyCastle.Crypto.Utilities;
+
+namespace Org.BouncyCastle.Crypto.Engines
+{
+	/// <summary>
+	/// Implementation of Daniel J. Bernstein's XSalsa20 stream cipher - Salsa20 with an extended nonce.
+	/// </summary>
+	/// <remarks>
+	/// XSalsa20 requires a 256 bit key, and a 192 bit nonce.
+	/// </remarks>
+	public class XSalsa20Engine 
+		: Salsa20Engine
+	{
+
+		public override string AlgorithmName
+		{
+			get { return "XSalsa20"; }
+		}
+
+		protected override int NonceSize
+		{
+			get { return 24; }
+		}
+
+		/// <summary>
+		/// XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce
+		/// using a core Salsa20 function without input addition to produce 256 bit working key
+		/// and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state.
+		/// </summary>
+		protected override void SetKey(byte[] keyBytes, byte[] ivBytes)
+		{
+			if (keyBytes.Length != 32)
+			{
+				throw new ArgumentException(AlgorithmName + " requires a 256 bit key");
+			}
+
+			// Set key for HSalsa20
+			base.SetKey(keyBytes, ivBytes);
+
+			// Pack next 64 bits of IV into engine state instead of counter
+			engineState[8] = Pack.LE_To_UInt32(ivBytes, 8);
+			engineState[9] = Pack.LE_To_UInt32(ivBytes, 12);
+
+			// Process engine state to generate Salsa20 key
+			uint[] hsalsa20Out = new uint[engineState.Length];
+			SalsaCore(20, engineState, hsalsa20Out);
+
+			// Set new key, removing addition in last round of salsaCore
+			engineState[1] = hsalsa20Out[0] - engineState[0];
+			engineState[2] = hsalsa20Out[5] - engineState[5];
+			engineState[3] = hsalsa20Out[10] - engineState[10];
+			engineState[4] = hsalsa20Out[15] - engineState[15];
+
+			engineState[11] = hsalsa20Out[6] - engineState[6];
+			engineState[12] = hsalsa20Out[7] - engineState[7];
+			engineState[13] = hsalsa20Out[8] - engineState[8];
+			engineState[14] = hsalsa20Out[9] - engineState[9];
+
+			// Last 64 bits of input IV
+			engineState[6] = Pack.LE_To_UInt32(ivBytes, 16);
+			engineState[7] = Pack.LE_To_UInt32(ivBytes, 20);
+
+			// Counter reset
+			ResetCounter();
+		}
+
+	}
+}
+
diff --git a/crypto/src/crypto/generators/ECKeyPairGenerator.cs b/crypto/src/crypto/generators/ECKeyPairGenerator.cs
index 8f2b1c2b5..a936755e2 100644
--- a/crypto/src/crypto/generators/ECKeyPairGenerator.cs
+++ b/crypto/src/crypto/generators/ECKeyPairGenerator.cs
@@ -81,6 +81,11 @@ namespace Org.BouncyCastle.Crypto.Generators
             }
 
             this.random = parameters.Random;
+
+            if (this.random == null)
+            {
+                this.random = new SecureRandom();
+            }
         }
 
         /**
diff --git a/crypto/src/crypto/generators/Poly1305KeyGenerator.cs b/crypto/src/crypto/generators/Poly1305KeyGenerator.cs
new file mode 100644
index 000000000..5deb50f07
--- /dev/null
+++ b/crypto/src/crypto/generators/Poly1305KeyGenerator.cs
@@ -0,0 +1,123 @@
+using System;
+
+using Org.BouncyCastle.Crypto;
+using Org.BouncyCastle.Crypto.Macs;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Math;
+
+namespace Org.BouncyCastle.Crypto.Generators
+{
+	/// <summary>
+	/// Generates keys for the Poly1305 MAC.
+	/// </summary>
+	/// <remarks>
+	/// Poly1305 keys are 256 bit keys consisting of a 128 bit secret key used for the underlying block
+	/// cipher followed by a 128 bit {@code r} value used for the polynomial portion of the Mac. <br/>
+	/// The {@code r} value has a specific format with some bits required to be cleared, resulting in an
+	/// effective 106 bit key. <br/>
+	/// A separately generated 256 bit key can be modified to fit the Poly1305 key format by using the
+	/// {@link #clamp(byte[])} method to clear the required bits.
+	/// </remarks>
+	/// <seealso cref="Poly1305"/>
+	public class Poly1305KeyGenerator
+		: CipherKeyGenerator
+	{
+		private const byte R_MASK_LOW_2 = (byte)0xFC;
+		private const byte R_MASK_HIGH_4 = (byte)0x0F;
+
+		/// <summary>
+		/// Initialises the key generator.
+		/// </summary>
+		/// <remarks>
+		/// Poly1305 keys are always 256 bits, so the key length in the provided parameters is ignored.
+		/// </remarks>
+		protected override void engineInit(KeyGenerationParameters param)
+		{
+			// Poly1305 keys are always 256 bits
+			this.random = param.Random;
+			this.strength = 32;
+		}
+
+		/// <summary>
+		/// Generates a 256 bit key in the format required for Poly1305 - e.g.
+		/// <code>k[0] ... k[15], r[0] ... r[15]</code> with the required bits in <code>r</code> cleared
+		/// as per <see cref="Clamp(byte[])"/>.
+		/// </summary>
+		protected override byte[] engineGenerateKey()
+		{
+			byte[] key = base.engineGenerateKey();
+			Clamp(key);
+			return key;
+		}
+
+		/// <summary>
+		/// Modifies an existing 32 byte key value to comply with the requirements of the Poly1305 key by
+		/// clearing required bits in the <code>r</code> (second 16 bytes) portion of the key.<br/>
+		/// Specifically:
+		/// <ul>
+		/// <li>r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15})</li>
+		/// <li>r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252})</li>
+		/// </ul>
+		/// </summary>
+		/// <param name="key">a 32 byte key value <code>k[0] ... k[15], r[0] ... r[15]</code></param>
+		public static void Clamp(byte[] key)
+		{
+			/*
+	         * Key is k[0] ... k[15], r[0] ... r[15] as per poly1305_aes_clamp in ref impl.
+	         */
+			if (key.Length != 32)
+			{
+				throw new ArgumentException("Poly1305 key must be 256 bits.");
+			}
+
+			/*
+	         * r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15})
+	         */
+			key[19] &= R_MASK_HIGH_4;
+			key[23] &= R_MASK_HIGH_4;
+			key[27] &= R_MASK_HIGH_4;
+			key[31] &= R_MASK_HIGH_4;
+
+			/*
+	         * r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252}).
+	         */
+			key[20] &= R_MASK_LOW_2;
+			key[24] &= R_MASK_LOW_2;
+			key[28] &= R_MASK_LOW_2;
+		}
+
+		/// <summary>
+		/// Checks a 32 byte key for compliance with the Poly1305 key requirements, e.g.
+		/// <code>k[0] ... k[15], r[0] ... r[15]</code> with the required bits in <code>r</code> cleared
+		/// as per <see cref="Clamp(byte[])"/>.
+		/// </summary>
+		/// <param name="key">Key.</param>
+		/// <exception cref="System.ArgumentException">if the key is of the wrong length, or has invalid bits set
+		///           in the <code>r</code> portion of the key.</exception>
+		public static void CheckKey(byte[] key)
+		{
+			if (key.Length != 32)
+			{
+				throw new ArgumentException("Poly1305 key must be 256 bits.");
+			}
+
+			checkMask(key[19], R_MASK_HIGH_4);
+			checkMask(key[23], R_MASK_HIGH_4);
+			checkMask(key[27], R_MASK_HIGH_4);
+			checkMask(key[31], R_MASK_HIGH_4);
+
+			checkMask(key[20], R_MASK_LOW_2);
+			checkMask(key[24], R_MASK_LOW_2);
+			checkMask(key[28], R_MASK_LOW_2);
+		}
+
+		private static void checkMask(byte b, byte mask)
+		{
+			if ((b & (~mask)) != 0)
+			{
+				throw new ArgumentException("Invalid format for r portion of Poly1305 key.");
+			}
+		}
+
+	}
+}
\ No newline at end of file
diff --git a/crypto/src/crypto/macs/CMac.cs b/crypto/src/crypto/macs/CMac.cs
index b55a05605..682c12bac 100644
--- a/crypto/src/crypto/macs/CMac.cs
+++ b/crypto/src/crypto/macs/CMac.cs
@@ -107,7 +107,7 @@ namespace Org.BouncyCastle.Crypto.Macs
 
         private static int ShiftLeft(byte[] block, byte[] output)
         {
-            int i = 16;
+            int i = block.Length;
             uint bit = 0;
             while (--i >= 0)
             {
diff --git a/crypto/src/crypto/macs/GMac.cs b/crypto/src/crypto/macs/GMac.cs
new file mode 100644
index 000000000..eb340ddbc
--- /dev/null
+++ b/crypto/src/crypto/macs/GMac.cs
@@ -0,0 +1,111 @@
+using System;
+using System.Collections;
+
+using Org.BouncyCastle.Crypto;
+using Org.BouncyCastle.Crypto.Modes;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Utilities;
+
+namespace Org.BouncyCastle.Crypto.Macs
+{
+	/// <summary>
+	/// The GMAC specialisation of Galois/Counter mode (GCM) detailed in NIST Special Publication
+	/// 800-38D.
+	/// </summary>
+	/// <remarks>
+	/// GMac is an invocation of the GCM mode where no data is encrypted (i.e. all input data to the Mac
+	/// is processed as additional authenticated data with the underlying GCM block cipher).
+	/// </remarks>
+	public class GMac 
+		: IMac
+	{
+	    private readonly GcmBlockCipher cipher;
+		private readonly int macSizeBits;
+
+		/// <summary>
+		/// Creates a GMAC based on the operation of a block cipher in GCM mode.
+		/// </summary>
+		/// <remarks>
+		/// This will produce an authentication code the length of the block size of the cipher.
+		/// </remarks>
+		/// <param name="cipher">the cipher to be used in GCM mode to generate the MAC.</param>
+		public GMac(GcmBlockCipher cipher)
+			: this(cipher, 128)
+	    {
+	    }
+
+		/// <summary>
+		/// Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode.
+		/// </summary>
+		/// <remarks>
+		/// This will produce an authentication code the length of the block size of the cipher.
+		/// </remarks>
+		/// <param name="cipher">the cipher to be used in GCM mode to generate the MAC.</param>
+		/// <param name="macSizeBits">the mac size to generate, in bits. Must be a multiple of 8, between 96 and 128 (inclusive).</param>
+		public GMac(GcmBlockCipher cipher, int macSizeBits)
+	    {
+	        this.cipher = cipher;
+	        this.macSizeBits = macSizeBits;
+	    }
+
+		/// <summary>
+		/// Initialises the GMAC - requires a <see cref="Org.BouncyCastle.Crypto.Parameters.ParametersWithIV"/> 
+		/// providing a <see cref="Org.BouncyCastle.Crypto.Parameters.KeyParameter"/> and a nonce.
+		/// </summary>
+	    public void Init(ICipherParameters parameters)
+	    {
+			if (parameters is ParametersWithIV)
+	        {
+				ParametersWithIV param = (ParametersWithIV)parameters;
+
+	            byte[] iv = param.GetIV();
+	            KeyParameter keyParam = (KeyParameter)param.Parameters;
+
+	            // GCM is always operated in encrypt mode to calculate MAC
+	            cipher.Init(true, new AeadParameters(keyParam, macSizeBits, iv));
+	        }
+	        else
+	        {
+	            throw new ArgumentException("GMAC requires ParametersWithIV");
+	        }
+	    }
+
+	    public string AlgorithmName
+	    {
+			get { return cipher.GetUnderlyingCipher().AlgorithmName + "-GMAC"; }
+	    }
+
+		public int GetMacSize()
+	    {
+	        return macSizeBits / 8;
+	    }
+
+	    public void Update(byte input) 
+	    {
+			cipher.ProcessAadByte(input);
+	    }
+
+		public void BlockUpdate(byte[] input, int inOff, int len)
+	    {
+			cipher.ProcessAadBytes(input, inOff, len);
+	    }
+
+		public int DoFinal(byte[] output, int outOff)
+	    {
+	        try
+	        {
+	            return cipher.DoFinal(output, outOff);
+	        }
+			catch (InvalidCipherTextException e)
+	        {
+	            // Impossible in encrypt mode
+	            throw new InvalidOperationException(e.ToString());
+	        }
+	    }
+
+	    public void Reset()
+	    {
+	        cipher.Reset();
+	    }
+	}
+}
diff --git a/crypto/src/crypto/macs/Poly1305.cs b/crypto/src/crypto/macs/Poly1305.cs
new file mode 100644
index 000000000..2d453b6ad
--- /dev/null
+++ b/crypto/src/crypto/macs/Poly1305.cs
@@ -0,0 +1,272 @@
+using System;
+
+using Org.BouncyCastle.Crypto.Generators;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Crypto.Utilities;
+
+namespace Org.BouncyCastle.Crypto.Macs
+{
+
+	/// <summary>
+	/// Poly1305 message authentication code, designed by D. J. Bernstein.
+	/// </summary>
+	/// <remarks>
+	/// Poly1305 computes a 128-bit (16 bytes) authenticator, using a 128 bit nonce and a 256 bit key
+	/// consisting of a 128 bit key applied to an underlying cipher, and a 128 bit key (with 106
+	/// effective key bits) used in the authenticator.
+	/// 
+	/// The polynomial calculation in this implementation is adapted from the public domain <a
+	/// href="https://github.com/floodyberry/poly1305-donna">poly1305-donna-unrolled</a> C implementation
+	/// by Andrew M (@floodyberry).
+	/// </remarks>
+	/// <seealso cref="Org.BouncyCastle.Crypto.Generators.Poly1305KeyGenerator"/>
+	public class Poly1305
+		: IMac
+	{
+		private const int BLOCK_SIZE = 16;
+
+		private readonly IBlockCipher cipher;
+
+		private readonly byte[] singleByte = new byte[1];
+
+		// Initialised state
+
+		/** Polynomial key */
+		private uint r0, r1, r2, r3, r4;
+
+		/** Precomputed 5 * r[1..4] */
+		private uint s1, s2, s3, s4;
+
+		/** Encrypted nonce */
+		private uint k0, k1, k2, k3;
+
+		// Accumulating state
+
+		/** Current block of buffered input */
+		private byte[] currentBlock = new byte[BLOCK_SIZE];
+
+		/** Current offset in input buffer */
+		private int currentBlockOffset = 0;
+
+		/** Polynomial accumulator */
+		private uint h0, h1, h2, h3, h4;
+
+		/**
+	     * Constructs a Poly1305 MAC, using a 128 bit block cipher.
+	     */
+		public Poly1305(IBlockCipher cipher)
+		{
+			if (cipher.GetBlockSize() != BLOCK_SIZE)
+			{
+				throw new ArgumentException("Poly1305 requires a 128 bit block cipher.");
+			}
+			this.cipher = cipher;
+		}
+
+		/// <summary>
+		/// Initialises the Poly1305 MAC.
+		/// </summary>
+		/// <param name="parameters">a {@link ParametersWithIV} containing a 128 bit nonce and a {@link KeyParameter} with
+		///          a 256 bit key complying to the {@link Poly1305KeyGenerator Poly1305 key format}.</param>
+		public void Init(ICipherParameters parameters)
+		{
+			byte[] nonce;
+			byte[] key;
+			if ((parameters is ParametersWithIV) && ((ParametersWithIV)parameters).Parameters is KeyParameter)
+			{
+				nonce = ((ParametersWithIV)parameters).GetIV();
+				key = ((KeyParameter)((ParametersWithIV)parameters).Parameters).GetKey();
+			}
+			else
+			{
+				throw new ArgumentException("Poly1305 requires a key and and IV.");
+			}
+
+			setKey(key, nonce);
+			Reset();
+		}
+
+		private void setKey(byte[] key, byte[] nonce)
+		{
+			if (nonce.Length != BLOCK_SIZE)
+			{
+				throw new ArgumentException("Poly1305 requires a 128 bit IV.");
+			}
+			Poly1305KeyGenerator.CheckKey(key);
+
+			// Extract r portion of key
+			uint t0 = Pack.LE_To_UInt32(key, BLOCK_SIZE + 0);
+			uint t1 = Pack.LE_To_UInt32(key, BLOCK_SIZE + 4);
+			uint t2 = Pack.LE_To_UInt32(key, BLOCK_SIZE + 8);
+			uint t3 = Pack.LE_To_UInt32(key, BLOCK_SIZE + 12);
+
+			r0 = t0 & 0x3ffffff; t0 >>= 26; t0 |= t1 << 6;
+			r1 = t0 & 0x3ffff03; t1 >>= 20; t1 |= t2 << 12;
+			r2 = t1 & 0x3ffc0ff; t2 >>= 14; t2 |= t3 << 18;
+			r3 = t2 & 0x3f03fff; t3 >>= 8;
+			r4 = t3 & 0x00fffff;
+
+			// Precompute multipliers
+			s1 = r1 * 5;
+			s2 = r2 * 5;
+			s3 = r3 * 5;
+			s4 = r4 * 5;
+
+			// Compute encrypted nonce
+			byte[] cipherKey = new byte[BLOCK_SIZE];
+			Array.Copy(key, 0, cipherKey, 0, cipherKey.Length);
+
+			cipher.Init(true, new KeyParameter(cipherKey));
+			cipher.ProcessBlock(nonce, 0, cipherKey, 0);
+
+			k0 = Pack.LE_To_UInt32(cipherKey, 0);
+			k1 = Pack.LE_To_UInt32(cipherKey, 4);
+			k2 = Pack.LE_To_UInt32(cipherKey, 8);
+			k3 = Pack.LE_To_UInt32(cipherKey, 12);
+		}
+
+		public string AlgorithmName
+		{
+			get { return "Poly1305-" + cipher.AlgorithmName; }
+		}
+
+		public int GetMacSize()
+		{
+			return BLOCK_SIZE;
+		}
+
+		public void Update(byte input)
+		{
+			singleByte[0] = input;
+			BlockUpdate(singleByte, 0, 1);
+		}
+
+		public void BlockUpdate(byte[] input, int inOff, int len)
+		{
+			int copied = 0;
+			while (len > copied)
+			{
+				if (currentBlockOffset == BLOCK_SIZE)
+				{
+					processBlock();
+					currentBlockOffset = 0;
+				}
+
+				int toCopy = System.Math.Min((len - copied), BLOCK_SIZE - currentBlockOffset);
+				Array.Copy(input, copied + inOff, currentBlock, currentBlockOffset, toCopy);
+				copied += toCopy;
+				currentBlockOffset += toCopy;
+			}
+
+		}
+
+		private void processBlock()
+		{
+			if (currentBlockOffset < BLOCK_SIZE)
+			{
+				currentBlock[currentBlockOffset] = 1;
+				for (int i = currentBlockOffset + 1; i < BLOCK_SIZE; i++)
+				{
+					currentBlock[i] = 0;
+				}
+			}
+
+			ulong t0 = Pack.LE_To_UInt32(currentBlock, 0);
+			ulong t1 = Pack.LE_To_UInt32(currentBlock, 4);
+			ulong t2 = Pack.LE_To_UInt32(currentBlock, 8);
+			ulong t3 = Pack.LE_To_UInt32(currentBlock, 12);
+
+			h0 += (uint)(t0 & 0x3ffffffU);
+			h1 += (uint)((((t1 << 32) | t0) >> 26) & 0x3ffffff);
+			h2 += (uint)((((t2 << 32) | t1) >> 20) & 0x3ffffff);
+			h3 += (uint)((((t3 << 32) | t2) >> 14) & 0x3ffffff);
+			h4 += (uint)(t3 >> 8);
+
+			if (currentBlockOffset == BLOCK_SIZE)
+			{
+				h4 += (1 << 24);
+			}
+
+			ulong tp0 = mul32x32_64(h0,r0) + mul32x32_64(h1,s4) + mul32x32_64(h2,s3) + mul32x32_64(h3,s2) + mul32x32_64(h4,s1);
+			ulong tp1 = mul32x32_64(h0,r1) + mul32x32_64(h1,r0) + mul32x32_64(h2,s4) + mul32x32_64(h3,s3) + mul32x32_64(h4,s2);
+			ulong tp2 = mul32x32_64(h0,r2) + mul32x32_64(h1,r1) + mul32x32_64(h2,r0) + mul32x32_64(h3,s4) + mul32x32_64(h4,s3);
+			ulong tp3 = mul32x32_64(h0,r3) + mul32x32_64(h1,r2) + mul32x32_64(h2,r1) + mul32x32_64(h3,r0) + mul32x32_64(h4,s4);
+			ulong tp4 = mul32x32_64(h0,r4) + mul32x32_64(h1,r3) + mul32x32_64(h2,r2) + mul32x32_64(h3,r1) + mul32x32_64(h4,r0);
+
+			ulong b;
+			h0 = (uint)tp0 & 0x3ffffff; b = (tp0 >> 26);
+			tp1 += b; h1 = (uint)tp1 & 0x3ffffff; b = (tp1 >> 26);
+			tp2 += b; h2 = (uint)tp2 & 0x3ffffff; b = (tp2 >> 26);
+			tp3 += b; h3 = (uint)tp3 & 0x3ffffff; b = (tp3 >> 26);
+			tp4 += b; h4 = (uint)tp4 & 0x3ffffff; b = (tp4 >> 26);
+			h0 += (uint)(b * 5);
+		}
+
+		public int DoFinal(byte[] output, int outOff)
+		{
+			if (outOff + BLOCK_SIZE > output.Length)
+			{
+				throw new DataLengthException("Output buffer is too short.");
+			}
+
+			if (currentBlockOffset > 0)
+			{
+				// Process padded block
+				processBlock();
+			}
+
+			ulong f0, f1, f2, f3;
+
+			uint b = h0 >> 26;
+			h0 = h0 & 0x3ffffff;
+			h1 += b; b = h1 >> 26; h1 = h1 & 0x3ffffff;
+			h2 += b; b = h2 >> 26; h2 = h2 & 0x3ffffff;
+			h3 += b; b = h3 >> 26; h3 = h3 & 0x3ffffff;
+			h4 += b; b = h4 >> 26; h4 = h4 & 0x3ffffff;
+			h0 += b * 5;
+
+			uint g0, g1, g2, g3, g4;
+			g0 = h0 + 5; b = g0 >> 26; g0 &= 0x3ffffff;
+			g1 = h1 + b; b = g1 >> 26; g1 &= 0x3ffffff;
+			g2 = h2 + b; b = g2 >> 26; g2 &= 0x3ffffff;
+			g3 = h3 + b; b = g3 >> 26; g3 &= 0x3ffffff;
+			g4 = h4 + b - (1 << 26);
+
+			b = (g4 >> 31) - 1;
+			uint nb = ~b;
+			h0 = (h0 & nb) | (g0 & b);
+			h1 = (h1 & nb) | (g1 & b);
+			h2 = (h2 & nb) | (g2 & b);
+			h3 = (h3 & nb) | (g3 & b);
+			h4 = (h4 & nb) | (g4 & b);
+
+			f0 = ((h0      ) | (h1 << 26)) + (ulong)k0;
+			f1 = ((h1 >> 6 ) | (h2 << 20)) + (ulong)k1;
+			f2 = ((h2 >> 12) | (h3 << 14)) + (ulong)k2;
+			f3 = ((h3 >> 18) | (h4 << 8 )) + (ulong)k3;
+
+			Pack.UInt32_To_LE((uint)f0, output, outOff);
+			f1 += (f0 >> 32);
+			Pack.UInt32_To_LE((uint)f1, output, outOff + 4);
+			f2 += (f1 >> 32);
+			Pack.UInt32_To_LE((uint)f2, output, outOff + 8);
+			f3 += (f2 >> 32);
+			Pack.UInt32_To_LE((uint)f3, output, outOff + 12);
+
+			Reset();
+			return BLOCK_SIZE;
+		}
+
+		public void Reset()
+		{
+			currentBlockOffset = 0;
+
+			h0 = h1 = h2 = h3 = h4 = 0;
+		}
+
+		private static ulong mul32x32_64(uint i1, uint i2)
+		{
+			return ((ulong)i1) * i2;
+		}
+	}
+}
diff --git a/crypto/src/crypto/modes/EAXBlockCipher.cs b/crypto/src/crypto/modes/EAXBlockCipher.cs
index bb027b597..5ccc69b66 100644
--- a/crypto/src/crypto/modes/EAXBlockCipher.cs
+++ b/crypto/src/crypto/modes/EAXBlockCipher.cs
@@ -65,6 +65,11 @@ namespace Org.BouncyCastle.Crypto.Modes
 			get { return cipher.GetUnderlyingCipher().AlgorithmName + "/EAX"; }
 		}
 
+		public IBlockCipher GetUnderlyingCipher()
+		{
+			return cipher;
+		}
+
 		public virtual int GetBlockSize()
 		{
 			return cipher.GetBlockSize();
diff --git a/crypto/src/crypto/modes/GCMBlockCipher.cs b/crypto/src/crypto/modes/GCMBlockCipher.cs
index 95fe6f7ec..74b895e7b 100644
--- a/crypto/src/crypto/modes/GCMBlockCipher.cs
+++ b/crypto/src/crypto/modes/GCMBlockCipher.cs
@@ -69,6 +69,11 @@ namespace Org.BouncyCastle.Crypto.Modes
 			get { return cipher.AlgorithmName + "/GCM"; }
 		}
 
+		public IBlockCipher GetUnderlyingCipher()
+		{
+			return cipher;
+		}
+
 		public virtual int GetBlockSize()
 		{
 			return BlockSize;
diff --git a/crypto/src/crypto/modes/IAeadBlockCipher.cs b/crypto/src/crypto/modes/IAeadBlockCipher.cs
index 06bc50488..52c4ff428 100644
--- a/crypto/src/crypto/modes/IAeadBlockCipher.cs
+++ b/crypto/src/crypto/modes/IAeadBlockCipher.cs
@@ -11,6 +11,9 @@ namespace Org.BouncyCastle.Crypto.Modes
 		/// <summary>The name of the algorithm this cipher implements.</summary>
 		string AlgorithmName { get; }
 
+		/// <summary>The block cipher underlying this algorithm.</summary>
+		IBlockCipher GetUnderlyingCipher();
+
 		/// <summary>Initialise the cipher.</summary>
 		/// <remarks>Parameter can either be an AeadParameters or a ParametersWithIV object.</remarks>
 		/// <param name="forEncryption">Initialise for encryption if true, for decryption if false.</param>
diff --git a/crypto/src/crypto/tls/AlertDescription.cs b/crypto/src/crypto/tls/AlertDescription.cs
index e1229a4a3..e09da6cab 100644
--- a/crypto/src/crypto/tls/AlertDescription.cs
+++ b/crypto/src/crypto/tls/AlertDescription.cs
@@ -1,47 +1,217 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 7.2
-	/// </summary>
-	public enum AlertDescription : byte
-	{
-		close_notify = 0,
-		unexpected_message = 10,
-		bad_record_mac = 20,
-		decryption_failed = 21,
-		record_overflow = 22,
-		decompression_failure = 30,
-		handshake_failure = 40,
-		/* 41 is not defined, for historical reasons */
-		bad_certificate = 42,
-		unsupported_certificate = 43,
-		certificate_revoked = 44,
-		certificate_expired = 45,
-		certificate_unknown = 46,
-		illegal_parameter = 47,
-		unknown_ca = 48,
-		access_denied = 49,
-		decode_error = 50,
-		decrypt_error = 51,
-		export_restriction = 60,
-		protocol_version = 70,
-		insufficient_security = 71,
-		internal_error = 80,
-		user_canceled = 90,
-		no_renegotiation = 100,
-
-		/*
-		 *  RFC 3546
-		 */
-		unsupported_extension = 110,
-		certificate_unobtainable = 111,
-		unrecognized_name = 112,
-		bad_certificate_status_response = 113,
-		bad_certificate_hash_value = 114,
-
-		/*
-		 *  RFC 4279
-		 */
-		unknown_psk_identity = 115,
-	}
+    /// <summary>
+    /// RFC 5246 7.2
+    /// </summary>
+    public abstract class AlertDescription
+    {
+        /**
+         * This message notifies the recipient that the sender will not send any more messages on this
+         * connection. Note that as of TLS 1.1, failure to properly close a connection no longer
+         * requires that a session not be resumed. This is a change from TLS 1.0 ("The session becomes
+         * unresumable if any connection is terminated without proper close_notify messages with level
+         * equal to warning.") to conform with widespread implementation practice.
+         */
+        public const byte close_notify = 0;
+
+        /**
+         * An inappropriate message was received. This alert is always fatal and should never be
+         * observed in communication between proper implementations.
+         */
+        public const byte unexpected_message = 10;
+
+        /**
+         * This alert is returned if a record is received with an incorrect MAC. This alert also MUST be
+         * returned if an alert is sent because a TLSCiphertext decrypted in an invalid way: either it
+         * wasn't an even multiple of the block length, or its padding values, when checked, weren't
+         * correct. This message is always fatal and should never be observed in communication between
+         * proper implementations (except when messages were corrupted in the network).
+         */
+        public const byte bad_record_mac = 20;
+
+        /**
+         * This alert was used in some earlier versions of TLS, and may have permitted certain attacks
+         * against the CBC mode [CBCATT]. It MUST NOT be sent by compliant implementations.
+         */
+        public const byte decryption_failed = 21;
+
+        /**
+         * A TLSCiphertext record was received that had a length more than 2^14+2048 bytes, or a record
+         * decrypted to a TLSCompressed record with more than 2^14+1024 bytes. This message is always
+         * fatal and should never be observed in communication between proper implementations (except
+         * when messages were corrupted in the network).
+         */
+        public const byte record_overflow = 22;
+
+        /**
+         * The decompression function received improper input (e.g., data that would expand to excessive
+         * length). This message is always fatal and should never be observed in communication between
+         * proper implementations.
+         */
+        public const byte decompression_failure = 30;
+
+        /**
+         * Reception of a handshake_failure alert message indicates that the sender was unable to
+         * negotiate an acceptable set of security parameters given the options available. This is a
+         * fatal error.
+         */
+        public const byte handshake_failure = 40;
+
+        /**
+         * This alert was used in SSLv3 but not any version of TLS. It MUST NOT be sent by compliant
+         * implementations.
+         */
+        public const byte no_certificate = 41;
+
+        /**
+         * A certificate was corrupt, contained signatures that did not verify correctly, etc.
+         */
+        public const byte bad_certificate = 42;
+
+        /**
+         * A certificate was of an unsupported type.
+         */
+        public const byte unsupported_certificate = 43;
+
+        /**
+         * A certificate was revoked by its signer.
+         */
+        public const byte certificate_revoked = 44;
+
+        /**
+         * A certificate has expired or is not currently valid.
+         */
+        public const byte certificate_expired = 45;
+
+        /**
+         * Some other (unspecified) issue arose in processing the certificate, rendering it
+         * unacceptable.
+         */
+        public const byte certificate_unknown = 46;
+
+        /**
+         * A field in the handshake was out of range or inconsistent with other fields. This message is
+         * always fatal.
+         */
+        public const byte illegal_parameter = 47;
+
+        /**
+         * A valid certificate chain or partial chain was received, but the certificate was not accepted
+         * because the CA certificate could not be located or couldn't be matched with a known, trusted
+         * CA. This message is always fatal.
+         */
+        public const byte unknown_ca = 48;
+
+        /**
+         * A valid certificate was received, but when access control was applied, the sender decided not
+         * to proceed with negotiation. This message is always fatal.
+         */
+        public const byte access_denied = 49;
+
+        /**
+         * A message could not be decoded because some field was out of the specified range or the
+         * length of the message was incorrect. This message is always fatal and should never be
+         * observed in communication between proper implementations (except when messages were corrupted
+         * in the network).
+         */
+        public const byte decode_error = 50;
+
+        /**
+         * A handshake cryptographic operation failed, including being unable to correctly verify a
+         * signature or validate a Finished message. This message is always fatal.
+         */
+        public const byte decrypt_error = 51;
+
+        /**
+         * This alert was used in some earlier versions of TLS. It MUST NOT be sent by compliant
+         * implementations.
+         */
+        public const byte export_restriction = 60;
+
+        /**
+         * The protocol version the client has attempted to negotiate is recognized but not supported.
+         * (For example, old protocol versions might be avoided for security reasons.) This message is
+         * always fatal.
+         */
+        public const byte protocol_version = 70;
+
+        /**
+         * Returned instead of handshake_failure when a negotiation has failed specifically because the
+         * server requires ciphers more secure than those supported by the client. This message is
+         * always fatal.
+         */
+        public const byte insufficient_security = 71;
+
+        /**
+         * An internal error unrelated to the peer or the correctness of the protocol (such as a memory
+         * allocation failure) makes it impossible to continue. This message is always fatal.
+         */
+        public const byte internal_error = 80;
+
+        /**
+         * This handshake is being canceled for some reason unrelated to a protocol failure. If the user
+         * cancels an operation after the handshake is complete, just closing the connection by sending
+         * a close_notify is more appropriate. This alert should be followed by a close_notify. This
+         * message is generally a warning.
+         */
+        public const byte user_canceled = 90;
+
+        /**
+         * Sent by the client in response to a hello request or by the server in response to a client
+         * hello after initial handshaking. Either of these would normally lead to renegotiation; when
+         * that is not appropriate, the recipient should respond with this alert. At that point, the
+         * original requester can decide whether to proceed with the connection. One case where this
+         * would be appropriate is where a server has spawned a process to satisfy a request; the
+         * process might receive security parameters (key length, authentication, etc.) at startup, and
+         * it might be difficult to communicate changes to these parameters after that point. This
+         * message is always a warning.
+         */
+        public const byte no_renegotiation = 100;
+
+        /**
+         * Sent by clients that receive an extended server hello containing an extension that they did
+         * not put in the corresponding client hello. This message is always fatal.
+         */
+        public const byte unsupported_extension = 110;
+
+        /*
+         * RFC 3546
+         */
+
+        /**
+         * This alert is sent by servers who are unable to retrieve a certificate chain from the URL
+         * supplied by the client (see Section 3.3). This message MAY be fatal - for example if client
+         * authentication is required by the server for the handshake to continue and the server is
+         * unable to retrieve the certificate chain, it may send a fatal alert.
+         */
+        public const byte certificate_unobtainable = 111;
+
+        /**
+         * This alert is sent by servers that receive a server_name extension request, but do not
+         * recognize the server name. This message MAY be fatal.
+         */
+        public const byte unrecognized_name = 112;
+
+        /**
+         * This alert is sent by clients that receive an invalid certificate status response (see
+         * Section 3.6). This message is always fatal.
+         */
+        public const byte bad_certificate_status_response = 113;
+
+        /**
+         * This alert is sent by servers when a certificate hash does not match a client provided
+         * certificate_hash. This message is always fatal.
+         */
+        public const byte bad_certificate_hash_value = 114;
+
+        /*
+         * RFC 4279
+         */
+
+        /**
+         * If the server does not recognize the PSK identity, it MAY respond with an
+         * "unknown_psk_identity" alert message.
+         */
+        public const byte unknown_psk_identity = 115;
+    }
 }
diff --git a/crypto/src/crypto/tls/AlertLevel.cs b/crypto/src/crypto/tls/AlertLevel.cs
index afb04308b..d77251dfb 100644
--- a/crypto/src/crypto/tls/AlertLevel.cs
+++ b/crypto/src/crypto/tls/AlertLevel.cs
@@ -1,11 +1,11 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 7.2
-	/// </summary>
-    public enum AlertLevel : byte
-	{
-	    warning = 1,
-	    fatal = 2,
-	}
+    /// <summary>
+    /// RFC 5246 7.2
+    /// </summary>
+    public abstract class AlertLevel
+    {
+        public const byte warning = 1;
+        public const byte fatal = 2;
+    }
 }
diff --git a/crypto/src/crypto/tls/ByteQueue.cs b/crypto/src/crypto/tls/ByteQueue.cs
index c3ce91402..f9398bbaf 100644
--- a/crypto/src/crypto/tls/ByteQueue.cs
+++ b/crypto/src/crypto/tls/ByteQueue.cs
@@ -68,13 +68,13 @@ namespace Org.BouncyCastle.Crypto.Tls
             int		len,
             int		skip)
         {
-            if ((available - skip) < len)
+            if ((buf.Length - offset) < len)
             {
-                throw new TlsException("Not enough data to read");
+                throw new ArgumentException("Buffer size of " + buf.Length + " is too small for a read of " + len + " bytes");
             }
-            if ((buf.Length - offset) < len)
+            if ((available - skip) < len)
             {
-                throw new TlsException("Buffer size of " + buf.Length + " is too small for a read of " + len + " bytes");
+                throw new InvalidOperationException("Not enough data to read");
             }
             Array.Copy(databuf, skipped + skip, buf, offset, len);
         }
@@ -115,7 +115,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         {
             if (i > available)
             {
-                throw new TlsException("Cannot remove " + i + " bytes, only got " + available);
+                throw new InvalidOperationException("Cannot remove " + i + " bytes, only got " + available);
             }
 
             /*
diff --git a/crypto/src/crypto/tls/Certificate.cs b/crypto/src/crypto/tls/Certificate.cs
index e4df041e2..12bfa9214 100644
--- a/crypto/src/crypto/tls/Certificate.cs
+++ b/crypto/src/crypto/tls/Certificate.cs
@@ -8,104 +8,136 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/**
-	* A representation for a certificate chain.
-	*/
-	public class Certificate
-	{
-		public static readonly Certificate EmptyChain = new Certificate(new X509CertificateStructure[0]);
-
-		/**
-		* The certificates.
-		*/
-		internal X509CertificateStructure[] certs;
-
-		/**
-		* Parse the ServerCertificate message.
-		*
-		* @param inStr The stream where to parse from.
-		* @return A Certificate object with the certs, the server has sended.
-		* @throws IOException If something goes wrong during parsing.
-		*/
-		internal static Certificate Parse(
-			Stream inStr)
-		{
-			int left = TlsUtilities.ReadUint24(inStr);
-			if (left == 0)
-			{
-				return EmptyChain;
-			}
-			IList tmp = Platform.CreateArrayList();
-			while (left > 0)
-			{
-				int size = TlsUtilities.ReadUint24(inStr);
-				left -= 3 + size;
-				byte[] buf = new byte[size];
-				TlsUtilities.ReadFully(buf, inStr);
-				MemoryStream bis = new MemoryStream(buf, false);
-				Asn1Object o = Asn1Object.FromStream(bis);
-				tmp.Add(X509CertificateStructure.GetInstance(o));
-				if (bis.Position < bis.Length)
-				{
-					throw new ArgumentException("Sorry, there is garbage data left after the certificate");
-				}
-			}
-            X509CertificateStructure[] certs = new X509CertificateStructure[tmp.Count];
-            for (int i = 0; i < tmp.Count; ++i)
+    /**
+     * Parsing and encoding of a <i>Certificate</i> struct from RFC 4346.
+     * <p/>
+     * <pre>
+     * opaque ASN.1Cert&lt;2^24-1&gt;;
+     *
+     * struct {
+     *     ASN.1Cert certificate_list&lt;0..2^24-1&gt;;
+     * } Certificate;
+     * </pre>
+     *
+     * @see Org.BouncyCastle.Asn1.X509.X509CertificateStructure
+     */
+    public class Certificate
+    {
+        public static readonly Certificate EmptyChain = new Certificate(new X509CertificateStructure[0]);
+
+        /**
+        * The certificates.
+        */
+        protected readonly X509CertificateStructure[] mCertificateList;
+
+        public Certificate(X509CertificateStructure[] certificateList)
+        {
+            if (certificateList == null)
+                throw new ArgumentNullException("certificateList");
+
+            this.mCertificateList = certificateList;
+        }
+
+        /// <returns>An array which contains the certs, this chain contains.</returns>
+        [Obsolete("Use 'GetCertificateList' instead")]
+        public virtual X509CertificateStructure[] GetCerts()
+        {
+            return GetCertificateList();
+        }
+
+        /**
+         * @return an array of {@link org.bouncycastle.asn1.x509.Certificate} representing a certificate
+         *         chain.
+         */
+        public virtual X509CertificateStructure[] GetCertificateList()
+        {
+            return CloneCertificateList();
+        }
+
+        public virtual X509CertificateStructure GetCertificateAt(int index)
+        {
+            return mCertificateList[index];
+        }
+
+        public virtual int Length
+        {
+            get { return mCertificateList.Length; }
+        }
+
+        /**
+         * @return <code>true</code> if this certificate chain contains no certificates, or
+         *         <code>false</code> otherwise.
+         */
+        public virtual bool IsEmpty
+        {
+            get { return mCertificateList.Length == 0; }
+        }
+
+        /**
+         * Encode this {@link Certificate} to a {@link Stream}.
+         *
+         * @param output the {@link Stream} to encode to.
+         * @throws IOException
+         */
+        public virtual void Encode(Stream output)
+        {
+            IList derEncodings = Platform.CreateArrayList(mCertificateList.Length);
+
+            int totalLength = 0;
+            foreach (Asn1Encodable asn1Cert in mCertificateList)
+            {
+                byte[] derEncoding = asn1Cert.GetEncoded(Asn1Encodable.Der);
+                derEncodings.Add(derEncoding);
+                totalLength += derEncoding.Length + 3;
+            }
+
+            TlsUtilities.CheckUint24(totalLength);
+            TlsUtilities.WriteUint24(totalLength, output);
+
+            foreach (byte[] derEncoding in derEncodings)
+            {
+                TlsUtilities.WriteOpaque24(derEncoding, output);
+            }
+        }
+
+        /**
+         * Parse a {@link Certificate} from a {@link Stream}.
+         *
+         * @param input the {@link Stream} to parse from.
+         * @return a {@link Certificate} object.
+         * @throws IOException
+         */
+        public static Certificate Parse(Stream input)
+        {
+            int totalLength = TlsUtilities.ReadUint24(input);
+            if (totalLength == 0)
             {
-                certs[i] = (X509CertificateStructure)tmp[i];
+                return EmptyChain;
             }
-			return new Certificate(certs);
-		}
-
-		/**
-		 * Encodes version of the ClientCertificate message
-		 *
-		 * @param outStr stream to write the message to
-		 * @throws IOException If something goes wrong
-		 */
-		internal void Encode(
-			Stream outStr)
-		{
-			IList encCerts = Platform.CreateArrayList();
-			int totalSize = 0;
-			foreach (X509CertificateStructure cert in certs)
-			{
-				byte[] encCert = cert.GetEncoded(Asn1Encodable.Der);
-				encCerts.Add(encCert);
-				totalSize += encCert.Length + 3;
-			}
-
-			TlsUtilities.WriteUint24(totalSize, outStr);
-
-			foreach (byte[] encCert in encCerts)
-			{
-				TlsUtilities.WriteOpaque24(encCert, outStr);
-			}
-		}
-
-		/**
-		* Private constructor from a cert array.
-		*
-		* @param certs The certs the chain should contain.
-		*/
-		public Certificate(X509CertificateStructure[] certs)
-		{
-			if (certs == null)
-				throw new ArgumentNullException("certs");
-
-			this.certs = certs;
-		}
-
-		/// <returns>An array which contains the certs, this chain contains.</returns>
-		public X509CertificateStructure[] GetCerts()
-		{
-			return (X509CertificateStructure[]) certs.Clone();
-		}
-
-		public bool IsEmpty
-		{
-			get { return certs.Length == 0; }
-		}
-	}
+
+            byte[] certListData = TlsUtilities.ReadFully(totalLength, input);
+
+            MemoryStream buf = new MemoryStream(certListData, false);
+
+            IList certificate_list = Platform.CreateArrayList();
+            while (buf.Position < buf.Length)
+            {
+                byte[] derEncoding = TlsUtilities.ReadOpaque24(buf);
+                Asn1Object asn1Cert = TlsUtilities.ReadDerObject(derEncoding);
+                certificate_list.Add(X509CertificateStructure.GetInstance(asn1Cert));
+            }
+
+            X509CertificateStructure[] certificateList = new X509CertificateStructure[certificate_list.Count];
+            for (int i = 0; i < certificate_list.Count; ++i)
+            {
+                certificateList[i] = (X509CertificateStructure)certificate_list[i];
+            }
+            return new Certificate(certificateList);
+        }
+
+        protected virtual X509CertificateStructure[] CloneCertificateList()
+        {
+            return (X509CertificateStructure[])mCertificateList.Clone();
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/CertificateRequest.cs b/crypto/src/crypto/tls/CertificateRequest.cs
index 49d8ba6fb..8ab265513 100644
--- a/crypto/src/crypto/tls/CertificateRequest.cs
+++ b/crypto/src/crypto/tls/CertificateRequest.cs
@@ -1,28 +1,158 @@
 using System;
 using System.Collections;
+using System.IO;
+
+using Org.BouncyCastle.Asn1;
+using Org.BouncyCastle.Asn1.X509;
+using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public class CertificateRequest
-	{
-		private ClientCertificateType[] certificateTypes;
-		private IList certificateAuthorities;
-
-		public CertificateRequest(ClientCertificateType[] certificateTypes, IList certificateAuthorities)
-		{
-			this.certificateTypes = certificateTypes;
-			this.certificateAuthorities = certificateAuthorities;
-		}
-
-		public ClientCertificateType[] CertificateTypes
-		{
-			get { return certificateTypes; }
-		}
-
-		/// <returns>A <see cref="IList"/> of X509Name</returns>
-		public IList CertificateAuthorities
-		{
-			get { return certificateAuthorities; }
-		}
-	}
-}
\ No newline at end of file
+    /**
+     * Parsing and encoding of a <i>CertificateRequest</i> struct from RFC 4346.
+     * <p/>
+     * <pre>
+     * struct {
+     *     ClientCertificateType certificate_types&lt;1..2^8-1&gt;;
+     *     DistinguishedName certificate_authorities&lt;3..2^16-1&gt;
+     * } CertificateRequest;
+     * </pre>
+     *
+     * @see ClientCertificateType
+     * @see X509Name
+     */
+    public class CertificateRequest
+    {
+        protected readonly byte[] mCertificateTypes;
+        protected readonly IList mSupportedSignatureAlgorithms;
+        protected readonly IList mCertificateAuthorities;
+
+        /**
+         * @param certificateTypes       see {@link ClientCertificateType} for valid constants.
+         * @param certificateAuthorities an {@link IList} of {@link X509Name}.
+         */
+        public CertificateRequest(byte[] certificateTypes, IList supportedSignatureAlgorithms,
+            IList certificateAuthorities)
+        {
+            this.mCertificateTypes = certificateTypes;
+            this.mSupportedSignatureAlgorithms = supportedSignatureAlgorithms;
+            this.mCertificateAuthorities = certificateAuthorities;
+        }
+
+        /**
+         * @return an array of certificate types
+         * @see {@link ClientCertificateType}
+         */
+        public virtual byte[] CertificateTypes
+        {
+            get { return mCertificateTypes; }
+        }
+
+        /**
+         * @return an {@link IList} of {@link SignatureAndHashAlgorithm} (or null before TLS 1.2).
+         */
+        public virtual IList SupportedSignatureAlgorithms
+        {
+            get { return mSupportedSignatureAlgorithms; }
+        }
+
+        /**
+         * @return an {@link IList} of {@link X509Name}
+         */
+        public virtual IList CertificateAuthorities
+        {
+            get { return mCertificateAuthorities; }
+        }
+
+        /**
+         * Encode this {@link CertificateRequest} to a {@link Stream}.
+         *
+         * @param output the {@link Stream} to encode to.
+         * @throws IOException
+         */
+        public virtual void Encode(Stream output)
+        {
+            if (mCertificateTypes == null || mCertificateTypes.Length == 0)
+            {
+                TlsUtilities.WriteUint8(0, output);
+            }
+            else
+            {
+                TlsUtilities.WriteUint8ArrayWithUint8Length(mCertificateTypes, output);
+            }
+
+            if (mSupportedSignatureAlgorithms != null)
+            {
+                // TODO Check whether SignatureAlgorithm.anonymous is allowed here
+                TlsUtilities.EncodeSupportedSignatureAlgorithms(mSupportedSignatureAlgorithms, false, output);
+            }
+
+            if (mCertificateAuthorities == null || mCertificateAuthorities.Count < 1)
+            {
+                TlsUtilities.WriteUint16(0, output);
+            }
+            else
+            {
+                IList derEncodings = Platform.CreateArrayList(mCertificateAuthorities.Count);
+
+                int totalLength = 0;
+                foreach (Asn1Encodable certificateAuthority in mCertificateAuthorities)
+                {
+                    byte[] derEncoding = certificateAuthority.GetEncoded(Asn1Encodable.Der);
+                    derEncodings.Add(derEncoding);
+                    totalLength += derEncoding.Length;
+                }
+
+                TlsUtilities.CheckUint16(totalLength);
+                TlsUtilities.WriteUint16(totalLength, output);
+
+                foreach (byte[] derEncoding in derEncodings)
+                {
+                    output.Write(derEncoding, 0, derEncoding.Length);
+                }
+            }
+        }
+
+        /**
+         * Parse a {@link CertificateRequest} from a {@link Stream}.
+         * 
+         * @param context
+         *            the {@link TlsContext} of the current connection.
+         * @param input
+         *            the {@link Stream} to parse from.
+         * @return a {@link CertificateRequest} object.
+         * @throws IOException
+         */
+        public static CertificateRequest Parse(//TlsContext context,
+            Stream input)
+        {
+            int numTypes = TlsUtilities.ReadUint8(input);
+            byte[] certificateTypes = new byte[numTypes];
+            for (int i = 0; i < numTypes; ++i)
+            {
+                certificateTypes[i] = TlsUtilities.ReadUint8(input);
+            }
+
+            // TODO Add TLS 1.2 support here
+            IList supportedSignatureAlgorithms = null;
+            //if (TlsUtilities.IsTLSv12(context))
+            //{
+            //    // TODO Check whether SignatureAlgorithm.anonymous is allowed here
+            //    supportedSignatureAlgorithms = TlsUtilities.ParseSupportedSignatureAlgorithms(false, input);
+            //}
+
+            IList certificateAuthorities = Platform.CreateArrayList();
+            byte[] certAuthData = TlsUtilities.ReadOpaque16(input);
+            MemoryStream bis = new MemoryStream(certAuthData, false);
+            while (bis.Position < bis.Length)
+            {
+                byte[] derEncoding = TlsUtilities.ReadOpaque16(bis);
+                Asn1Object asn1 = TlsUtilities.ReadDerObject(derEncoding);
+                // TODO Switch to X500Name when available
+                certificateAuthorities.Add(X509Name.GetInstance(asn1));
+            }
+
+            return new CertificateRequest(certificateTypes, supportedSignatureAlgorithms, certificateAuthorities);
+        }
+    }
+}
diff --git a/crypto/src/crypto/tls/CipherSuite.cs b/crypto/src/crypto/tls/CipherSuite.cs
index 6e1f7a545..2c5077780 100644
--- a/crypto/src/crypto/tls/CipherSuite.cs
+++ b/crypto/src/crypto/tls/CipherSuite.cs
@@ -1,136 +1,298 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 A.5
-	/// </summary>
-	public enum CipherSuite : int
-	{
-		TLS_NULL_WITH_NULL_NULL = 0x0000,
-		TLS_RSA_WITH_NULL_MD5 = 0x0001,
-		TLS_RSA_WITH_NULL_SHA = 0x0002,
-		TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003,
-		TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
-		TLS_RSA_WITH_RC4_128_SHA = 0x0005,
-		TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006,
-		TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007,
-		TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008,
-		TLS_RSA_WITH_DES_CBC_SHA = 0x0009,
-		TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
-		TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B,
-		TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C,
-		TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D,
-		TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E,
-		TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F,
-		TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010,
-		TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011,
-		TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012,
-		TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013,
-		TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014,
-		TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015,
-		TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
-		TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017,
-		TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018,
-		TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019,
-		TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A,
-		TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
-
-		/*
-		 * RFC 3268
-		 */
-		TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
-		TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030,
-		TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031,
-		TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032,
-		TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
-		TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034,
-		TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
-		TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036,
-		TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037,
-		TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038,
-		TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
-		TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A,
-
-		/*
-		 * RFC 4279
-		 */
-		TLS_PSK_WITH_RC4_128_SHA = 0x008A,
-		TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B,
-		TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C,
-		TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D,
-		TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E,
-		TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F,
-		TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090,
-		TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091,
-		TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092,
-		TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093,
-		TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094,
-		TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095,
-
-		/*
-		 * RFC 4492
-		 */
-		TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001,
-		TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002,
-		TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003,
-		TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004,
-		TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005,
-		TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006,
-		TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007,
-		TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008,
-		TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009,
-		TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A,
-		TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B,
-		TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C,
-		TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D,
-		TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E,
-		TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F,
-		TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010,
-		TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011,
-		TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012,
-		TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013,
-		TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014,
-		TLS_ECDH_anon_WITH_NULL_SHA = 0xC015,
-		TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016,
-		TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017,
-		TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018,
-		TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019,
-
-		/*
-		 * RFC 5054
-		 */
-		TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A,
-		TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B,
-		TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C,
-		TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D,
-		TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E,
-		TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F,
-		TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020,
-		TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021,
-		TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022,
-
-		/*
-		 * RFC 5289
-		 */
-		TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
-		TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
-		TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025,
-		TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026,
-		TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
-		TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
-		TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029,
-		TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A,
-		TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B,
-		TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C,
-		TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D,
-		TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E,
-		TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F,
-		TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030,
-		TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031,
-		TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032,
-
-		/*
-		 * RFC 5746
-		 */
-		TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF,
-	}
+    /// <summary>
+    /// RFC 2246 A.5
+    /// </summary>
+    public abstract class CipherSuite
+    {
+        public const int TLS_NULL_WITH_NULL_NULL = 0x0000;
+        public const int TLS_RSA_WITH_NULL_MD5 = 0x0001;
+        public const int TLS_RSA_WITH_NULL_SHA = 0x0002;
+        public const int TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003;
+        public const int TLS_RSA_WITH_RC4_128_MD5 = 0x0004;
+        public const int TLS_RSA_WITH_RC4_128_SHA = 0x0005;
+        public const int TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006;
+        public const int TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007;
+        public const int TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008;
+        public const int TLS_RSA_WITH_DES_CBC_SHA = 0x0009;
+        public const int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A;
+        public const int TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B;
+        public const int TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C;
+        public const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D;
+        public const int TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E;
+        public const int TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F;
+        public const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010;
+        public const int TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011;
+        public const int TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012;
+        public const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013;
+        public const int TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014;
+        public const int TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015;
+        public const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016;
+        public const int TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017;
+        public const int TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018;
+        public const int TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019;
+        public const int TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A;
+        public const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B;
+
+        /*
+         * Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are reserved to avoid
+         * collision with Fortezza-based cipher suites in SSL 3.
+         */
+
+        /*
+         * RFC 3268
+         */
+        public const int TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F;
+        public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030;
+        public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031;
+        public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032;
+        public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033;
+        public const int TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034;
+        public const int TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035;
+        public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036;
+        public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037;
+        public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038;
+        public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039;
+        public const int TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A;
+
+        /*
+         * RFC 4132
+         */
+        public const int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0041;
+        public const int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0042;
+        public const int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0043;
+        public const int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0044;
+        public const int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0045;
+        public const int TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA = 0x0046;
+        public const int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0084;
+        public const int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0085;
+        public const int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0086;
+        public const int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0087;
+        public const int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0088;
+        public const int TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA = 0x0089;
+
+        /*
+         * RFC 4162
+         */
+        public const int TLS_RSA_WITH_SEED_CBC_SHA = 0x0096;
+        public const int TLS_DH_DSS_WITH_SEED_CBC_SHA = 0x0097;
+        public const int TLS_DH_RSA_WITH_SEED_CBC_SHA = 0x0098;
+        public const int TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099;
+        public const int TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A;
+        public const int TLS_DH_anon_WITH_SEED_CBC_SHA = 0x009B;
+
+        /*
+         * RFC 4279
+         */
+        public const int TLS_PSK_WITH_RC4_128_SHA = 0x008A;
+        public const int TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B;
+        public const int TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C;
+        public const int TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D;
+        public const int TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E;
+        public const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F;
+        public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090;
+        public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091;
+        public const int TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092;
+        public const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093;
+        public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094;
+        public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095;
+
+        /*
+         * RFC 4492
+         */
+        public const int TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001;
+        public const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002;
+        public const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003;
+        public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004;
+        public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005;
+        public const int TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006;
+        public const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007;
+        public const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008;
+        public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009;
+        public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A;
+        public const int TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B;
+        public const int TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C;
+        public const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D;
+        public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E;
+        public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F;
+        public const int TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010;
+        public const int TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011;
+        public const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012;
+        public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013;
+        public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014;
+        public const int TLS_ECDH_anon_WITH_NULL_SHA = 0xC015;
+        public const int TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016;
+        public const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017;
+        public const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018;
+        public const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019;
+
+        /*
+         * RFC 4785
+         */
+        public const int TLS_PSK_WITH_NULL_SHA = 0x002C;
+        public const int TLS_DHE_PSK_WITH_NULL_SHA = 0x002D;
+        public const int TLS_RSA_PSK_WITH_NULL_SHA = 0x002E;
+
+        /*
+         * RFC 5054
+         */
+        public const int TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A;
+        public const int TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B;
+        public const int TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C;
+        public const int TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D;
+        public const int TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E;
+        public const int TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F;
+        public const int TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020;
+        public const int TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021;
+        public const int TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022;
+
+        /*
+         * RFC 5246
+         */
+        public const int TLS_RSA_WITH_NULL_SHA256 = 0x003B;
+        public const int TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C;
+        public const int TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D;
+        public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E;
+        public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F;
+        public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040;
+        public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067;
+        public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068;
+        public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069;
+        public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A;
+        public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B;
+        public const int TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C;
+        public const int TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D;
+
+        /*
+         * RFC 5288
+         */
+        public const int TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C;
+        public const int TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D;
+        public const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E;
+        public const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F;
+        public const int TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0;
+        public const int TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1;
+        public const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2;
+        public const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3;
+        public const int TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4;
+        public const int TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5;
+        public const int TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6;
+        public const int TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7;
+
+        /*
+         * RFC 5289
+         */
+        public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023;
+        public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024;
+        public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025;
+        public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026;
+        public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027;
+        public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028;
+        public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029;
+        public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A;
+        public const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B;
+        public const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C;
+        public const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D;
+        public const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E;
+        public const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F;
+        public const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030;
+        public const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031;
+        public const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032;
+
+        /*
+         * RFC 5487
+         */
+        public const int TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8;
+        public const int TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9;
+        public const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA;
+        public const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB;
+        public const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC;
+        public const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD;
+        public const int TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE;
+        public const int TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF;
+        public const int TLS_PSK_WITH_NULL_SHA256 = 0x00B0;
+        public const int TLS_PSK_WITH_NULL_SHA384 = 0x00B1;
+        public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2;
+        public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3;
+        public const int TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4;
+        public const int TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5;
+        public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6;
+        public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7;
+        public const int TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8;
+        public const int TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9;
+
+        /*
+         * RFC 5489
+         */
+        public const int TLS_ECDHE_PSK_WITH_RC4_128_SHA = 0xC033;
+        public const int TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = 0xC034;
+        public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035;
+        public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036;
+        public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0xC037;
+        public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = 0xC038;
+        public const int TLS_ECDHE_PSK_WITH_NULL_SHA = 0xC039;
+        public const int TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0xC03A;
+        public const int TLS_ECDHE_PSK_WITH_NULL_SHA384 = 0xC03B;
+
+        /*
+         * RFC 5746
+         */
+        public const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF;
+
+        /*
+         * RFC 6655
+         */
+        public const int TLS_RSA_WITH_AES_128_CCM = 0xC09C;
+        public const int TLS_RSA_WITH_AES_256_CCM = 0xC09D;
+        public const int TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E;
+        public const int TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F;
+        public const int TLS_RSA_WITH_AES_128_CCM_8 = 0xC0A0;
+        public const int TLS_RSA_WITH_AES_256_CCM_8 = 0xC0A1;
+        public const int TLS_DHE_RSA_WITH_AES_128_CCM_8 = 0xC0A2;
+        public const int TLS_DHE_RSA_WITH_AES_256_CCM_8 = 0xC0A3;
+        public const int TLS_PSK_WITH_AES_128_CCM = 0xC0A4;
+        public const int TLS_PSK_WITH_AES_256_CCM = 0xC0A5;
+        public const int TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6;
+        public const int TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7;
+        public const int TLS_PSK_WITH_AES_128_CCM_8 = 0xC0A8;
+        public const int TLS_PSK_WITH_AES_256_CCM_8 = 0xC0A9;
+        public const int TLS_PSK_DHE_WITH_AES_128_CCM_8 = 0xC0AA;
+        public const int TLS_PSK_DHE_WITH_AES_256_CCM_8 = 0xC0AB;
+
+        /*
+         * TBD[draft-josefsson-salsa20-tls-02] 
+         */
+        const int TLS_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xFF00;
+        const int TLS_RSA_WITH_SALSA20_SHA1 = 0xFF01;
+        const int TLS_DHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xFF02;
+        const int TLS_DHE_RSA_WITH_SALSA20_SHA1 = 0xFF03;
+        const int TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xFF04;
+        const int TLS_ECDHE_RSA_WITH_SALSA20_SHA1 = 0xFF05;
+        const int TLS_ECDHE_ECDSA_WITH_ESTREAM_SALSA20_SHA1 = 0xFF06;
+        const int TLS_ECDHE_ECDSA_WITH_SALSA20_SHA1 = 0xFF07;
+        const int TLS_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xFF08;
+        const int TLS_PSK_WITH_SALSA20_SHA1 = 0xFF09;
+        const int TLS_DHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xFF0A;
+        const int TLS_DHE_PSK_WITH_SALSA20_SHA1 = 0xFF0B;
+        const int TLS_RSA_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xFF0C;
+        const int TLS_RSA_PSK_WITH_SALSA20_SHA1 = 0xFF0D;
+        const int TLS_ECDHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xFF0E;
+        const int TLS_ECDHE_PSK_WITH_SALSA20_SHA1 = 0xFF0F;
+        const int TLS_RSA_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF10;
+        const int TLS_RSA_WITH_SALSA20_UMAC96 = 0xFF11;
+        const int TLS_DHE_RSA_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF12;
+        const int TLS_DHE_RSA_WITH_SALSA20_UMAC96 = 0xFF13;
+        const int TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF14;
+        const int TLS_ECDHE_RSA_WITH_SALSA20_UMAC96 = 0xFF15;
+        const int TLS_ECDHE_ECDSA_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF16;
+        const int TLS_ECDHE_ECDSA_WITH_SALSA20_UMAC96 = 0xFF17;
+        const int TLS_PSK_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF18;
+        const int TLS_PSK_WITH_SALSA20_UMAC96 = 0xFF19;
+        const int TLS_DHE_PSK_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF1A;
+        const int TLS_DHE_PSK_WITH_SALSA20_UMAC96 = 0xFF1B;
+        const int TLS_RSA_PSK_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF1C;
+        const int TLS_RSA_PSK_WITH_SALSA20_UMAC96 = 0xFF1D;
+        const int TLS_ECDHE_PSK_WITH_ESTREAM_SALSA20_UMAC96 = 0xFF1E;
+        const int TLS_ECDHE_PSK_WITH_SALSA20_UMAC96 = 0xFF1F;
+    }
 }
diff --git a/crypto/src/crypto/tls/ClientCertificateType.cs b/crypto/src/crypto/tls/ClientCertificateType.cs
index 58f5d4276..a291a46e6 100644
--- a/crypto/src/crypto/tls/ClientCertificateType.cs
+++ b/crypto/src/crypto/tls/ClientCertificateType.cs
@@ -1,20 +1,23 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 7.4.4
-	/// </summary>
-    public enum ClientCertificateType : byte
-	{
-		rsa_sign = 1,
-		dss_sign = 2,
-		rsa_fixed_dh = 3,
-		dss_fixed_dh = 4,
+    public abstract class ClientCertificateType
+    {
+        /*
+         *  RFC 4346 7.4.4
+         */
+        public const byte rsa_sign = 1;
+        public const byte dss_sign = 2;
+        public const byte rsa_fixed_dh = 3;
+        public const byte dss_fixed_dh = 4;
+        public const byte rsa_ephemeral_dh_RESERVED = 5;
+        public const byte dss_ephemeral_dh_RESERVED = 6;
+        public const byte fortezza_dms_RESERVED = 20;
 
-		/*
-		 * RFC 4492 5.5
-		 */
-		ecdsa_sign = 64,
-		rsa_fixed_ecdh = 65,
-		ecdsa_fixed_ecdh = 66,
-	}
-}
\ No newline at end of file
+        /*
+        * RFC 4492 5.5
+        */
+        public const byte ecdsa_sign = 64;
+        public const byte rsa_fixed_ecdh = 65;
+        public const byte ecdsa_fixed_ecdh = 66;
+    }
+}
diff --git a/crypto/src/crypto/tls/CompressionMethod.cs b/crypto/src/crypto/tls/CompressionMethod.cs
index 4a127a63e..e4ee9666f 100644
--- a/crypto/src/crypto/tls/CompressionMethod.cs
+++ b/crypto/src/crypto/tls/CompressionMethod.cs
@@ -1,20 +1,22 @@
+using System;
+
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 6.1
-	/// </summary>
-    public enum CompressionMethod : byte
-	{
-		NULL = 0,
+    /// <summary>
+    /// RFC 2246 6.1
+    /// </summary>
+    public abstract class CompressionMethod
+    {
+        public const byte NULL = 0;
 
-		/*
-		 * RFC 3749 2
-		 */
-		DEFLATE = 1
+        /*
+         * RFC 3749 2
+         */
+        public const byte DEFLATE = 1;
 
-		/*
-		 * Values from 224 decimal (0xE0) through 255 decimal (0xFF)
-		 * inclusive are reserved for private use.
-		 */
-	}
+        /*
+         * Values from 224 decimal (0xE0) through 255 decimal (0xFF)
+         * inclusive are reserved for private use.
+         */
+    }
 }
diff --git a/crypto/src/crypto/tls/ContentType.cs b/crypto/src/crypto/tls/ContentType.cs
index a664e3a38..d6ab43857 100644
--- a/crypto/src/crypto/tls/ContentType.cs
+++ b/crypto/src/crypto/tls/ContentType.cs
@@ -1,13 +1,14 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 6.2.1
-	/// </summary>
-    public enum ContentType : byte
-	{
-		change_cipher_spec = 20,
-		alert = 21,
-		handshake = 22,
-		application_data = 23,
-	}
+    /**
+     * RFC 2246 6.2.1
+     */
+    public abstract class ContentType
+    {
+        public const byte change_cipher_spec = 20;
+        public const byte alert = 21;
+        public const byte handshake = 22;
+        public const byte application_data = 23;
+        public const byte heartbeat = 24;
+    }
 }
diff --git a/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs b/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs
index 130f4c589..2bd2f40bf 100644
--- a/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs
+++ b/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs
@@ -22,7 +22,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             {
                 throw new ArgumentNullException("clientCertificate");
             }
-            if (clientCertificate.certs.Length == 0)
+            if (clientCertificate.Length == 0)
             {
                 throw new ArgumentException("cannot be empty", "clientCertificate");
             }
diff --git a/crypto/src/crypto/tls/DefaultTlsCipherFactory.cs b/crypto/src/crypto/tls/DefaultTlsCipherFactory.cs
index 75ae311e1..9b6e2c14c 100644
--- a/crypto/src/crypto/tls/DefaultTlsCipherFactory.cs
+++ b/crypto/src/crypto/tls/DefaultTlsCipherFactory.cs
@@ -7,26 +7,26 @@ using Org.BouncyCastle.Crypto.Modes;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public class DefaultTlsCipherFactory
-		: TlsCipherFactory
-	{
-		public virtual TlsCipher CreateCipher(TlsClientContext context,
-			EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm)
-		{
-			switch (encryptionAlgorithm)
-			{
-				case EncryptionAlgorithm.cls_3DES_EDE_CBC:
-					return CreateDesEdeCipher(context, 24, digestAlgorithm);
-				case EncryptionAlgorithm.AES_128_CBC:
-					return CreateAesCipher(context, 16, digestAlgorithm);
-				case EncryptionAlgorithm.AES_256_CBC:
-					return CreateAesCipher(context, 32, digestAlgorithm);
+    public class DefaultTlsCipherFactory
+        : TlsCipherFactory
+    {
+        public virtual TlsCipher CreateCipher(TlsClientContext context,
+            int encryptionAlgorithm, DigestAlgorithm digestAlgorithm)
+        {
+            switch (encryptionAlgorithm)
+            {
+                case EncryptionAlgorithm.cls_3DES_EDE_CBC:
+                    return CreateDesEdeCipher(context, 24, digestAlgorithm);
+                case EncryptionAlgorithm.AES_128_CBC:
+                    return CreateAesCipher(context, 16, digestAlgorithm);
+                case EncryptionAlgorithm.AES_256_CBC:
+                    return CreateAesCipher(context, 32, digestAlgorithm);
                 case EncryptionAlgorithm.RC4_128:
                     return CreateRC4Cipher(context, 16, digestAlgorithm);
-				default:
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
+                default:
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
 
         /// <exception cref="IOException"></exception>
         protected virtual TlsCipher CreateRC4Cipher(TlsClientContext context, int cipherKeySize, DigestAlgorithm digestAlgorithm)
@@ -34,53 +34,53 @@ namespace Org.BouncyCastle.Crypto.Tls
             return new TlsStreamCipher(context, CreateRC4StreamCipher(), CreateRC4StreamCipher(), CreateDigest(digestAlgorithm), CreateDigest(digestAlgorithm), cipherKeySize);
         }
 
-		/// <exception cref="IOException"></exception>
-		protected virtual TlsCipher CreateAesCipher(TlsClientContext context, int cipherKeySize,
-			DigestAlgorithm digestAlgorithm)
-		{
-			return new TlsBlockCipher(context, CreateAesBlockCipher(), CreateAesBlockCipher(),
-				CreateDigest(digestAlgorithm), CreateDigest(digestAlgorithm), cipherKeySize);
-		}
+        /// <exception cref="IOException"></exception>
+        protected virtual TlsCipher CreateAesCipher(TlsClientContext context, int cipherKeySize,
+            DigestAlgorithm digestAlgorithm)
+        {
+            return new TlsBlockCipher(context, CreateAesBlockCipher(), CreateAesBlockCipher(),
+                CreateDigest(digestAlgorithm), CreateDigest(digestAlgorithm), cipherKeySize);
+        }
 
-		/// <exception cref="IOException"></exception>
-		protected virtual TlsCipher CreateDesEdeCipher(TlsClientContext context, int cipherKeySize,
-			DigestAlgorithm digestAlgorithm)
-		{
-			return new TlsBlockCipher(context, CreateDesEdeBlockCipher(), CreateDesEdeBlockCipher(),
-				CreateDigest(digestAlgorithm), CreateDigest(digestAlgorithm), cipherKeySize);
-		}
+        /// <exception cref="IOException"></exception>
+        protected virtual TlsCipher CreateDesEdeCipher(TlsClientContext context, int cipherKeySize,
+            DigestAlgorithm digestAlgorithm)
+        {
+            return new TlsBlockCipher(context, CreateDesEdeBlockCipher(), CreateDesEdeBlockCipher(),
+                CreateDigest(digestAlgorithm), CreateDigest(digestAlgorithm), cipherKeySize);
+        }
 
         protected virtual IStreamCipher CreateRC4StreamCipher()
         {
             return new RC4Engine();
         }
 
-		protected virtual IBlockCipher CreateAesBlockCipher()
-		{
-			return new CbcBlockCipher(new AesFastEngine());
-		}
+        protected virtual IBlockCipher CreateAesBlockCipher()
+        {
+            return new CbcBlockCipher(new AesFastEngine());
+        }
 
-		protected virtual IBlockCipher CreateDesEdeBlockCipher()
-		{
-			return new CbcBlockCipher(new DesEdeEngine());
-		}
+        protected virtual IBlockCipher CreateDesEdeBlockCipher()
+        {
+            return new CbcBlockCipher(new DesEdeEngine());
+        }
 
-		/// <exception cref="IOException"></exception>
-		protected virtual IDigest CreateDigest(DigestAlgorithm digestAlgorithm)
-		{
-			switch (digestAlgorithm)
-			{
-				case DigestAlgorithm.MD5:
-					return new MD5Digest();
-				case DigestAlgorithm.SHA:
-					return new Sha1Digest();
-				case DigestAlgorithm.SHA256:
-					return new Sha256Digest();
-				case DigestAlgorithm.SHA384:
-					return new Sha384Digest();
-				default:
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-	}
+        /// <exception cref="IOException"></exception>
+        protected virtual IDigest CreateDigest(DigestAlgorithm digestAlgorithm)
+        {
+            switch (digestAlgorithm)
+            {
+                case DigestAlgorithm.MD5:
+                    return new MD5Digest();
+                case DigestAlgorithm.SHA:
+                    return new Sha1Digest();
+                case DigestAlgorithm.SHA256:
+                    return new Sha256Digest();
+                case DigestAlgorithm.SHA384:
+                    return new Sha384Digest();
+                default:
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/DefaultTlsClient.cs b/crypto/src/crypto/tls/DefaultTlsClient.cs
index 9f30a33f4..a5fbe8235 100644
--- a/crypto/src/crypto/tls/DefaultTlsClient.cs
+++ b/crypto/src/crypto/tls/DefaultTlsClient.cs
@@ -11,125 +11,125 @@ using Org.BouncyCastle.Crypto.Parameters;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public abstract class DefaultTlsClient
-		: TlsClient
-	{
-		protected TlsCipherFactory cipherFactory;
-
-		protected TlsClientContext context;
-
-        protected CompressionMethod selectedCompressionMethod;
-        protected CipherSuite selectedCipherSuite;
-
-		public DefaultTlsClient()
-			: this(new DefaultTlsCipherFactory())
-		{
-		}
-
-		public DefaultTlsClient(TlsCipherFactory cipherFactory)
-		{
-			this.cipherFactory = cipherFactory;
-		}
-
-		public virtual void Init(TlsClientContext context)
-		{
-			this.context = context;
-		}
-
-        public virtual CipherSuite[] GetCipherSuites()
-		{
-			return new CipherSuite[] {
-				CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+    public abstract class DefaultTlsClient
+        : TlsClient
+    {
+        protected TlsCipherFactory cipherFactory;
+
+        protected TlsClientContext context;
+
+        protected byte selectedCompressionMethod;
+        protected int selectedCipherSuite;
+
+        public DefaultTlsClient()
+            : this(new DefaultTlsCipherFactory())
+        {
+        }
+
+        public DefaultTlsClient(TlsCipherFactory cipherFactory)
+        {
+            this.cipherFactory = cipherFactory;
+        }
+
+        public virtual void Init(TlsClientContext context)
+        {
+            this.context = context;
+        }
+
+        public virtual int[] GetCipherSuites()
+        {
+            return new int[] {
+                CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
                 CipherSuite.TLS_RSA_WITH_RC4_128_SHA,
-			};
-		}
+            };
+        }
 
-        public virtual CompressionMethod[] GetCompressionMethods()
+        public virtual byte[] GetCompressionMethods()
         {
-			/*
-			 * To offer DEFLATE compression, override this method:
-			 *     return new CompressionMethod[] { CompressionMethod.DEFLATE, CompressionMethod.NULL };
-			 */
+            /*
+             * To offer DEFLATE compression, override this method:
+             *     return new byte[] { CompressionMethod.DEFLATE, CompressionMethod.NULL };
+             */
 
-            return new CompressionMethod[] { CompressionMethod.NULL };
+            return new byte[] { CompressionMethod.NULL };
         }
 
         public virtual IDictionary GetClientExtensions()
-		{
-			return null;
-		}
+        {
+            return null;
+        }
 
         public virtual void NotifySessionID(byte[] sessionID)
-		{
-			// Currently ignored
-		}
+        {
+            // Currently ignored
+        }
 
-        public virtual void NotifySelectedCipherSuite(CipherSuite selectedCipherSuite)
-		{
-			this.selectedCipherSuite = selectedCipherSuite;
-		}
+        public virtual void NotifySelectedCipherSuite(int selectedCipherSuite)
+        {
+            this.selectedCipherSuite = selectedCipherSuite;
+        }
 
-        public virtual void NotifySelectedCompressionMethod(CompressionMethod selectedCompressionMethod)
+        public virtual void NotifySelectedCompressionMethod(byte selectedCompressionMethod)
         {
             this.selectedCompressionMethod = selectedCompressionMethod;
         }
 
         public virtual void NotifySecureRenegotiation(bool secureRenegotiation)
-		{
-			if (!secureRenegotiation)
-			{
-				/*
-				 * RFC 5746 3.4.
-				 * If the extension is not present, the server does not support
-				 * secure renegotiation; set secure_renegotiation flag to FALSE.
-				 * In this case, some clients may want to terminate the handshake
-				 * instead of continuing; see Section 4.1 for discussion.
-				 */
+        {
+            if (!secureRenegotiation)
+            {
+                /*
+                 * RFC 5746 3.4.
+                 * If the extension is not present, the server does not support
+                 * secure renegotiation; set secure_renegotiation flag to FALSE.
+                 * In this case, some clients may want to terminate the handshake
+                 * instead of continuing; see Section 4.1 for discussion.
+                 */
 //				throw new TlsFatalAlert(AlertDescription.handshake_failure);
-			}
-		}
+            }
+        }
 
         public virtual void ProcessServerExtensions(IDictionary serverExtensions)
-		{
-		}
+        {
+        }
 
         public virtual TlsKeyExchange GetKeyExchange()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA:
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_RSA_WITH_RC4_128_SHA:
-					return CreateRsaKeyExchange();
+                    return CreateRsaKeyExchange();
 
-				case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA:
-					return CreateDHKeyExchange(KeyExchangeAlgorithm.DH_DSS);
+                case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA:
+                    return CreateDHKeyExchange(KeyExchangeAlgorithm.DH_DSS);
 
-				case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA:
-					return CreateDHKeyExchange(KeyExchangeAlgorithm.DH_RSA);
+                case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA:
+                    return CreateDHKeyExchange(KeyExchangeAlgorithm.DH_RSA);
 
-				case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
-					return CreateDheKeyExchange(KeyExchangeAlgorithm.DHE_DSS);
+                case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
+                    return CreateDheKeyExchange(KeyExchangeAlgorithm.DHE_DSS);
 
-				case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
-					return CreateDheKeyExchange(KeyExchangeAlgorithm.DHE_RSA);
+                case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
+                    return CreateDheKeyExchange(KeyExchangeAlgorithm.DHE_RSA);
 
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA:
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
@@ -155,54 +155,54 @@ namespace Org.BouncyCastle.Crypto.Tls
                 case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA:
                     return CreateECDheKeyExchange(KeyExchangeAlgorithm.ECDHE_RSA);
 
-				default:
-					/*
-					* Note: internal error here; the TlsProtocolHandler verifies that the
-					* server-selected cipher suite was in the list of client-offered cipher
-					* suites, so if we now can't produce an implementation, we shouldn't have
-					* offered it!
-					*/
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		public abstract TlsAuthentication GetAuthentication();
-
-		public virtual TlsCompression GetCompression()
-		{
-			switch (selectedCompressionMethod)
-			{
-				case CompressionMethod.NULL:
-					return new TlsNullCompression();
-
-				case CompressionMethod.DEFLATE:
-					return new TlsDeflateCompression();
-
-				default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected compression method was in the list of client-offered compression
-					 * methods, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		public virtual TlsCipher GetCipher()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
+                default:
+                    /*
+                    * Note: internal error here; the TlsProtocolHandler verifies that the
+                    * server-selected cipher suite was in the list of client-offered cipher
+                    * suites, so if we now can't produce an implementation, we shouldn't have
+                    * offered it!
+                    */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        public abstract TlsAuthentication GetAuthentication();
+
+        public virtual TlsCompression GetCompression()
+        {
+            switch (selectedCompressionMethod)
+            {
+                case CompressionMethod.NULL:
+                    return new TlsNullCompression();
+
+                case CompressionMethod.DEFLATE:
+                    return new TlsDeflateCompression();
+
+                default:
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected compression method was in the list of client-offered compression
+                     * methods, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        public virtual TlsCipher GetCipher()
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:
                 case CipherSuite.TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC, DigestAlgorithm.SHA);
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC, DigestAlgorithm.SHA);
 
                 case CipherSuite.TLS_RSA_WITH_RC4_128_SHA:
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA:
@@ -212,61 +212,61 @@ namespace Org.BouncyCastle.Crypto.Tls
                     return cipherFactory.CreateCipher(context, EncryptionAlgorithm.RC4_128, DigestAlgorithm.SHA);
 
                 case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
                 case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC, DigestAlgorithm.SHA);
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC, DigestAlgorithm.SHA);
 
-				case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC, DigestAlgorithm.SHA);
-
-				default:
-					/*
-					* Note: internal error here; the TlsProtocolHandler verifies that the
-					* server-selected cipher suite was in the list of client-offered cipher
-					* suites, so if we now can't produce an implementation, we shouldn't have
-					* offered it!
-					*/
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		protected virtual TlsKeyExchange CreateDHKeyExchange(KeyExchangeAlgorithm keyExchange)
-		{
-			return new TlsDHKeyExchange(context, keyExchange);
-		}
-
-        protected virtual TlsKeyExchange CreateDheKeyExchange(KeyExchangeAlgorithm keyExchange)
-		{
-			return new TlsDheKeyExchange(context, keyExchange);
-		}
-
-        protected virtual TlsKeyExchange CreateECDHKeyExchange(KeyExchangeAlgorithm keyExchange)
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC, DigestAlgorithm.SHA);
+
+                default:
+                    /*
+                    * Note: internal error here; the TlsProtocolHandler verifies that the
+                    * server-selected cipher suite was in the list of client-offered cipher
+                    * suites, so if we now can't produce an implementation, we shouldn't have
+                    * offered it!
+                    */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        protected virtual TlsKeyExchange CreateDHKeyExchange(int keyExchange)
+        {
+            return new TlsDHKeyExchange(context, keyExchange);
+        }
+
+        protected virtual TlsKeyExchange CreateDheKeyExchange(int keyExchange)
+        {
+            return new TlsDheKeyExchange(context, keyExchange);
+        }
+
+        protected virtual TlsKeyExchange CreateECDHKeyExchange(int keyExchange)
         {
             return new TlsECDHKeyExchange(context, keyExchange);
         }
 
-        protected virtual TlsKeyExchange CreateECDheKeyExchange(KeyExchangeAlgorithm keyExchange)
+        protected virtual TlsKeyExchange CreateECDheKeyExchange(int keyExchange)
         {
             return new TlsECDheKeyExchange(context, keyExchange);
         }
 
         protected virtual TlsKeyExchange CreateRsaKeyExchange()
-		{
-			return new TlsRsaKeyExchange(context);
-		}
+        {
+            return new TlsRsaKeyExchange(context);
+        }
     }
 }
diff --git a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs
index 86c9d1a18..2c5aa3524 100644
--- a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs
+++ b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs
@@ -20,7 +20,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             {
                 throw new ArgumentNullException("clientCertificate");
             }
-            if (clientCertificate.certs.Length == 0)
+            if (clientCertificate.Length == 0)
             {
                 throw new ArgumentException("cannot be empty", "clientCertificate");
             }
diff --git a/crypto/src/crypto/tls/ECCurveType.cs b/crypto/src/crypto/tls/ECCurveType.cs
index 15d5d7b42..1b352e9c4 100644
--- a/crypto/src/crypto/tls/ECCurveType.cs
+++ b/crypto/src/crypto/tls/ECCurveType.cs
@@ -1,29 +1,29 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 4492 5.4
-	/// </summary>
-    public enum ECCurveType : byte
-	{
-		/**
-		 * Indicates the elliptic curve domain parameters are conveyed verbosely, and the
-		 * underlying finite field is a prime field.
-		 */
-		explicit_prime = 1,
+    /// <summary>
+    /// RFC 4492 5.4
+    /// </summary>
+    public abstract class ECCurveType
+    {
+        /**
+         * Indicates the elliptic curve domain parameters are conveyed verbosely, and the
+         * underlying finite field is a prime field.
+         */
+        public const byte explicit_prime = 1;
 
-		/**
-		 * Indicates the elliptic curve domain parameters are conveyed verbosely, and the
-		 * underlying finite field is a characteristic-2 field.
-		 */
-		explicit_char2 = 2,
+        /**
+         * Indicates the elliptic curve domain parameters are conveyed verbosely, and the
+         * underlying finite field is a characteristic-2 field.
+         */
+        public const byte explicit_char2 = 2;
 
-		/**
-		 * Indicates that a named curve is used. This option SHOULD be used when applicable.
-		 */
-		named_curve = 3,
+        /**
+         * Indicates that a named curve is used. This option SHOULD be used when applicable.
+         */
+        public const byte named_curve = 3;
 
-		/*
-		 * Values 248 through 255 are reserved for private use.
-		 */
-	}
+        /*
+         * Values 248 through 255 are reserved for private use.
+         */
+    }
 }
diff --git a/crypto/src/crypto/tls/ECPointFormat.cs b/crypto/src/crypto/tls/ECPointFormat.cs
index 4e0dd0067..21b0fdd97 100644
--- a/crypto/src/crypto/tls/ECPointFormat.cs
+++ b/crypto/src/crypto/tls/ECPointFormat.cs
@@ -1,16 +1,16 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 4492 5.1.2
-	/// </summary>
-    public enum ECPointFormat : byte
-	{
-		uncompressed = 0,
-		ansiX962_compressed_prime = 1,
-		ansiX962_compressed_char2 = 2,
+    /// <summary>
+    /// RFC 4492 5.1.2
+    /// </summary>
+    public abstract class ECPointFormat
+    {
+        public const byte uncompressed = 0;
+        public const byte ansiX962_compressed_prime = 1;
+        public const byte ansiX962_compressed_char2 = 2;
 
-		/*
-		 * reserved (248..255)
-		 */
-	}
+        /*
+         * reserved (248..255)
+         */
+    }
 }
diff --git a/crypto/src/crypto/tls/EncryptionAlgorithm.cs b/crypto/src/crypto/tls/EncryptionAlgorithm.cs
index 79d3b63b5..69aee8abc 100644
--- a/crypto/src/crypto/tls/EncryptionAlgorithm.cs
+++ b/crypto/src/crypto/tls/EncryptionAlgorithm.cs
@@ -2,31 +2,58 @@ using System;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public enum EncryptionAlgorithm
-	{
-		/*
-		 * Note that the values here are implementation-specific and arbitrary.
-		 * It is recommended not to depend on the particular values (e.g. serialization).
-		 */
-		NULL,
-		RC4_40,
-		RC4_128,
-		RC2_CBC_40,
-		IDEA_CBC,
-		DES40_CBC,
-		DES_CBC,
-		cls_3DES_EDE_CBC,
+    /**
+     * RFC 2246
+     * <p/>
+     * Note that the values here are implementation-specific and arbitrary. It is recommended not to
+     * depend on the particular values (e.g. serialization).
+     */
+    public abstract class EncryptionAlgorithm
+    {
+        public const int NULL = 0;
+        public const int RC4_40 = 1;
+        public const int RC4_128 = 2;
+        public const int RC2_CBC_40 = 3;
+        public const int IDEA_CBC = 4;
+        public const int DES40_CBC = 5;
+        public const int DES_CBC = 6;
+        public const int cls_3DES_EDE_CBC = 7;
 
-		/*
-		 * RFC 3268
-		 */
-		AES_128_CBC,
-		AES_256_CBC,
+        /*
+         * RFC 3268
+         */
+        public const int AES_128_CBC = 8;
+        public const int AES_256_CBC = 9;
 
-		/*
-		 * RFC 5289
-		 */
-		AES_128_GCM,
-		AES_256_GCM,
-	}
+        /*
+         * RFC 5289
+         */
+        public const int AES_128_GCM = 10;
+        public const int AES_256_GCM = 11;
+
+        /*
+         * RFC 4132
+         */
+        public const int CAMELLIA_128_CBC = 12;
+        public const int CAMELLIA_256_CBC = 13;
+
+        /*
+         * RFC 4162
+         */
+        public const int SEED_CBC = 14;
+
+        /*
+         * RFC 6655
+         */
+        public const int AES_128_CCM = 15;
+        public const int AES_128_CCM_8 = 16;
+        public const int AES_256_CCM = 17;
+        public const int AES_256_CCM_8 = 18;
+
+        /*
+         * TBD[draft-josefsson-salsa20-tls-02] 
+         */
+        const int ESTREAM_SALSA20 = 100;
+        const int SALSA20 = 101;
+    }
 }
diff --git a/crypto/src/crypto/tls/ExtensionType.cs b/crypto/src/crypto/tls/ExtensionType.cs
index f00e34e3f..0e6a45b5e 100644
--- a/crypto/src/crypto/tls/ExtensionType.cs
+++ b/crypto/src/crypto/tls/ExtensionType.cs
@@ -1,31 +1,56 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 4366 2.3
-	/// </summary>
-	public enum ExtensionType : int
-	{
-		server_name = 0,
-		max_fragment_length = 1,
-		client_certificate_url = 2,
-		trusted_ca_keys = 3,
-		truncated_hmac = 4,
-		status_request = 5,
-
-		/*
-		 * RFC 4492
-		 */
-		elliptic_curves = 10,
-		ec_point_formats = 11,
-
-		/*
-		 * RFC 5054 2.8.1
-		 */
-		srp = 12,
-
-		/*
-		 * RFC 5746 6
-		 */
-		renegotiation_info = 0xff01,
-	}
+    public abstract class ExtensionType
+    {
+        /*
+         * RFC 2546 2.3.
+         */
+        public const int server_name = 0;
+        public const int max_fragment_length = 1;
+        public const int client_certificate_url = 2;
+        public const int trusted_ca_keys = 3;
+        public const int truncated_hmac = 4;
+        public const int status_request = 5;
+
+        /*
+         * RFC 4681
+         */
+        public const int user_mapping = 6;
+
+        /*
+         * RFC 4492 5.1.
+         */
+        public const int elliptic_curves = 10;
+        public const int ec_point_formats = 11;
+
+        /*
+         * RFC 5054 2.8.1.
+         */
+        public const int srp = 12;
+
+        /*
+         * RFC 5077 7.
+         */
+        public const int session_ticket = 35;
+
+        /*
+         * RFC 5246 7.4.1.4.
+         */
+        public const int signature_algorithms = 13;
+
+        /*
+         * RFC 5764 9.
+         */
+        public const int use_srtp = 14;
+
+        /*
+         * RFC 6520 6.
+         */
+        public const int heartbeat = 15;
+
+        /*
+         * RFC 5746 3.2.
+         */
+        public const int renegotiation_info = 0xff01;
+    }
 }
diff --git a/crypto/src/crypto/tls/HandshakeType.cs b/crypto/src/crypto/tls/HandshakeType.cs
index deedb1f84..e63042ac3 100644
--- a/crypto/src/crypto/tls/HandshakeType.cs
+++ b/crypto/src/crypto/tls/HandshakeType.cs
@@ -1,19 +1,40 @@
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 2246 7.4
-	/// </summary>
-    public enum HandshakeType : byte
-	{
-		hello_request = 0,
-		client_hello = 1,
-		server_hello = 2,
-		certificate = 11,
-		server_key_exchange = 12,
-		certificate_request = 13,
-		server_hello_done = 14,
-		certificate_verify = 15,
-		client_key_exchange = 16,
-		finished = 20,
-	}
+    public abstract class HandshakeType
+    {
+        /*
+         * RFC 2246 7.4
+         */
+        public const byte hello_request = 0;
+        public const byte client_hello = 1;
+        public const byte server_hello = 2;
+        public const byte certificate = 11;
+        public const byte server_key_exchange = 12;
+        public const byte certificate_request = 13;
+        public const byte server_hello_done = 14;
+        public const byte certificate_verify = 15;
+        public const byte client_key_exchange = 16;
+        public const byte finished = 20;
+
+        /*
+         * RFC 3546 2.4
+         */
+        public const byte certificate_url = 21;
+        public const byte certificate_status = 22;
+
+        /*
+         *  (DTLS) RFC 4347 4.3.2
+         */
+        public const byte hello_verify_request = 3;
+
+        /*
+         * RFC 4680 
+         */
+        public const byte supplemental_data = 23;
+
+        /*
+         * RFC 5077 
+         */
+        public const byte session_ticket = 4;
+    }
 }
diff --git a/crypto/src/crypto/tls/HashAlgorithm.cs b/crypto/src/crypto/tls/HashAlgorithm.cs
new file mode 100644
index 000000000..41818ca2c
--- /dev/null
+++ b/crypto/src/crypto/tls/HashAlgorithm.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace Org.BouncyCastle.Crypto.Tls
+{
+    /**
+     * RFC 5246 7.4.1.4.1
+     */
+    public abstract class HashAlgorithm
+    {
+        public const byte none = 0;
+        public const byte md5 = 1;
+        public const byte sha1 = 2;
+        public const byte sha224 = 3;
+        public const byte sha256 = 4;
+        public const byte sha384 = 5;
+        public const byte sha512 = 6;
+    }
+}
diff --git a/crypto/src/crypto/tls/KeyExchangeAlgorithm.cs b/crypto/src/crypto/tls/KeyExchangeAlgorithm.cs
index 3fdbeb2a6..3f5088d9b 100644
--- a/crypto/src/crypto/tls/KeyExchangeAlgorithm.cs
+++ b/crypto/src/crypto/tls/KeyExchangeAlgorithm.cs
@@ -2,35 +2,54 @@ using System;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public enum KeyExchangeAlgorithm
-	{
-		/*
-		 * Note that the values here are implementation-specific and arbitrary.
-		 * It is recommended not to depend on the particular values (e.g. serialization).
-		 */
-		NULL,
-		RSA,
-		RSA_EXPORT,
-		DHE_DSS,
-		DHE_DSS_EXPORT,
-		DHE_RSA,
-		DHE_RSA_EXPORT,
-		DH_DSS,
-		DH_DSS_EXPORT,
-		DH_RSA,
-		DH_RSA_EXPORT,
-		DH_anon,
-		DH_anon_export,
-		PSK,
-		DHE_PSK,
-		RSA_PSK,
-		ECDH_ECDSA,
-		ECDHE_ECDSA,
-		ECDH_RSA,
-		ECDHE_RSA,
-		ECDH_anon,
-		SRP,
-		SRP_DSS,
-		SRP_RSA,
-	}
+    /**
+     * RFC 2246
+     * <p/>
+     * Note that the values here are implementation-specific and arbitrary. It is recommended not to
+     * depend on the particular values (e.g. serialization).
+     */
+    public abstract class KeyExchangeAlgorithm
+    {
+        public const int NULL = 0;
+        public const int RSA = 1;
+        public const int RSA_EXPORT = 2;
+        public const int DHE_DSS = 3;
+        public const int DHE_DSS_EXPORT = 4;
+        public const int DHE_RSA = 5;
+        public const int DHE_RSA_EXPORT = 6;
+        public const int DH_DSS = 7;
+        public const int DH_DSS_EXPORT = 8;
+        public const int DH_RSA = 9;
+        public const int DH_RSA_EXPORT = 10;
+        public const int DH_anon = 11;
+        public const int DH_anon_EXPORT = 12;
+
+        /*
+         * RFC 4279
+         */
+        public const int PSK = 13;
+        public const int DHE_PSK = 14;
+        public const int RSA_PSK = 15;
+
+        /*
+         * RFC 4429
+         */
+        public const int ECDH_ECDSA = 16;
+        public const int ECDHE_ECDSA = 17;
+        public const int ECDH_RSA = 18;
+        public const int ECDHE_RSA = 19;
+        public const int ECDH_anon = 20;
+
+        /*
+         * RFC 5054
+         */
+        public const int SRP = 21;
+        public const int SRP_DSS = 22;
+        public const int SRP_RSA = 23;
+    
+        /*
+         * RFC 5489
+         */
+        public const int ECDHE_PSK = 24;
+    }
 }
diff --git a/crypto/src/crypto/tls/LegacyTlsAuthentication.cs b/crypto/src/crypto/tls/LegacyTlsAuthentication.cs
index 395f94208..bce31c0b0 100644
--- a/crypto/src/crypto/tls/LegacyTlsAuthentication.cs
+++ b/crypto/src/crypto/tls/LegacyTlsAuthentication.cs
@@ -2,29 +2,29 @@ using System;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// A temporary class to wrap old CertificateVerifyer stuff for new TlsAuthentication.
-	/// </summary>
-	[Obsolete]
-	public class LegacyTlsAuthentication
-		: TlsAuthentication
-	{
-		protected ICertificateVerifyer verifyer;
+    /// <summary>
+    /// A temporary class to wrap old CertificateVerifyer stuff for new TlsAuthentication.
+    /// </summary>
+    [Obsolete]
+    public class LegacyTlsAuthentication
+        : TlsAuthentication
+    {
+        protected ICertificateVerifyer verifyer;
 
-		public LegacyTlsAuthentication(ICertificateVerifyer verifyer)
-		{
-			this.verifyer = verifyer;
-		}
+        public LegacyTlsAuthentication(ICertificateVerifyer verifyer)
+        {
+            this.verifyer = verifyer;
+        }
 
-		public virtual void NotifyServerCertificate(Certificate serverCertificate)
-		{
-			if (!this.verifyer.IsValid(serverCertificate.GetCerts()))
-				throw new TlsFatalAlert(AlertDescription.user_canceled);
-		}
+        public virtual void NotifyServerCertificate(Certificate serverCertificate)
+        {
+            if (!this.verifyer.IsValid(serverCertificate.GetCertificateList()))
+                throw new TlsFatalAlert(AlertDescription.user_canceled);
+        }
 
-		public virtual TlsCredentials GetClientCredentials(CertificateRequest certificateRequest)
-		{
-			return null;
-		}
-	}
+        public virtual TlsCredentials GetClientCredentials(CertificateRequest certificateRequest)
+        {
+            return null;
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/NamedCurve.cs b/crypto/src/crypto/tls/NamedCurve.cs
index c8ee189aa..8ef395069 100644
--- a/crypto/src/crypto/tls/NamedCurve.cs
+++ b/crypto/src/crypto/tls/NamedCurve.cs
@@ -6,67 +6,91 @@ using Org.BouncyCastle.Crypto.Parameters;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// RFC 4492 5.1.1
-	/// The named curves defined here are those specified in SEC 2 [13]. Note that many of
- 	/// these curves are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00
-	/// through 0xFEFF are reserved for private use. Values 0xFF01 and 0xFF02 indicate that the
-	/// client supports arbitrary prime and characteristic-2 curves, respectively (the curve
-	/// parameters must be encoded explicitly in ECParameters).
-	/// </summary>
-	public enum NamedCurve : int
-	{
-		sect163k1 = 1,
-		sect163r1 = 2,
-		sect163r2 = 3,
-		sect193r1 = 4,
-		sect193r2 = 5,
-		sect233k1 = 6,
-		sect233r1 = 7,
-		sect239k1 = 8,
-		sect283k1 = 9,
-		sect283r1 = 10,
-		sect409k1 = 11,
-		sect409r1 = 12,
-		sect571k1 = 13,
-		sect571r1 = 14,
-		secp160k1 = 15,
-		secp160r1 = 16,
-		secp160r2 = 17,
-		secp192k1 = 18,
-		secp192r1 = 19,
-		secp224k1 = 20,
-		secp224r1 = 21,
-		secp256k1 = 22,
-		secp256r1 = 23,
-		secp384r1 = 24,
-		secp521r1 = 25,
+    /// <summary>
+    /// RFC 4492 5.1.1
+    /// The named curves defined here are those specified in SEC 2 [13]. Note that many of
+    /// these curves are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00
+    /// through 0xFEFF are reserved for private use. Values 0xFF01 and 0xFF02 indicate that the
+    /// client supports arbitrary prime and characteristic-2 curves, respectively (the curve
+    /// parameters must be encoded explicitly in ECParameters).
+    /// </summary>
+    public abstract class NamedCurve
+    {
+        public const int sect163k1 = 1;
+        public const int sect163r1 = 2;
+        public const int sect163r2 = 3;
+        public const int sect193r1 = 4;
+        public const int sect193r2 = 5;
+        public const int sect233k1 = 6;
+        public const int sect233r1 = 7;
+        public const int sect239k1 = 8;
+        public const int sect283k1 = 9;
+        public const int sect283r1 = 10;
+        public const int sect409k1 = 11;
+        public const int sect409r1 = 12;
+        public const int sect571k1 = 13;
+        public const int sect571r1 = 14;
+        public const int secp160k1 = 15;
+        public const int secp160r1 = 16;
+        public const int secp160r2 = 17;
+        public const int secp192k1 = 18;
+        public const int secp192r1 = 19;
+        public const int secp224k1 = 20;
+        public const int secp224r1 = 21;
+        public const int secp256k1 = 22;
+        public const int secp256r1 = 23;
+        public const int secp384r1 = 24;
+        public const int secp521r1 = 25;
+    
+        /*
+         * RFC 7027
+         */
+        public const int brainpoolP256r1 = 26;
+        public const int brainpoolP384r1 = 27;
+        public const int brainpoolP512r1 = 28;
 
-		/*
-		 * reserved (0xFE00..0xFEFF)
-		 */
+        /*
+         * reserved (0xFE00..0xFEFF)
+         */
 
-		arbitrary_explicit_prime_curves = 0xFF01,
-		arbitrary_explicit_char2_curves = 0xFF02,
-	}
+        public const int arbitrary_explicit_prime_curves = 0xFF01;
+        public const int arbitrary_explicit_char2_curves = 0xFF02;
 
-	internal class NamedCurveHelper
-	{
-	    internal static ECDomainParameters GetECParameters(NamedCurve namedCurve)
-	    {
-            if (!Enum.IsDefined(typeof(NamedCurve), namedCurve))
+        public static bool IsValid(int namedCurve)
+        {
+            return namedCurve >= sect163k1 && namedCurve <= brainpoolP512r1;
+        }
+
+        public static bool RefersToASpecificNamedCurve(int namedCurve)
+        {
+            switch (namedCurve)
+            {
+            case arbitrary_explicit_prime_curves:
+            case arbitrary_explicit_char2_curves:
+                return false;
+            default:
+                return true;
+            }
+        }
+    }
+
+    internal class NamedCurveHelper
+    {
+        internal static ECDomainParameters GetECParameters(int namedCurve)
+        {
+            if (!NamedCurve.IsValid(namedCurve))
                 return null;
 
             string curveName = namedCurve.ToString();
 
             // Lazily created the first time a particular curve is accessed
-	        X9ECParameters ecP = SecNamedCurves.GetByName(curveName);
+            X9ECParameters ecP = SecNamedCurves.GetByName(curveName);
 
             if (ecP == null)
                 return null;
 
-	        // It's a bit inefficient to do this conversion every time
-	        return new ECDomainParameters(ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed());
-	    }
-	}
+            // It's a bit inefficient to do this conversion every time
+            return new ECDomainParameters(ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed());
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/PrfAlgorithm.cs b/crypto/src/crypto/tls/PrfAlgorithm.cs
new file mode 100644
index 000000000..976113495
--- /dev/null
+++ b/crypto/src/crypto/tls/PrfAlgorithm.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace Org.BouncyCastle.Crypto.Tls
+{
+    /**
+     * RFC 5246
+     * <p/>
+     * Note that the values here are implementation-specific and arbitrary. It is recommended not to
+     * depend on the particular values (e.g. serialization).
+     */
+    public abstract class PrfAlgorithm
+    {
+        /*
+         * Placeholder to refer to the legacy TLS algorithm
+         */
+        public const int tls_prf_legacy = 0;
+
+        public const int tls_prf_sha256 = 1;
+
+        /*
+         * Implied by RFC 5288
+         */
+        public const int tls_prf_sha384 = 2;
+    }
+}
diff --git a/crypto/src/crypto/tls/ProtocolVersion.cs b/crypto/src/crypto/tls/ProtocolVersion.cs
new file mode 100644
index 000000000..b0d55183a
--- /dev/null
+++ b/crypto/src/crypto/tls/ProtocolVersion.cs
@@ -0,0 +1,159 @@
+using System;
+using System.IO;
+
+using Org.BouncyCastle.Utilities;
+
+namespace Org.BouncyCastle.Crypto.Tls
+{
+    public sealed class ProtocolVersion
+    {
+        public static readonly ProtocolVersion SSLv3 = new ProtocolVersion(0x0300, "SSL 3.0");
+        public static readonly ProtocolVersion TLSv10 = new ProtocolVersion(0x0301, "TLS 1.0");
+        public static readonly ProtocolVersion TLSv11 = new ProtocolVersion(0x0302, "TLS 1.1");
+        public static readonly ProtocolVersion TLSv12 = new ProtocolVersion(0x0303, "TLS 1.2");
+        public static readonly ProtocolVersion DTLSv10 = new ProtocolVersion(0xFEFF, "DTLS 1.0");
+        public static readonly ProtocolVersion DTLSv12 = new ProtocolVersion(0xFEFD, "DTLS 1.2");
+
+        private readonly int version;
+        private readonly String name;
+
+        private ProtocolVersion(int v, String name)
+        {
+            this.version = v & 0xffff;
+            this.name = name;
+        }
+
+        public int FullVersion
+        {
+            get { return version; }
+        }
+
+        public int MajorVersion
+        {
+            get { return version >> 8; }
+        }
+
+        public int MinorVersion
+        {
+            get { return version & 0xff; }
+        }
+
+        public bool IsDtls
+        {
+            get { return MajorVersion == 0xFE; }
+        }
+
+        public bool IsSsl
+        {
+            get { return this == SSLv3; }
+        }
+
+        public bool IsTls
+        {
+            get { return MajorVersion == 0x03; }
+        }
+
+        public ProtocolVersion GetEquivalentTLSVersion()
+        {
+            if (!IsDtls)
+            {
+                return this;
+            }
+            if (this == DTLSv10)
+            {
+                return TLSv11;
+            }
+            return TLSv12;
+        }
+
+        public bool IsEqualOrEarlierVersionOf(ProtocolVersion version)
+        {
+            if (MajorVersion != version.MajorVersion)
+            {
+                return false;
+            }
+            int diffMinorVersion = version.MinorVersion - MinorVersion;
+            return IsDtls ? diffMinorVersion <= 0 : diffMinorVersion >= 0;
+        }
+
+        public bool IsLaterVersionOf(ProtocolVersion version)
+        {
+            if (MajorVersion != version.MajorVersion)
+            {
+                return false;
+            }
+            int diffMinorVersion = version.MinorVersion - MinorVersion;
+            return IsDtls ? diffMinorVersion > 0 : diffMinorVersion < 0;
+        }
+
+        public override bool Equals(object other)
+        {
+            return this == other || (other is ProtocolVersion && Equals((ProtocolVersion)other));
+        }
+
+        public bool Equals(ProtocolVersion other)
+        {
+            return other != null && this.version == other.version;
+        }
+
+        public override int GetHashCode()
+        {
+            return version;
+        }
+
+        /// <exception cref="IOException"/>
+        public static ProtocolVersion Get(int major, int minor)
+        {
+            switch (major)
+            {
+                case 0x03:
+                {
+                    switch (minor)
+                    {
+                        case 0x00:
+                            return SSLv3;
+                        case 0x01:
+                            return TLSv10;
+                        case 0x02:
+                            return TLSv11;
+                        case 0x03:
+                            return TLSv12;
+                    }
+                    return GetUnknownVersion(major, minor, "TLS");
+                }
+                case 0xFE:
+                {
+                    switch (minor)
+                    {
+                        case 0xFF:
+                            return DTLSv10;
+                        case 0xFE:
+                            throw new TlsFatalAlert(AlertDescription.illegal_parameter);
+                        case 0xFD:
+                            return DTLSv12;
+                    }
+                    return GetUnknownVersion(major, minor, "DTLS");
+                }
+                default:
+                {
+                    throw new TlsFatalAlert(AlertDescription.illegal_parameter);
+                }
+            }
+        }
+
+        public override string ToString()
+        {
+            return name;
+        }
+
+        private static ProtocolVersion GetUnknownVersion(int major, int minor, string prefix)
+        {
+            TlsUtilities.CheckUint8(major);
+            TlsUtilities.CheckUint8(minor);
+
+            int v = (major << 8) | minor;
+            String hex = Platform.ToUpperInvariant(Convert.ToString(0x10000 | v, 16).Substring(1));
+            return new ProtocolVersion(v, prefix + " 0x" + hex);
+        }
+    }
+}
diff --git a/crypto/src/crypto/tls/PskTlsClient.cs b/crypto/src/crypto/tls/PskTlsClient.cs
index 9db7d7d90..6011daada 100644
--- a/crypto/src/crypto/tls/PskTlsClient.cs
+++ b/crypto/src/crypto/tls/PskTlsClient.cs
@@ -3,168 +3,168 @@ using System.Collections;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public abstract class PskTlsClient
-		:TlsClient
-	{
-		protected TlsCipherFactory cipherFactory;
-		protected TlsPskIdentity pskIdentity;
+    public abstract class PskTlsClient
+        :TlsClient
+    {
+        protected TlsCipherFactory cipherFactory;
+        protected TlsPskIdentity pskIdentity;
 
         protected TlsClientContext context;
 
-        protected CompressionMethod selectedCompressionMethod;
-		protected CipherSuite selectedCipherSuite;
+        protected byte selectedCompressionMethod;
+        protected int selectedCipherSuite;
 
         public PskTlsClient(TlsPskIdentity pskIdentity)
-			: this(new DefaultTlsCipherFactory(), pskIdentity)
-		{
-		}
+            : this(new DefaultTlsCipherFactory(), pskIdentity)
+        {
+        }
 
         public PskTlsClient(TlsCipherFactory cipherFactory, TlsPskIdentity pskIdentity)
-		{
-			this.cipherFactory = cipherFactory;
-			this.pskIdentity = pskIdentity;
-		}
+        {
+            this.cipherFactory = cipherFactory;
+            this.pskIdentity = pskIdentity;
+        }
 
         public virtual void Init(TlsClientContext context)
-		{
-			this.context = context;
-		}
-
-        public virtual CipherSuite[] GetCipherSuites()
-		{
-			return new CipherSuite[] {
-				CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA,
-				CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA,
-				CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_PSK_WITH_RC4_128_SHA,
-			};
-		}
+        {
+            this.context = context;
+        }
+
+        public virtual int[] GetCipherSuites()
+        {
+            return new int[] {
+                CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA,
+                CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA,
+                CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_PSK_WITH_RC4_128_SHA,
+            };
+        }
 
         public virtual IDictionary GetClientExtensions()
-		{
-			return null;
-		}
+        {
+            return null;
+        }
 
-        public virtual CompressionMethod[] GetCompressionMethods()
-		{
-			return new CompressionMethod[] { CompressionMethod.NULL };
-		}
+        public virtual byte[] GetCompressionMethods()
+        {
+            return new byte[] { CompressionMethod.NULL };
+        }
 
         public virtual void NotifySessionID(byte[] sessionID)
-		{
-			// Currently ignored 
-		}
+        {
+            // Currently ignored 
+        }
 
-        public virtual void NotifySelectedCipherSuite(CipherSuite selectedCipherSuite)
-		{
-			this.selectedCipherSuite = selectedCipherSuite;
-		}
+        public virtual void NotifySelectedCipherSuite(int selectedCipherSuite)
+        {
+            this.selectedCipherSuite = selectedCipherSuite;
+        }
 
-        public virtual void NotifySelectedCompressionMethod(CompressionMethod selectedCompressionMethod)
-		{
-			this.selectedCompressionMethod = selectedCompressionMethod;
-		}
+        public virtual void NotifySelectedCompressionMethod(byte selectedCompressionMethod)
+        {
+            this.selectedCompressionMethod = selectedCompressionMethod;
+        }
 
         public virtual void NotifySecureRenegotiation(bool secureRenegotiation)
-		{
-			if (!secureRenegotiation)
-			{
-				/*
-				 * RFC 5746 3.4. If the extension is not present, the server does not support
-				 * secure renegotiation; set secure_renegotiation flag to FALSE. In this case,
-				 * some clients may want to terminate the handshake instead of continuing; see
-				 * Section 4.1 for discussion.
-				 */
+        {
+            if (!secureRenegotiation)
+            {
+                /*
+                 * RFC 5746 3.4. If the extension is not present, the server does not support
+                 * secure renegotiation; set secure_renegotiation flag to FALSE. In this case,
+                 * some clients may want to terminate the handshake instead of continuing; see
+                 * Section 4.1 for discussion.
+                 */
 //				throw new TlsFatalAlert(AlertDescription.handshake_failure);
-			}
-		}
+            }
+        }
 
         public virtual void ProcessServerExtensions(IDictionary serverExtensions)
-		{
-		}
+        {
+        }
 
         public virtual TlsKeyExchange GetKeyExchange()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA:
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_PSK_WITH_RC4_128_SHA:
-					return CreatePskKeyExchange(KeyExchangeAlgorithm.PSK);
+                    return CreatePskKeyExchange(KeyExchangeAlgorithm.PSK);
 
                 case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA:
                     return CreatePskKeyExchange(KeyExchangeAlgorithm.RSA_PSK);
 
                 case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA:
                 case CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA:
                     return CreatePskKeyExchange(KeyExchangeAlgorithm.DHE_PSK);
 
                 default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected cipher suite was in the list of client-offered cipher
-					 * suites, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected cipher suite was in the list of client-offered cipher
+                     * suites, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
 
         public abstract TlsAuthentication GetAuthentication();
 
         public virtual TlsCompression GetCompression()
-		{
-			switch (selectedCompressionMethod)
-			{
-				case CompressionMethod.NULL:
-					return new TlsNullCompression();
+        {
+            switch (selectedCompressionMethod)
+            {
+                case CompressionMethod.NULL:
+                    return new TlsNullCompression();
 
                 default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected compression method was in the list of client-offered compression
-					 * methods, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected compression method was in the list of client-offered compression
+                     * methods, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
 
         public virtual TlsCipher GetCipher()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC,
-						DigestAlgorithm.SHA);
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC,
+                        DigestAlgorithm.SHA);
 
                 case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC,
-						DigestAlgorithm.SHA);
+                case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC,
+                        DigestAlgorithm.SHA);
 
                 case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC,
-						DigestAlgorithm.SHA);
+                case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC,
+                        DigestAlgorithm.SHA);
 
                 case CipherSuite.TLS_PSK_WITH_RC4_128_SHA:
                 case CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA:
@@ -173,19 +173,19 @@ namespace Org.BouncyCastle.Crypto.Tls
                         DigestAlgorithm.SHA);
 
                 default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected cipher suite was in the list of client-offered cipher
-					 * suites, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-        protected virtual TlsKeyExchange CreatePskKeyExchange(KeyExchangeAlgorithm keyExchange)
-		{
-			return new TlsPskKeyExchange(context, keyExchange, pskIdentity);
-		}
-	}
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected cipher suite was in the list of client-offered cipher
+                     * suites, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        protected virtual TlsKeyExchange CreatePskKeyExchange(int keyExchange)
+        {
+            return new TlsPskKeyExchange(context, keyExchange, pskIdentity);
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/RecordStream.cs b/crypto/src/crypto/tls/RecordStream.cs
index 4a5cdc1c9..ce8882cbe 100644
--- a/crypto/src/crypto/tls/RecordStream.cs
+++ b/crypto/src/crypto/tls/RecordStream.cs
@@ -45,21 +45,21 @@ namespace Org.BouncyCastle.Crypto.Tls
 
         public void ReadData()
         {
-            ContentType type = (ContentType)TlsUtilities.ReadUint8(inStr);
+            byte contentType = TlsUtilities.ReadUint8(inStr);
             TlsUtilities.CheckVersion(inStr);
             int size = TlsUtilities.ReadUint16(inStr);
-            byte[] buf = DecodeAndVerify(type, inStr, size);
-            handler.ProcessData(type, buf, 0, buf.Length);
+            byte[] buf = DecodeAndVerify(contentType, inStr, size);
+            handler.ProcessData(contentType, buf, 0, buf.Length);
         }
 
         internal byte[] DecodeAndVerify(
-            ContentType	type,
+            byte        contentType,
             Stream		inStr,
             int			len)
         {
             byte[] buf = new byte[len];
             TlsUtilities.ReadFully(buf, inStr);
-            byte[] decoded = readCipher.DecodeCiphertext(type, buf, 0, buf.Length);
+            byte[] decoded = readCipher.DecodeCiphertext(contentType, buf, 0, buf.Length);
 
             Stream cOut = readCompression.Decompress(buffer);
 
@@ -76,10 +76,10 @@ namespace Org.BouncyCastle.Crypto.Tls
         }
 
         internal void WriteMessage(
-            ContentType	type,
-            byte[]		message,
-            int			offset,
-            int			len)
+            byte    type,
+            byte[]  message,
+            int		offset,
+            int		len)
         {
             if (type == ContentType.handshake)
             {
diff --git a/crypto/src/crypto/tls/SignatureAlgorithm.cs b/crypto/src/crypto/tls/SignatureAlgorithm.cs
new file mode 100644
index 000000000..35b961762
--- /dev/null
+++ b/crypto/src/crypto/tls/SignatureAlgorithm.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Org.BouncyCastle.Crypto.Tls
+{
+    /**
+     * RFC 5246 7.4.1.4.1 (in RFC 2246, there were no specific values assigned)
+     */
+    public abstract class SignatureAlgorithm
+    {
+        public const byte anonymous = 0;
+        public const byte rsa = 1;
+        public const byte dsa = 2;
+        public const byte ecdsa = 3;
+    }
+}
diff --git a/crypto/src/crypto/tls/SignatureAndHashAlgorithm.cs b/crypto/src/crypto/tls/SignatureAndHashAlgorithm.cs
new file mode 100644
index 000000000..f74205b62
--- /dev/null
+++ b/crypto/src/crypto/tls/SignatureAndHashAlgorithm.cs
@@ -0,0 +1,94 @@
+using System;
+using System.IO;
+
+namespace Org.BouncyCastle.Crypto.Tls
+{
+    /**
+     * RFC 5246 7.4.1.4.1
+     */
+    public class SignatureAndHashAlgorithm
+    {
+        protected readonly byte mHash;
+        protected readonly byte mSignature;
+
+        /**
+         * @param hash      {@link HashAlgorithm}
+         * @param signature {@link SignatureAlgorithm}
+         */
+        public SignatureAndHashAlgorithm(byte hash, byte signature)
+        {
+            if (!TlsUtilities.IsValidUint8(hash))
+            {
+                throw new ArgumentException("should be a uint8", "hash");
+            }
+            if (!TlsUtilities.IsValidUint8(signature))
+            {
+                throw new ArgumentException("should be a uint8", "signature");
+            }
+            if (signature == SignatureAlgorithm.anonymous)
+            {
+                throw new ArgumentException("MUST NOT be \"anonymous\"", "signature");
+            }
+
+            this.mHash = hash;
+            this.mSignature = signature;
+        }
+
+        /**
+         * @return {@link HashAlgorithm}
+         */
+        public virtual byte Hash
+        {
+            get { return mHash; }
+        }
+
+        /**
+         * @return {@link SignatureAlgorithm}
+         */
+        public virtual byte Signature
+        {
+            get { return mSignature; }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is SignatureAndHashAlgorithm))
+            {
+                return false;
+            }
+            SignatureAndHashAlgorithm other = (SignatureAndHashAlgorithm)obj;
+            return other.Hash == Hash && other.Signature == Signature;
+        }
+
+        public override int GetHashCode()
+        {
+            return ((int)Hash << 16) | (int)Signature;
+        }
+
+        /**
+         * Encode this {@link SignatureAndHashAlgorithm} to a {@link Stream}.
+         *
+         * @param output the {@link Stream} to encode to.
+         * @throws IOException
+         */
+        public virtual void Encode(Stream output)
+        {
+            TlsUtilities.WriteUint8(Hash, output);
+            TlsUtilities.WriteUint8(Signature, output);
+        }
+
+        /**
+         * Parse a {@link SignatureAndHashAlgorithm} from a {@link Stream}.
+         *
+         * @param input the {@link Stream} to parse from.
+         * @return a {@link SignatureAndHashAlgorithm} object.
+         * @throws IOException
+         */
+        public static SignatureAndHashAlgorithm Parse(Stream input)
+        {
+            byte hash = TlsUtilities.ReadUint8(input);
+            byte signature = TlsUtilities.ReadUint8(input);
+            return new SignatureAndHashAlgorithm(hash, signature);
+        }
+    }
+}
diff --git a/crypto/src/crypto/tls/SrpTlsClient.cs b/crypto/src/crypto/tls/SrpTlsClient.cs
index 6c2638bb3..f9c8ccc74 100644
--- a/crypto/src/crypto/tls/SrpTlsClient.cs
+++ b/crypto/src/crypto/tls/SrpTlsClient.cs
@@ -6,183 +6,183 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public abstract class SrpTlsClient
-		: TlsClient
-	{
-		protected TlsCipherFactory cipherFactory;
-		protected byte[] identity;
-		protected byte[] password;
-
-		protected TlsClientContext context;
-
-        protected CompressionMethod selectedCompressionMethod;
-        protected CipherSuite selectedCipherSuite;
-
-		public SrpTlsClient(byte[] identity, byte[] password)
-			: this(new DefaultTlsCipherFactory(), identity, password)
-		{
-		}
-
-		public SrpTlsClient(TlsCipherFactory cipherFactory, byte[] identity, byte[] password)
-		{
-			this.cipherFactory = cipherFactory;
-			this.identity = Arrays.Clone(identity);
-			this.password = Arrays.Clone(password);
-		}
-
-		public virtual void Init(TlsClientContext context)
-		{
-			this.context = context;
-		}
-
-		public virtual CipherSuite[] GetCipherSuites()
-		{
-			return new CipherSuite[] {
-				CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA,
-				CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
-			};
-		}
-
-		public virtual IDictionary GetClientExtensions()
-		{
-			IDictionary clientExtensions = Platform.CreateHashtable();
-
-			MemoryStream srpData = new MemoryStream();
-			TlsUtilities.WriteOpaque8(this.identity, srpData);
-			clientExtensions[ExtensionType.srp] = srpData.ToArray();
-
-			return clientExtensions;
-		}
-
-		public virtual CompressionMethod[] GetCompressionMethods()
-		{
-			return new CompressionMethod[] { CompressionMethod.NULL };
-		}
-
-		public virtual void NotifySessionID(byte[] sessionID)
-		{
-			// Currently ignored 
-		}
-
-		public virtual void NotifySelectedCipherSuite(CipherSuite selectedCipherSuite)
-		{
-			this.selectedCipherSuite = selectedCipherSuite;
-		}
-
-		public virtual void NotifySelectedCompressionMethod(CompressionMethod selectedCompressionMethod)
-		{
+    public abstract class SrpTlsClient
+        : TlsClient
+    {
+        protected TlsCipherFactory cipherFactory;
+        protected byte[] identity;
+        protected byte[] password;
+
+        protected TlsClientContext context;
+
+        protected byte selectedCompressionMethod;
+        protected int selectedCipherSuite;
+
+        public SrpTlsClient(byte[] identity, byte[] password)
+            : this(new DefaultTlsCipherFactory(), identity, password)
+        {
+        }
+
+        public SrpTlsClient(TlsCipherFactory cipherFactory, byte[] identity, byte[] password)
+        {
+            this.cipherFactory = cipherFactory;
+            this.identity = Arrays.Clone(identity);
+            this.password = Arrays.Clone(password);
+        }
+
+        public virtual void Init(TlsClientContext context)
+        {
+            this.context = context;
+        }
+
+        public virtual int[] GetCipherSuites()
+        {
+            return new int[] {
+                CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA,
+                CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
+            };
+        }
+
+        public virtual IDictionary GetClientExtensions()
+        {
+            IDictionary clientExtensions = Platform.CreateHashtable();
+
+            MemoryStream srpData = new MemoryStream();
+            TlsUtilities.WriteOpaque8(this.identity, srpData);
+            clientExtensions[ExtensionType.srp] = srpData.ToArray();
+
+            return clientExtensions;
+        }
+
+        public virtual byte[] GetCompressionMethods()
+        {
+            return new byte[] { CompressionMethod.NULL };
+        }
+
+        public virtual void NotifySessionID(byte[] sessionID)
+        {
+            // Currently ignored 
+        }
+
+        public virtual void NotifySelectedCipherSuite(int selectedCipherSuite)
+        {
+            this.selectedCipherSuite = selectedCipherSuite;
+        }
+
+        public virtual void NotifySelectedCompressionMethod(byte selectedCompressionMethod)
+        {
             this.selectedCompressionMethod = selectedCompressionMethod;
         }
 
-		public virtual void NotifySecureRenegotiation(bool secureRenegotiation)
-		{
-			if (!secureRenegotiation)
-			{
-				/*
-				 * RFC 5746 3.4. If the extension is not present, the server does not support
-				 * secure renegotiation; set secure_renegotiation flag to FALSE. In this case,
-				 * some clients may want to terminate the handshake instead of continuing; see
-				 * Section 4.1 for discussion.
-				 */
+        public virtual void NotifySecureRenegotiation(bool secureRenegotiation)
+        {
+            if (!secureRenegotiation)
+            {
+                /*
+                 * RFC 5746 3.4. If the extension is not present, the server does not support
+                 * secure renegotiation; set secure_renegotiation flag to FALSE. In this case,
+                 * some clients may want to terminate the handshake instead of continuing; see
+                 * Section 4.1 for discussion.
+                 */
 //				throw new TlsFatalAlert(AlertDescription.handshake_failure);
-			}
-		}
-
-		public virtual void ProcessServerExtensions(IDictionary serverExtensions)
-		{
-			// There is no server response for the SRP extension
-		}
-
-		public virtual TlsKeyExchange GetKeyExchange()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA:
-					return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP);
-
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA:
-					return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP_RSA);
-
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA:
-					return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP_DSS);
-
-				default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected cipher suite was in the list of client-offered cipher
-					 * suites, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-		
-		public abstract TlsAuthentication GetAuthentication();
-
-		public virtual TlsCompression GetCompression()
-		{
-			switch (selectedCompressionMethod)
-			{
-				case CompressionMethod.NULL:
-					return new TlsNullCompression();
-
-				default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected compression method was in the list of client-offered compression
-					 * methods, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		public virtual TlsCipher GetCipher()
-		{
-			switch (selectedCipherSuite)
-			{
-				case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC, DigestAlgorithm.SHA);
-
-				case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC, DigestAlgorithm.SHA);
-
-				case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA:
-				case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA:
-					return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC, DigestAlgorithm.SHA);
-
-				default:
-					/*
-					 * Note: internal error here; the TlsProtocolHandler verifies that the
-					 * server-selected cipher suite was in the list of client-offered cipher
-					 * suites, so if we now can't produce an implementation, we shouldn't have
-					 * offered it!
-					 */
-					throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		protected virtual TlsKeyExchange CreateSrpKeyExchange(KeyExchangeAlgorithm keyExchange)
-		{
-			return new TlsSrpKeyExchange(context, keyExchange, identity, password);
-		}
-	}
+            }
+        }
+
+        public virtual void ProcessServerExtensions(IDictionary serverExtensions)
+        {
+            // There is no server response for the SRP extension
+        }
+
+        public virtual TlsKeyExchange GetKeyExchange()
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA:
+                    return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP);
+
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA:
+                    return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP_RSA);
+
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA:
+                    return CreateSrpKeyExchange(KeyExchangeAlgorithm.SRP_DSS);
+
+                default:
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected cipher suite was in the list of client-offered cipher
+                     * suites, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+        
+        public abstract TlsAuthentication GetAuthentication();
+
+        public virtual TlsCompression GetCompression()
+        {
+            switch (selectedCompressionMethod)
+            {
+                case CompressionMethod.NULL:
+                    return new TlsNullCompression();
+
+                default:
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected compression method was in the list of client-offered compression
+                     * methods, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        public virtual TlsCipher GetCipher()
+        {
+            switch (selectedCipherSuite)
+            {
+                case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.cls_3DES_EDE_CBC, DigestAlgorithm.SHA);
+
+                case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_128_CBC, DigestAlgorithm.SHA);
+
+                case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA:
+                case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA:
+                    return cipherFactory.CreateCipher(context, EncryptionAlgorithm.AES_256_CBC, DigestAlgorithm.SHA);
+
+                default:
+                    /*
+                     * Note: internal error here; the TlsProtocolHandler verifies that the
+                     * server-selected cipher suite was in the list of client-offered cipher
+                     * suites, so if we now can't produce an implementation, we shouldn't have
+                     * offered it!
+                     */
+                    throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        protected virtual TlsKeyExchange CreateSrpKeyExchange(int keyExchange)
+        {
+            return new TlsSrpKeyExchange(context, keyExchange, identity, password);
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsBlockCipher.cs b/crypto/src/crypto/tls/TlsBlockCipher.cs
index d77f118f4..cfbceb25e 100644
--- a/crypto/src/crypto/tls/TlsBlockCipher.cs
+++ b/crypto/src/crypto/tls/TlsBlockCipher.cs
@@ -9,13 +9,13 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// A generic TLS 1.0 block cipher. This can be used for AES or 3DES for example.
-	/// </summary>
-	public class TlsBlockCipher
+    /// <summary>
+    /// A generic TLS 1.0 block cipher. This can be used for AES or 3DES for example.
+    /// </summary>
+    public class TlsBlockCipher
         : TlsCipher
-	{
-		protected TlsClientContext context;
+    {
+        protected TlsClientContext context;
         protected byte[] randomData;
 
         protected IBlockCipher encryptCipher;
@@ -25,86 +25,86 @@ namespace Org.BouncyCastle.Crypto.Tls
         protected TlsMac rMac;
 
         public virtual TlsMac WriteMac
-		{
+        {
             get { return wMac; }
-		}
+        }
 
-		public virtual TlsMac ReadMac
-		{
+        public virtual TlsMac ReadMac
+        {
             get { return rMac; }
-		}
+        }
 
-		public TlsBlockCipher(TlsClientContext context, IBlockCipher encryptCipher,
-			IBlockCipher decryptCipher, IDigest writeDigest, IDigest readDigest, int cipherKeySize)
-		{
-			this.context = context;
+        public TlsBlockCipher(TlsClientContext context, IBlockCipher encryptCipher,
+            IBlockCipher decryptCipher, IDigest writeDigest, IDigest readDigest, int cipherKeySize)
+        {
+            this.context = context;
 
             this.randomData = new byte[256];
             context.SecureRandom.NextBytes(randomData);
 
             this.encryptCipher = encryptCipher;
-			this.decryptCipher = decryptCipher;
+            this.decryptCipher = decryptCipher;
 
-			int prfSize = (2 * cipherKeySize) + writeDigest.GetDigestSize()
-				+ readDigest.GetDigestSize() + encryptCipher.GetBlockSize()
-				+ decryptCipher.GetBlockSize();
+            int prfSize = (2 * cipherKeySize) + writeDigest.GetDigestSize()
+                + readDigest.GetDigestSize() + encryptCipher.GetBlockSize()
+                + decryptCipher.GetBlockSize();
 
-			SecurityParameters securityParameters = context.SecurityParameters;
+            SecurityParameters securityParameters = context.SecurityParameters;
 
-			byte[] keyBlock = TlsUtilities.PRF(securityParameters.masterSecret, "key expansion",
-				TlsUtilities.Concat(securityParameters.serverRandom, securityParameters.clientRandom),
-				prfSize);
+            byte[] keyBlock = TlsUtilities.PRF(securityParameters.masterSecret, "key expansion",
+                TlsUtilities.Concat(securityParameters.serverRandom, securityParameters.clientRandom),
+                prfSize);
 
-			int offset = 0;
+            int offset = 0;
 
-			// Init MACs
-			wMac = CreateTlsMac(writeDigest, keyBlock, ref offset);
+            // Init MACs
+            wMac = CreateTlsMac(writeDigest, keyBlock, ref offset);
             rMac = CreateTlsMac(readDigest, keyBlock, ref offset);
 
-			// Build keys
-			KeyParameter encryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
-			KeyParameter decryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
+            // Build keys
+            KeyParameter encryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
+            KeyParameter decryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
 
-			// Add IVs
-			ParametersWithIV encryptParams = CreateParametersWithIV(encryptKey,
-				keyBlock, ref offset, encryptCipher.GetBlockSize());
-			ParametersWithIV decryptParams = CreateParametersWithIV(decryptKey,
-				keyBlock, ref offset, decryptCipher.GetBlockSize());
+            // Add IVs
+            ParametersWithIV encryptParams = CreateParametersWithIV(encryptKey,
+                keyBlock, ref offset, encryptCipher.GetBlockSize());
+            ParametersWithIV decryptParams = CreateParametersWithIV(decryptKey,
+                keyBlock, ref offset, decryptCipher.GetBlockSize());
 
-			if (offset != prfSize)
-				throw new TlsFatalAlert(AlertDescription.internal_error);
+            if (offset != prfSize)
+                throw new TlsFatalAlert(AlertDescription.internal_error);
 
-			// Init Ciphers
-			encryptCipher.Init(true, encryptParams);
-			decryptCipher.Init(false, decryptParams);
-		}
+            // Init Ciphers
+            encryptCipher.Init(true, encryptParams);
+            decryptCipher.Init(false, decryptParams);
+        }
 
         protected virtual TlsMac CreateTlsMac(IDigest digest, byte[] buf, ref int off)
-		{
-			int len = digest.GetDigestSize();
-			TlsMac mac = new TlsMac(digest, buf, off, len);
-			off += len;
-			return mac;
-		}
+        {
+            int len = digest.GetDigestSize();
+            TlsMac mac = new TlsMac(digest, buf, off, len);
+            off += len;
+            return mac;
+        }
 
         protected virtual KeyParameter CreateKeyParameter(byte[] buf, ref int off, int len)
-		{
-			KeyParameter key = new KeyParameter(buf, off, len);
-			off += len;
-			return key;
-		}
+        {
+            KeyParameter key = new KeyParameter(buf, off, len);
+            off += len;
+            return key;
+        }
 
         protected virtual ParametersWithIV CreateParametersWithIV(KeyParameter key,
-			byte[] buf, ref int off, int len)
-		{
-			ParametersWithIV ivParams = new ParametersWithIV(key, buf, off, len);
-			off += len;
-			return ivParams;
-		}
-
-		public virtual byte[] EncodePlaintext(ContentType type, byte[] plaintext, int offset, int len)
-		{
-			int blocksize = encryptCipher.GetBlockSize();
+            byte[] buf, ref int off, int len)
+        {
+            ParametersWithIV ivParams = new ParametersWithIV(key, buf, off, len);
+            off += len;
+            return ivParams;
+        }
+
+        public virtual byte[] EncodePlaintext(byte type, byte[] plaintext, int offset, int len)
+        {
+            int blocksize = encryptCipher.GetBlockSize();
             int padding_length = blocksize - 1 - ((len + wMac.Size) % blocksize);
 
             //bool isTls = context.ServerVersion.FullVersion >= ProtocolVersion.TLSv10.FullVersion;
@@ -119,24 +119,24 @@ namespace Org.BouncyCastle.Crypto.Tls
             }
 
             int totalsize = len + wMac.Size + padding_length + 1;
-			byte[] outbuf = new byte[totalsize];
-			Array.Copy(plaintext, offset, outbuf, 0, len);
+            byte[] outbuf = new byte[totalsize];
+            Array.Copy(plaintext, offset, outbuf, 0, len);
             byte[] mac = wMac.CalculateMac(type, plaintext, offset, len);
-			Array.Copy(mac, 0, outbuf, len, mac.Length);
-			int paddoffset = len + mac.Length;
+            Array.Copy(mac, 0, outbuf, len, mac.Length);
+            int paddoffset = len + mac.Length;
             for (int i = 0; i <= padding_length; i++)
-			{
+            {
                 outbuf[i + paddoffset] = (byte)padding_length;
-			}
-			for (int i = 0; i < totalsize; i += blocksize)
-			{
-				encryptCipher.ProcessBlock(outbuf, i, outbuf, i);
-			}
-			return outbuf;
-		}
-
-        public virtual byte[] DecodeCiphertext(ContentType type, byte[] ciphertext, int offset, int len)
-		{
+            }
+            for (int i = 0; i < totalsize; i += blocksize)
+            {
+                encryptCipher.ProcessBlock(outbuf, i, outbuf, i);
+            }
+            return outbuf;
+        }
+
+        public virtual byte[] DecodeCiphertext(byte type, byte[] ciphertext, int offset, int len)
+        {
             int blockSize = decryptCipher.GetBlockSize();
             int macSize = rMac.Size;
 
@@ -173,7 +173,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                 throw new TlsFatalAlert(AlertDescription.bad_record_mac);
 
             return Arrays.Copy(ciphertext, offset, macInputLen);
-		}
+        }
 
         protected virtual int CheckPaddingConstantTime(byte[] buf, int off, int len, int blockSize, int macSize)
         {
@@ -224,28 +224,28 @@ namespace Org.BouncyCastle.Crypto.Tls
         }
 
         protected virtual int ChooseExtraPadBlocks(SecureRandom r, int max)
-		{
+        {
 //			return r.NextInt(max + 1);
 
-			uint x = (uint)r.NextInt();
-			int n = LowestBitSet(x);
-			return System.Math.Min(n, max);
-		}
+            uint x = (uint)r.NextInt();
+            int n = LowestBitSet(x);
+            return System.Math.Min(n, max);
+        }
 
         private int LowestBitSet(uint x)
-		{
-			if (x == 0)
-			{
-				return 32;
-			}
-
-			int n = 0;
-			while ((x & 1) == 0)
-			{
-				++n;
-				x >>= 1;
-			}
-			return n;
-		}
-	}
+        {
+            if (x == 0)
+            {
+                return 32;
+            }
+
+            int n = 0;
+            while ((x & 1) == 0)
+            {
+                ++n;
+                x >>= 1;
+            }
+            return n;
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsCipher.cs b/crypto/src/crypto/tls/TlsCipher.cs
index 22c769d82..a58f4943f 100644
--- a/crypto/src/crypto/tls/TlsCipher.cs
+++ b/crypto/src/crypto/tls/TlsCipher.cs
@@ -3,12 +3,12 @@ using System.IO;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public interface TlsCipher
-	{
-		/// <exception cref="IOException"></exception>
-		byte[] EncodePlaintext(ContentType type, byte[] plaintext, int offset, int len);
+    public interface TlsCipher
+    {
+        /// <exception cref="IOException"></exception>
+        byte[] EncodePlaintext(byte type, byte[] plaintext, int offset, int len);
 
-		/// <exception cref="IOException"></exception>
-		byte[] DecodeCiphertext(ContentType type, byte[] ciphertext, int offset, int len);
-	}
+        /// <exception cref="IOException"></exception>
+        byte[] DecodeCiphertext(byte type, byte[] ciphertext, int offset, int len);
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsCipherFactory.cs b/crypto/src/crypto/tls/TlsCipherFactory.cs
index 0756603f4..bd65f8b4b 100644
--- a/crypto/src/crypto/tls/TlsCipherFactory.cs
+++ b/crypto/src/crypto/tls/TlsCipherFactory.cs
@@ -3,10 +3,10 @@ using System.IO;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public interface TlsCipherFactory
-	{
-		/// <exception cref="IOException"></exception>
-		TlsCipher CreateCipher(TlsClientContext context, EncryptionAlgorithm encryptionAlgorithm,
-			DigestAlgorithm digestAlgorithm);
-	}
+    public interface TlsCipherFactory
+    {
+        /// <exception cref="IOException"></exception>
+        TlsCipher CreateCipher(TlsClientContext context, int encryptionAlgorithm,
+            DigestAlgorithm digestAlgorithm);
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsClient.cs b/crypto/src/crypto/tls/TlsClient.cs
index eceaa3cd3..9e7937c94 100644
--- a/crypto/src/crypto/tls/TlsClient.cs
+++ b/crypto/src/crypto/tls/TlsClient.cs
@@ -4,60 +4,60 @@ using System.IO;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public interface TlsClient
-	{
-		/// <summary>
-		/// Called at the start of a new TLS session, before any other methods.
-		/// </summary>
-		/// <param name="context">
-		/// A <see cref="TlsProtocolHandler"/>
-		/// </param>
-		void Init(TlsClientContext context);
+    public interface TlsClient
+    {
+        /// <summary>
+        /// Called at the start of a new TLS session, before any other methods.
+        /// </summary>
+        /// <param name="context">
+        /// A <see cref="TlsProtocolHandler"/>
+        /// </param>
+        void Init(TlsClientContext context);
 
-		/// <summary>
-		/// Get the list of cipher suites that this client supports.
-		/// </summary>
-		/// <returns>
-        /// An array of <see cref="CipherSuite"/>, each specifying a supported cipher suite.
-		/// </returns>
-		CipherSuite[] GetCipherSuites();
+        /// <summary>
+        /// Get the list of cipher suites that this client supports.
+        /// </summary>
+        /// <returns>
+        /// An array of <see cref="CipherSuite"/> values, each specifying a supported cipher suite.
+        /// </returns>
+        int[] GetCipherSuites();
 
         /// <summary>
         /// Get the list of compression methods that this client supports.
         /// </summary>
         /// <returns>
-        /// An array of <see cref="CompressionMethod"/>, each specifying a supported compression method.
+        /// An array of <see cref="CompressionMethod"/> values, each specifying a supported compression method.
         /// </returns>
-        CompressionMethod[] GetCompressionMethods();
+        byte[] GetCompressionMethods();
 
-		/// <summary>
-		/// Get the (optional) table of client extensions to be included in (extended) client hello.
-		/// </summary>
-		/// <returns>
-        /// A <see cref="IDictionary"/> (<see cref="ExtensionType"/> -> byte[]). May be null.
-		/// </returns>
-		/// <exception cref="IOException"></exception>
-		IDictionary GetClientExtensions();
+        /// <summary>
+        /// Get the (optional) table of client extensions to be included in (extended) client hello.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="IDictionary"/> (Int32 -> byte[]). May be null.
+        /// </returns>
+        /// <exception cref="IOException"></exception>
+        IDictionary GetClientExtensions();
 
-		/// <summary>
-		/// Reports the session ID once it has been determined.
-		/// </summary>
-		/// <param name="sessionID">
-		/// A <see cref="System.Byte"/>
-		/// </param>
-		void NotifySessionID(byte[] sessionID);
+        /// <summary>
+        /// Reports the session ID once it has been determined.
+        /// </summary>
+        /// <param name="sessionID">
+        /// A <see cref="System.Byte"/>
+        /// </param>
+        void NotifySessionID(byte[] sessionID);
 
-		/// <summary>
-		/// Report the cipher suite that was selected by the server.
-		/// </summary>
-		/// <remarks>
-		/// The protocol handler validates this value against the offered cipher suites
-		/// <seealso cref="GetCipherSuites"/>
-		/// </remarks>
-		/// <param name="selectedCipherSuite">
-		/// A <see cref="CipherSuite"/>
-		/// </param>
-		void NotifySelectedCipherSuite(CipherSuite selectedCipherSuite);
+        /// <summary>
+        /// Report the cipher suite that was selected by the server.
+        /// </summary>
+        /// <remarks>
+        /// The protocol handler validates this value against the offered cipher suites
+        /// <seealso cref="GetCipherSuites"/>
+        /// </remarks>
+        /// <param name="selectedCipherSuite">
+        /// A <see cref="CipherSuite"/>
+        /// </param>
+        void NotifySelectedCipherSuite(int selectedCipherSuite);
 
         /// <summary>
         /// Report the compression method that was selected by the server.
@@ -69,61 +69,61 @@ namespace Org.BouncyCastle.Crypto.Tls
         /// <param name="selectedCompressionMethod">
         /// A <see cref="CompressionMethod"/>
         /// </param>
-        void NotifySelectedCompressionMethod(CompressionMethod selectedCompressionMethod);
+        void NotifySelectedCompressionMethod(byte selectedCompressionMethod);
 
-		/// <summary>
-		/// Report whether the server supports secure renegotiation
-		/// </summary>
-		/// <remarks>
-		/// The protocol handler automatically processes the relevant extensions
-		/// </remarks>
-		/// <param name="secureRenegotiation">
-		/// A <see cref="System.Boolean"/>, true if the server supports secure renegotiation
-		/// </param>
-		/// <exception cref="IOException"></exception>
-		void NotifySecureRenegotiation(bool secureRenegotiation);
+        /// <summary>
+        /// Report whether the server supports secure renegotiation
+        /// </summary>
+        /// <remarks>
+        /// The protocol handler automatically processes the relevant extensions
+        /// </remarks>
+        /// <param name="secureRenegotiation">
+        /// A <see cref="System.Boolean"/>, true if the server supports secure renegotiation
+        /// </param>
+        /// <exception cref="IOException"></exception>
+        void NotifySecureRenegotiation(bool secureRenegotiation);
 
-		/// <summary>
-		/// Report the extensions from an extended server hello.
-		/// </summary>
-		/// <remarks>
-		/// Will only be called if we returned a non-null result from <see cref="GetClientExtensions"/>.
-		/// </remarks>
-		/// <param name="serverExtensions">
-        /// A <see cref="IDictionary"/>  (<see cref="ExtensionType"/> -> byte[])
-		/// </param>
-		void ProcessServerExtensions(IDictionary serverExtensions);
+        /// <summary>
+        /// Report the extensions from an extended server hello.
+        /// </summary>
+        /// <remarks>
+        /// Will only be called if we returned a non-null result from <see cref="GetClientExtensions"/>.
+        /// </remarks>
+        /// <param name="serverExtensions">
+        /// A <see cref="IDictionary"/>  (Int32 -> byte[])
+        /// </param>
+        void ProcessServerExtensions(IDictionary serverExtensions);
 
-		/// <summary>
-		/// Return an implementation of <see cref="TlsKeyExchange"/> to negotiate the key exchange
-		/// part of the protocol.
-		/// </summary>
-		/// <returns>
-		/// A <see cref="TlsKeyExchange"/>
-		/// </returns>
-		/// <exception cref="IOException"/>
-		TlsKeyExchange GetKeyExchange();
+        /// <summary>
+        /// Return an implementation of <see cref="TlsKeyExchange"/> to negotiate the key exchange
+        /// part of the protocol.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="TlsKeyExchange"/>
+        /// </returns>
+        /// <exception cref="IOException"/>
+        TlsKeyExchange GetKeyExchange();
 
-		/// <summary>
-		/// Return an implementation of <see cref="TlsAuthentication"/> to handle authentication
-		/// part of the protocol.
-		/// </summary>
-		/// <exception cref="IOException"/>
-		TlsAuthentication GetAuthentication();
+        /// <summary>
+        /// Return an implementation of <see cref="TlsAuthentication"/> to handle authentication
+        /// part of the protocol.
+        /// </summary>
+        /// <exception cref="IOException"/>
+        TlsAuthentication GetAuthentication();
 
-		/// <summary>
-		/// Return an implementation of <see cref="TlsCompression"/> to handle record compression.
-		/// </summary>
-		/// <exception cref="IOException"/>
-		TlsCompression GetCompression();
+        /// <summary>
+        /// Return an implementation of <see cref="TlsCompression"/> to handle record compression.
+        /// </summary>
+        /// <exception cref="IOException"/>
+        TlsCompression GetCompression();
 
-		/// <summary>
-		/// Return an implementation of <see cref="TlsCipher"/> to use for encryption/decryption.
-		/// </summary>
-		/// <returns>
-		/// A <see cref="TlsCipher"/>
-		/// </returns>
-		/// <exception cref="IOException"/>
-		TlsCipher GetCipher();
-	}
+        /// <summary>
+        /// Return an implementation of <see cref="TlsCipher"/> to use for encryption/decryption.
+        /// </summary>
+        /// <returns>
+        /// A <see cref="TlsCipher"/>
+        /// </returns>
+        /// <exception cref="IOException"/>
+        TlsCipher GetCipher();
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsDHKeyExchange.cs b/crypto/src/crypto/tls/TlsDHKeyExchange.cs
index 40ac416e0..26d76fd3d 100644
--- a/crypto/src/crypto/tls/TlsDHKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsDHKeyExchange.cs
@@ -9,193 +9,193 @@ using Org.BouncyCastle.Security;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// TLS 1.0 DH key exchange.
-	/// </summary>
-	internal class TlsDHKeyExchange
-		: TlsKeyExchange
-	{
-		protected TlsClientContext context;
-		protected KeyExchangeAlgorithm keyExchange;
-		protected TlsSigner tlsSigner;
-
-		protected AsymmetricKeyParameter serverPublicKey = null;
-		protected DHPublicKeyParameters dhAgreeServerPublicKey = null;
-		protected TlsAgreementCredentials agreementCredentials;
-		protected DHPrivateKeyParameters dhAgreeClientPrivateKey = null;
-
-		internal TlsDHKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange)
-		{
-			switch (keyExchange)
-			{
-				case KeyExchangeAlgorithm.DH_RSA:
-				case KeyExchangeAlgorithm.DH_DSS:
-					this.tlsSigner = null;
-					break;
-				case KeyExchangeAlgorithm.DHE_RSA:
-					this.tlsSigner = new TlsRsaSigner();
-					break;
-				case KeyExchangeAlgorithm.DHE_DSS:
-					this.tlsSigner = new TlsDssSigner();
-					break;
-				default:
-					throw new ArgumentException("unsupported key exchange algorithm", "keyExchange");
-			}
-
-			this.context = context;
-			this.keyExchange = keyExchange;
-		}
-
-		public virtual void SkipServerCertificate()
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public virtual void ProcessServerCertificate(Certificate serverCertificate)
-		{
-			X509CertificateStructure x509Cert = serverCertificate.certs[0];
-			SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
-
-			try
-			{
-				this.serverPublicKey = PublicKeyFactory.CreateKey(keyInfo);
-			}
-			catch (Exception)
-			{
-				throw new TlsFatalAlert(AlertDescription.unsupported_certificate);
-			}
-
-			if (tlsSigner == null)
-			{
-				try
-				{
-					this.dhAgreeServerPublicKey = ValidateDHPublicKey((DHPublicKeyParameters)this.serverPublicKey);
-				}
-				catch (InvalidCastException)
-				{
-					throw new TlsFatalAlert(AlertDescription.certificate_unknown);
-				}
-
-				TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyAgreement);
-			}
-			else
-			{
-				if (!tlsSigner.IsValidPublicKey(this.serverPublicKey))
-				{
-					throw new TlsFatalAlert(AlertDescription.certificate_unknown);
-				}
-
-				TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature);
-			}
-
-			// TODO
-			/*
-			* Perform various checks per RFC2246 7.4.2: "Unless otherwise specified, the
-			* signing algorithm for the certificate must be the same as the algorithm for the
-			* certificate key."
-			*/
-		}
-
-		public virtual void SkipServerKeyExchange()
-		{
-			// OK
-		}
-
-		public virtual void ProcessServerKeyExchange(Stream input)
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
-		{
-			ClientCertificateType[] types = certificateRequest.CertificateTypes;
-			foreach (ClientCertificateType type in types)
-			{
-				switch (type)
-				{
-					case ClientCertificateType.rsa_sign:
-					case ClientCertificateType.dss_sign:
-					case ClientCertificateType.rsa_fixed_dh:
-					case ClientCertificateType.dss_fixed_dh:
-					case ClientCertificateType.ecdsa_sign:
-						break;
-					default:
-						throw new TlsFatalAlert(AlertDescription.illegal_parameter);
-				}
-			}
-		}
-
-		public virtual void SkipClientCredentials()
-		{
-			this.agreementCredentials = null;
-		}
-
-		public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
-		{
-			if (clientCredentials is TlsAgreementCredentials)
-			{
-				// TODO Validate client cert has matching parameters (see 'areCompatibleParameters')?
-
-				this.agreementCredentials = (TlsAgreementCredentials)clientCredentials;
-			}
-			else if (clientCredentials is TlsSignerCredentials)
-			{
-				// OK
-			}
-			else
-			{
-				throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-
-		public virtual void GenerateClientKeyExchange(Stream output)
-		{
-			/*
-			 * RFC 2246 7.4.7.2 If the client certificate already contains a suitable
-			 * Diffie-Hellman key, then Yc is implicit and does not need to be sent again. In
-			 * this case, the Client Key Exchange message will be sent, but will be empty.
-			 */
-			if (agreementCredentials == null)
-			{
-				GenerateEphemeralClientKeyExchange(dhAgreeServerPublicKey.Parameters, output);
-			}
-		}
+    /// <summary>
+    /// TLS 1.0 DH key exchange.
+    /// </summary>
+    internal class TlsDHKeyExchange
+        : TlsKeyExchange
+    {
+        protected TlsClientContext context;
+        protected int keyExchange;
+        protected TlsSigner tlsSigner;
+
+        protected AsymmetricKeyParameter serverPublicKey = null;
+        protected DHPublicKeyParameters dhAgreeServerPublicKey = null;
+        protected TlsAgreementCredentials agreementCredentials;
+        protected DHPrivateKeyParameters dhAgreeClientPrivateKey = null;
+
+        internal TlsDHKeyExchange(TlsClientContext context, int keyExchange)
+        {
+            switch (keyExchange)
+            {
+                case KeyExchangeAlgorithm.DH_RSA:
+                case KeyExchangeAlgorithm.DH_DSS:
+                    this.tlsSigner = null;
+                    break;
+                case KeyExchangeAlgorithm.DHE_RSA:
+                    this.tlsSigner = new TlsRsaSigner();
+                    break;
+                case KeyExchangeAlgorithm.DHE_DSS:
+                    this.tlsSigner = new TlsDssSigner();
+                    break;
+                default:
+                    throw new ArgumentException("unsupported key exchange algorithm", "keyExchange");
+            }
+
+            this.context = context;
+            this.keyExchange = keyExchange;
+        }
+
+        public virtual void SkipServerCertificate()
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public virtual void ProcessServerCertificate(Certificate serverCertificate)
+        {
+            X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0);
+            SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
+
+            try
+            {
+                this.serverPublicKey = PublicKeyFactory.CreateKey(keyInfo);
+            }
+            catch (Exception)
+            {
+                throw new TlsFatalAlert(AlertDescription.unsupported_certificate);
+            }
+
+            if (tlsSigner == null)
+            {
+                try
+                {
+                    this.dhAgreeServerPublicKey = ValidateDHPublicKey((DHPublicKeyParameters)this.serverPublicKey);
+                }
+                catch (InvalidCastException)
+                {
+                    throw new TlsFatalAlert(AlertDescription.certificate_unknown);
+                }
+
+                TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyAgreement);
+            }
+            else
+            {
+                if (!tlsSigner.IsValidPublicKey(this.serverPublicKey))
+                {
+                    throw new TlsFatalAlert(AlertDescription.certificate_unknown);
+                }
+
+                TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature);
+            }
+
+            // TODO
+            /*
+            * Perform various checks per RFC2246 7.4.2: "Unless otherwise specified, the
+            * signing algorithm for the certificate must be the same as the algorithm for the
+            * certificate key."
+            */
+        }
+
+        public virtual void SkipServerKeyExchange()
+        {
+            // OK
+        }
+
+        public virtual void ProcessServerKeyExchange(Stream input)
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
+        {
+            byte[] types = certificateRequest.CertificateTypes;
+            foreach (byte type in types)
+            {
+                switch (type)
+                {
+                    case ClientCertificateType.rsa_sign:
+                    case ClientCertificateType.dss_sign:
+                    case ClientCertificateType.rsa_fixed_dh:
+                    case ClientCertificateType.dss_fixed_dh:
+                    case ClientCertificateType.ecdsa_sign:
+                        break;
+                    default:
+                        throw new TlsFatalAlert(AlertDescription.illegal_parameter);
+                }
+            }
+        }
+
+        public virtual void SkipClientCredentials()
+        {
+            this.agreementCredentials = null;
+        }
+
+        public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
+        {
+            if (clientCredentials is TlsAgreementCredentials)
+            {
+                // TODO Validate client cert has matching parameters (see 'areCompatibleParameters')?
+
+                this.agreementCredentials = (TlsAgreementCredentials)clientCredentials;
+            }
+            else if (clientCredentials is TlsSignerCredentials)
+            {
+                // OK
+            }
+            else
+            {
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+
+        public virtual void GenerateClientKeyExchange(Stream output)
+        {
+            /*
+             * RFC 2246 7.4.7.2 If the client certificate already contains a suitable
+             * Diffie-Hellman key, then Yc is implicit and does not need to be sent again. In
+             * this case, the Client Key Exchange message will be sent, but will be empty.
+             */
+            if (agreementCredentials == null)
+            {
+                GenerateEphemeralClientKeyExchange(dhAgreeServerPublicKey.Parameters, output);
+            }
+        }
 
         public virtual byte[] GeneratePremasterSecret()
-		{
-			if (agreementCredentials != null)
-			{
-				return agreementCredentials.GenerateAgreement(dhAgreeServerPublicKey);
-			}
-
-			return CalculateDHBasicAgreement(dhAgreeServerPublicKey, dhAgreeClientPrivateKey);
-		}
-		
-		protected virtual bool AreCompatibleParameters(DHParameters a, DHParameters b)
-		{
-			return a.P.Equals(b.P) && a.G.Equals(b.G);
-		}
-
-		protected virtual byte[] CalculateDHBasicAgreement(DHPublicKeyParameters publicKey,
-			DHPrivateKeyParameters privateKey)
-		{
-			return TlsDHUtilities.CalculateDHBasicAgreement(publicKey, privateKey);
-		}
-
-		protected virtual AsymmetricCipherKeyPair GenerateDHKeyPair(DHParameters dhParams)
-		{
-			return TlsDHUtilities.GenerateDHKeyPair(context.SecureRandom, dhParams);
-		}
-
-		protected virtual void GenerateEphemeralClientKeyExchange(DHParameters dhParams, Stream output)
-		{
-			this.dhAgreeClientPrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(
-				context.SecureRandom, dhParams, output);
-		}
-
-		protected virtual DHPublicKeyParameters ValidateDHPublicKey(DHPublicKeyParameters key)
-		{
-			return TlsDHUtilities.ValidateDHPublicKey(key);
-		}
-	}
+        {
+            if (agreementCredentials != null)
+            {
+                return agreementCredentials.GenerateAgreement(dhAgreeServerPublicKey);
+            }
+
+            return CalculateDHBasicAgreement(dhAgreeServerPublicKey, dhAgreeClientPrivateKey);
+        }
+        
+        protected virtual bool AreCompatibleParameters(DHParameters a, DHParameters b)
+        {
+            return a.P.Equals(b.P) && a.G.Equals(b.G);
+        }
+
+        protected virtual byte[] CalculateDHBasicAgreement(DHPublicKeyParameters publicKey,
+            DHPrivateKeyParameters privateKey)
+        {
+            return TlsDHUtilities.CalculateDHBasicAgreement(publicKey, privateKey);
+        }
+
+        protected virtual AsymmetricCipherKeyPair GenerateDHKeyPair(DHParameters dhParams)
+        {
+            return TlsDHUtilities.GenerateDHKeyPair(context.SecureRandom, dhParams);
+        }
+
+        protected virtual void GenerateEphemeralClientKeyExchange(DHParameters dhParams, Stream output)
+        {
+            this.dhAgreeClientPrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(
+                context.SecureRandom, dhParams, output);
+        }
+
+        protected virtual DHPublicKeyParameters ValidateDHPublicKey(DHPublicKeyParameters key)
+        {
+            return TlsDHUtilities.ValidateDHPublicKey(key);
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsDheKeyExchange.cs b/crypto/src/crypto/tls/TlsDheKeyExchange.cs
index 725cc1bf3..ee6d6eb44 100644
--- a/crypto/src/crypto/tls/TlsDheKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsDheKeyExchange.cs
@@ -7,50 +7,50 @@ using Org.BouncyCastle.Math;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	internal class TlsDheKeyExchange
-		: TlsDHKeyExchange
-	{
-		internal TlsDheKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange)
-			: base(context, keyExchange)
-		{
-		}
-
-		public override void SkipServerKeyExchange()
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public override void ProcessServerKeyExchange(Stream input)
-		{
-			SecurityParameters securityParameters = context.SecurityParameters;
-
-			ISigner signer = InitSigner(tlsSigner, securityParameters);
-			Stream sigIn = new SignerStream(input, signer, null);
-
-			byte[] pBytes = TlsUtilities.ReadOpaque16(sigIn);
-			byte[] gBytes = TlsUtilities.ReadOpaque16(sigIn);
-			byte[] YsBytes = TlsUtilities.ReadOpaque16(sigIn);
-
-			byte[] sigByte = TlsUtilities.ReadOpaque16(input);
-			if (!signer.VerifySignature(sigByte))
-			{
+    internal class TlsDheKeyExchange
+        : TlsDHKeyExchange
+    {
+        internal TlsDheKeyExchange(TlsClientContext context, int keyExchange)
+            : base(context, keyExchange)
+        {
+        }
+
+        public override void SkipServerKeyExchange()
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public override void ProcessServerKeyExchange(Stream input)
+        {
+            SecurityParameters securityParameters = context.SecurityParameters;
+
+            ISigner signer = InitSigner(tlsSigner, securityParameters);
+            Stream sigIn = new SignerStream(input, signer, null);
+
+            byte[] pBytes = TlsUtilities.ReadOpaque16(sigIn);
+            byte[] gBytes = TlsUtilities.ReadOpaque16(sigIn);
+            byte[] YsBytes = TlsUtilities.ReadOpaque16(sigIn);
+
+            byte[] sigByte = TlsUtilities.ReadOpaque16(input);
+            if (!signer.VerifySignature(sigByte))
+            {
                 throw new TlsFatalAlert(AlertDescription.decrypt_error);
-			}
-
-			BigInteger p = new BigInteger(1, pBytes);
-			BigInteger g = new BigInteger(1, gBytes);
-			BigInteger Ys = new BigInteger(1, YsBytes);
-
-			this.dhAgreeServerPublicKey = ValidateDHPublicKey(
-				new DHPublicKeyParameters(Ys, new DHParameters(p, g)));
-		}
-
-		protected virtual ISigner InitSigner(TlsSigner tlsSigner, SecurityParameters securityParameters)
-		{
-			ISigner signer = tlsSigner.CreateVerifyer(this.serverPublicKey);
-			signer.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length);
-			signer.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length);
-			return signer;
-		}
-	}
+            }
+
+            BigInteger p = new BigInteger(1, pBytes);
+            BigInteger g = new BigInteger(1, gBytes);
+            BigInteger Ys = new BigInteger(1, YsBytes);
+
+            this.dhAgreeServerPublicKey = ValidateDHPublicKey(
+                new DHPublicKeyParameters(Ys, new DHParameters(p, g)));
+        }
+
+        protected virtual ISigner InitSigner(TlsSigner tlsSigner, SecurityParameters securityParameters)
+        {
+            ISigner signer = tlsSigner.CreateVerifyer(this.serverPublicKey);
+            signer.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length);
+            signer.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length);
+            return signer;
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsECDHKeyExchange.cs b/crypto/src/crypto/tls/TlsECDHKeyExchange.cs
index 36155346a..65d07a10c 100644
--- a/crypto/src/crypto/tls/TlsECDHKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsECDHKeyExchange.cs
@@ -19,7 +19,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         : TlsKeyExchange
     {
         protected TlsClientContext context;
-        protected KeyExchangeAlgorithm keyExchange;
+        protected int keyExchange;
         protected TlsSigner tlsSigner;
 
         protected AsymmetricKeyParameter serverPublicKey;
@@ -27,7 +27,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         protected TlsAgreementCredentials agreementCredentials;
         protected ECPrivateKeyParameters ecAgreeClientPrivateKey = null;
 
-        internal TlsECDHKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange)
+        internal TlsECDHKeyExchange(TlsClientContext context, int keyExchange)
         {
             switch (keyExchange)
             {
@@ -56,7 +56,7 @@ namespace Org.BouncyCastle.Crypto.Tls
 
         public virtual void ProcessServerCertificate(Certificate serverCertificate)
         {
-            X509CertificateStructure x509Cert = serverCertificate.certs[0];
+            X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0);
             SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
 
             try
@@ -117,8 +117,8 @@ namespace Org.BouncyCastle.Crypto.Tls
              * prohibited because the use of a long-term ECDH client key would jeopardize the
              * forward secrecy property of these algorithms.
              */
-            ClientCertificateType[] types = certificateRequest.CertificateTypes;
-            foreach (ClientCertificateType type in types)
+            byte[] types = certificateRequest.CertificateTypes;
+            foreach (byte type in types)
             {
                 switch (type)
                 {
diff --git a/crypto/src/crypto/tls/TlsECDheKeyExchange.cs b/crypto/src/crypto/tls/TlsECDheKeyExchange.cs
index 071d06b91..a671ebfbe 100644
--- a/crypto/src/crypto/tls/TlsECDheKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsECDheKeyExchange.cs
@@ -13,7 +13,7 @@ namespace Org.BouncyCastle.Crypto.Tls
     */
     internal class TlsECDheKeyExchange : TlsECDHKeyExchange
     {
-        internal TlsECDheKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange)
+        internal TlsECDheKeyExchange(TlsClientContext context, int keyExchange)
             : base(context, keyExchange)
         {
         }
@@ -30,13 +30,13 @@ namespace Org.BouncyCastle.Crypto.Tls
             ISigner signer = InitSigner(tlsSigner, securityParameters);
             Stream sigIn = new SignerStream(input, signer, null);
 
-            ECCurveType curveType = (ECCurveType)TlsUtilities.ReadUint8(sigIn);
+            byte curveType = TlsUtilities.ReadUint8(sigIn);
             ECDomainParameters curve_params;
 
             //  Currently, we only support named curves
             if (curveType == ECCurveType.named_curve)
             {
-                NamedCurve namedCurve = (NamedCurve)TlsUtilities.ReadUint16(sigIn);
+                int namedCurve = TlsUtilities.ReadUint16(sigIn);
 
                 // TODO Check namedCurve is one we offered?
 
@@ -72,8 +72,8 @@ namespace Org.BouncyCastle.Crypto.Tls
              * prohibited because the use of a long-term ECDH client key would jeopardize the
              * forward secrecy property of these algorithms.
              */
-            ClientCertificateType[] types = certificateRequest.CertificateTypes;
-            foreach (ClientCertificateType type in types)
+            byte[] types = certificateRequest.CertificateTypes;
+            foreach (byte type in types)
             {
                 switch (type)
                 {
diff --git a/crypto/src/crypto/tls/TlsException.cs b/crypto/src/crypto/tls/TlsException.cs
deleted file mode 100644
index 59c129105..000000000
--- a/crypto/src/crypto/tls/TlsException.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Crypto.Tls
-{
-#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT)
-    [Serializable]
-#endif
-    public class TlsException : Exception
-	{
-		public TlsException() : base() { }
-		public TlsException(string message) : base(message) { }
-		public TlsException(string message, Exception exception) : base(message, exception) { }
-	}
-}
diff --git a/crypto/src/crypto/tls/TlsFatalAlert.cs b/crypto/src/crypto/tls/TlsFatalAlert.cs
index 0a9cc6f3a..4fb2a41bd 100644
--- a/crypto/src/crypto/tls/TlsFatalAlert.cs
+++ b/crypto/src/crypto/tls/TlsFatalAlert.cs
@@ -3,19 +3,19 @@ using System.IO;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	public class TlsFatalAlert
-		: IOException
-	{
-		private readonly AlertDescription alertDescription;
+    public class TlsFatalAlert
+        : IOException
+    {
+        private readonly byte alertDescription;
 
-		public TlsFatalAlert(AlertDescription alertDescription)
-		{
-			this.alertDescription = alertDescription;
-		}
+        public TlsFatalAlert(byte alertDescription)
+        {
+            this.alertDescription = alertDescription;
+        }
 
-		public AlertDescription AlertDescription
-		{
-			get { return alertDescription; }
-		}
-	}
+        public virtual byte AlertDescription
+        {
+            get { return alertDescription; }
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsMac.cs b/crypto/src/crypto/tls/TlsMac.cs
index 862c887ad..e4313617e 100644
--- a/crypto/src/crypto/tls/TlsMac.cs
+++ b/crypto/src/crypto/tls/TlsMac.cs
@@ -9,103 +9,103 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <remarks>
-	/// A generic TLS MAC implementation, which can be used with any kind of
-	/// IDigest to act as an HMAC.
-	/// </remarks>
-	public class TlsMac
-	{
-		protected long seqNo;
-		protected byte[] secret;
-		protected HMac mac;
-
-		/**
-		* Generate a new instance of an TlsMac.
-		*
-		* @param digest    The digest to use.
-		* @param key_block A byte-array where the key for this mac is located.
-		* @param offset    The number of bytes to skip, before the key starts in the buffer.
-		* @param len       The length of the key.
-		*/
-		public TlsMac(
-			IDigest	digest,
-			byte[]	key_block,
-			int		offset,
-			int		len)
-		{
-			this.seqNo = 0;
-
-			KeyParameter param = new KeyParameter(key_block, offset, len);
-
-			this.secret = Arrays.Clone(param.GetKey());
-
-			this.mac = new HMac(digest);
-			this.mac.Init(param);
-		}
-
-		/**
-		 * @return the MAC write secret
-		 */
-		public virtual byte[] GetMacSecret()
-		{
-			return this.secret;
-		}
-
-		/**
-		 * @return the current write sequence number
-		 */
-		public virtual long SequenceNumber
-		{
-			get { return this.seqNo; }
-		}
-
-		/**
-		 * Increment the current write sequence number
-		 */
-		public virtual void IncSequenceNumber()
-		{
-			this.seqNo++;
-		}
-
-		/**
-		* @return The Keysize of the mac.
-		*/
-		public virtual int Size
-		{
-			get { return mac.GetMacSize(); }
-		}
-
-		/**
-		* Calculate the mac for some given data.
-		* <p/>
-		* TlsMac will keep track of the sequence number internally.
-		*
-		* @param type    The message type of the message.
-		* @param message A byte-buffer containing the message.
-		* @param offset  The number of bytes to skip, before the message starts.
-		* @param len     The length of the message.
-		* @return A new byte-buffer containing the mac value.
-		*/
-		public virtual byte[] CalculateMac(ContentType type, byte[] message, int offset, int len)
-		{
+    /// <remarks>
+    /// A generic TLS MAC implementation, which can be used with any kind of
+    /// IDigest to act as an HMAC.
+    /// </remarks>
+    public class TlsMac
+    {
+        protected long seqNo;
+        protected byte[] secret;
+        protected HMac mac;
+
+        /**
+        * Generate a new instance of an TlsMac.
+        *
+        * @param digest    The digest to use.
+        * @param key_block A byte-array where the key for this mac is located.
+        * @param offset    The number of bytes to skip, before the key starts in the buffer.
+        * @param len       The length of the key.
+        */
+        public TlsMac(
+            IDigest	digest,
+            byte[]	key_block,
+            int		offset,
+            int		len)
+        {
+            this.seqNo = 0;
+
+            KeyParameter param = new KeyParameter(key_block, offset, len);
+
+            this.secret = Arrays.Clone(param.GetKey());
+
+            this.mac = new HMac(digest);
+            this.mac.Init(param);
+        }
+
+        /**
+         * @return the MAC write secret
+         */
+        public virtual byte[] GetMacSecret()
+        {
+            return this.secret;
+        }
+
+        /**
+         * @return the current write sequence number
+         */
+        public virtual long SequenceNumber
+        {
+            get { return this.seqNo; }
+        }
+
+        /**
+         * Increment the current write sequence number
+         */
+        public virtual void IncSequenceNumber()
+        {
+            this.seqNo++;
+        }
+
+        /**
+        * @return The Keysize of the mac.
+        */
+        public virtual int Size
+        {
+            get { return mac.GetMacSize(); }
+        }
+
+        /**
+        * Calculate the mac for some given data.
+        * <p/>
+        * TlsMac will keep track of the sequence number internally.
+        *
+        * @param type    The message type of the message.
+        * @param message A byte-buffer containing the message.
+        * @param offset  The number of bytes to skip, before the message starts.
+        * @param len     The length of the message.
+        * @return A new byte-buffer containing the mac value.
+        */
+        public virtual byte[] CalculateMac(byte type, byte[] message, int offset, int len)
+        {
             //bool isTls = context.ServerVersion.FullVersion >= ProtocolVersion.TLSv10.FullVersion;
             bool isTls = true;
 
             byte[] macHeader = new byte[isTls ? 13 : 11];
-			TlsUtilities.WriteUint64(seqNo++, macHeader, 0);
-			TlsUtilities.WriteUint8((byte)type, macHeader, 8);
+            TlsUtilities.WriteUint64(seqNo++, macHeader, 0);
+            TlsUtilities.WriteUint8(type, macHeader, 8);
             if (isTls)
             {
                 TlsUtilities.WriteVersion(macHeader, 9);
             }
-			TlsUtilities.WriteUint16(len, macHeader, 11);
+            TlsUtilities.WriteUint16(len, macHeader, 11);
 
             mac.BlockUpdate(macHeader, 0, macHeader.Length);
-			mac.BlockUpdate(message, offset, len);
-			return MacUtilities.DoFinal(mac);
-		}
+            mac.BlockUpdate(message, offset, len);
+            return MacUtilities.DoFinal(mac);
+        }
 
-        public virtual byte[] CalculateMacConstantTime(ContentType type, byte[] message, int offset, int len,
+        public virtual byte[] CalculateMacConstantTime(byte type, byte[] message, int offset, int len,
             int fullLength, byte[] dummyData)
         {
             // Actual MAC only calculated on 'len' bytes
@@ -138,5 +138,5 @@ namespace Org.BouncyCastle.Crypto.Tls
 
             return result;
         }
-	}
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsNullCipher.cs b/crypto/src/crypto/tls/TlsNullCipher.cs
index b76f76d9c..3e2bfa847 100644
--- a/crypto/src/crypto/tls/TlsNullCipher.cs
+++ b/crypto/src/crypto/tls/TlsNullCipher.cs
@@ -2,27 +2,27 @@ using System;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// A NULL cipher suite, for use during handshake.
-	/// </summary>
-	public class TlsNullCipher
-		: TlsCipher
-	{
-		public virtual byte[] EncodePlaintext(ContentType type, byte[] plaintext, int offset, int len)
-		{
-			return CopyData(plaintext, offset, len);
-		}
+    /// <summary>
+    /// A NULL cipher suite, for use during handshake.
+    /// </summary>
+    public class TlsNullCipher
+        : TlsCipher
+    {
+        public virtual byte[] EncodePlaintext(byte type, byte[] plaintext, int offset, int len)
+        {
+            return CopyData(plaintext, offset, len);
+        }
 
-        public virtual byte[] DecodeCiphertext(ContentType type, byte[] ciphertext, int offset, int len)
-		{
-			return CopyData(ciphertext, offset, len);
-		}
+        public virtual byte[] DecodeCiphertext(byte type, byte[] ciphertext, int offset, int len)
+        {
+            return CopyData(ciphertext, offset, len);
+        }
 
-		protected virtual byte[] CopyData(byte[] text, int offset, int len)
-		{
-			byte[] result = new byte[len];
-			Array.Copy(text, offset, result, 0, len);
-			return result;
-		}
-	}
+        protected virtual byte[] CopyData(byte[] text, int offset, int len)
+        {
+            byte[] result = new byte[len];
+            Array.Copy(text, offset, result, 0, len);
+            return result;
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsProtocolHandler.cs b/crypto/src/crypto/tls/TlsProtocolHandler.cs
index 0a970d251..c538229dc 100644
--- a/crypto/src/crypto/tls/TlsProtocolHandler.cs
+++ b/crypto/src/crypto/tls/TlsProtocolHandler.cs
@@ -40,8 +40,6 @@ namespace Org.BouncyCastle.Crypto.Tls
         private const short CS_SERVER_CHANGE_CIPHER_SPEC_RECEIVED = 11;
         private const short CS_DONE = 12;
 
-        private static readonly byte[] emptybuf = new byte[0];
-
         private static readonly string TLS_ERROR_MESSAGE = "Internal TLS error, this could be an attack";
 
         /*
@@ -69,8 +67,8 @@ namespace Org.BouncyCastle.Crypto.Tls
 
         private TlsClientContextImpl tlsClientContext = null;
         private TlsClient tlsClient = null;
-        private CipherSuite[] offeredCipherSuites = null;
-        private CompressionMethod[] offeredCompressionMethods = null;
+        private int[] offeredCipherSuites = null;
+        private byte[] offeredCompressionMethods = null;
         private TlsKeyExchange keyExchange = null;
         private TlsAuthentication authentication = null;
         private CertificateRequest certificateRequest = null;
@@ -122,15 +120,15 @@ namespace Org.BouncyCastle.Crypto.Tls
         }
 
         internal void ProcessData(
-            ContentType	protocol,
-            byte[]		buf,
-            int			offset,
-            int			len)
+            byte    contentType,
+            byte[]	buf,
+            int		offset,
+            int		len)
         {
             /*
             * Have a look at the protocol type, and add it to the correct queue.
             */
-            switch (protocol)
+            switch (contentType)
             {
                 case ContentType.change_cipher_spec:
                     ProcessChangeCipherSpec(buf, offset, len);
@@ -177,7 +175,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                     byte[] beginning = new byte[4];
                     handshakeQueue.Read(beginning, 0, 4, 0);
                     MemoryStream bis = new MemoryStream(beginning, false);
-                    HandshakeType type = (HandshakeType)TlsUtilities.ReadUint8(bis);
+                    byte handshakeType = TlsUtilities.ReadUint8(bis);
                     int len = TlsUtilities.ReadUint24(bis);
 
                     /*
@@ -197,7 +195,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                          * including, this finished message. [..] Note: [Also,] Hello Request
                          * messages are omitted from handshake hashes.
                          */
-                        switch (type)
+                        switch (handshakeType)
                         {
                             case HandshakeType.hello_request:
                             case HandshakeType.finished:
@@ -211,7 +209,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                         /*
                         * Now, parse the message.
                         */
-                        ProcessHandshakeMessage(type, buf);
+                        ProcessHandshakeMessage(handshakeType, buf);
                         read = true;
                     }
                 }
@@ -219,14 +217,14 @@ namespace Org.BouncyCastle.Crypto.Tls
             while (read);
         }
 
-        private void ProcessHandshakeMessage(HandshakeType type, byte[] buf)
+        private void ProcessHandshakeMessage(byte handshakeType, byte[] buf)
         {
             MemoryStream inStr = new MemoryStream(buf, false);
 
             /*
             * Check the type.
             */
-            switch (type)
+            switch (handshakeType)
             {
                 case HandshakeType.certificate:
                 {
@@ -324,7 +322,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                              * Find out which CipherSuite the server has chosen and check that
                              * it was one of the offered ones.
                              */
-                            CipherSuite selectedCipherSuite = (CipherSuite)TlsUtilities.ReadUint16(inStr);
+                            int selectedCipherSuite = TlsUtilities.ReadUint16(inStr);
                             if (!ArrayContains(offeredCipherSuites, selectedCipherSuite)
                                 || selectedCipherSuite == CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)
                             {
@@ -337,7 +335,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                              * Find out which CompressionMethod the server has chosen and check that
                              * it was one of the offered ones.
                              */
-                            CompressionMethod selectedCompressionMethod = (CompressionMethod)TlsUtilities.ReadUint8(inStr);
+                            byte selectedCompressionMethod = TlsUtilities.ReadUint8(inStr);
                             if (!ArrayContains(offeredCompressionMethods, selectedCompressionMethod))
                             {
                                 this.FailWithError(AlertLevel.fatal, AlertDescription.illegal_parameter);
@@ -364,7 +362,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                              * containing no extensions.
                              */
 
-                            // ExtensionType -> byte[]
+                            // Int32 -> byte[]
                             IDictionary serverExtensions = Platform.CreateHashtable();
 
                             if (inStr.Position < inStr.Length)
@@ -375,7 +373,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                                 MemoryStream ext = new MemoryStream(extBytes, false);
                                 while (ext.Position < ext.Length)
                                 {
-                                    ExtensionType extType = (ExtensionType)TlsUtilities.ReadUint16(ext);
+                                    int extType = TlsUtilities.ReadUint16(ext);
                                     byte[] extValue = TlsUtilities.ReadOpaque16(ext);
 
                                     // Note: RFC 5746 makes a special case for EXT_RenegotiationInfo
@@ -431,7 +429,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                                     byte[] renegExtValue = (byte[])serverExtensions[ExtensionType.renegotiation_info];
 
                                     if (!Arrays.ConstantTimeAreEqual(renegExtValue,
-                                        CreateRenegotiationInfo(emptybuf)))
+                                        CreateRenegotiationInfo(TlsUtilities.EmptyBytes)))
                                     {
                                         this.FailWithError(AlertLevel.fatal, AlertDescription.handshake_failure);
                                     }
@@ -626,29 +624,11 @@ namespace Org.BouncyCastle.Crypto.Tls
                                 this.FailWithError(AlertLevel.fatal, AlertDescription.handshake_failure);
                             }
 
-                            int numTypes = TlsUtilities.ReadUint8(inStr);
-                            ClientCertificateType[] certificateTypes = new ClientCertificateType[numTypes];
-                            for (int i = 0; i < numTypes; ++i)
-                            {
-                                certificateTypes[i] = (ClientCertificateType)TlsUtilities.ReadUint8(inStr);
-                            }
-
-                            byte[] authorities = TlsUtilities.ReadOpaque16(inStr);
+                            this.certificateRequest = CertificateRequest.Parse(//getContext(),
+                                inStr);
 
                             AssertEmpty(inStr);
 
-                            IList authorityDNs = Platform.CreateArrayList();
-
-                            MemoryStream bis = new MemoryStream(authorities, false);
-                            while (bis.Position < bis.Length)
-                            {
-                                byte[] dnBytes = TlsUtilities.ReadOpaque16(bis);
-                                // TODO Switch to X500Name when available
-                                authorityDNs.Add(X509Name.GetInstance(Asn1Object.FromByteArray(dnBytes)));
-                            }
-
-                            this.certificateRequest = new CertificateRequest(certificateTypes,
-                                authorityDNs);
                             this.keyExchange.ValidateCertificateRequest(this.certificateRequest);
 
                             break;
@@ -855,7 +835,7 @@ namespace Org.BouncyCastle.Crypto.Tls
 
             this.offeredCipherSuites = this.tlsClient.GetCipherSuites();
 
-            // ExtensionType -> byte[]
+            // Int32 -> byte[]
             this.clientExtensions = this.tlsClient.GetClientExtensions();
 
             // Cipher Suites (and SCSV)
@@ -899,7 +879,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                 TlsUtilities.WriteUint8((byte)offeredCompressionMethods.Length, outStr);
                 for (int i = 0; i < offeredCompressionMethods.Length; ++i)
                 {
-                    TlsUtilities.WriteUint8((byte)offeredCompressionMethods[i], outStr);
+                    TlsUtilities.WriteUint8(offeredCompressionMethods[i], outStr);
                 }
             }
 
@@ -908,7 +888,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             {
                 MemoryStream ext = new MemoryStream();
 
-                foreach (ExtensionType extType in clientExtensions.Keys)
+                foreach (int extType in clientExtensions.Keys)
                 {
                     WriteExtension(ext, extType, (byte[])clientExtensions[extType]);
                 }
@@ -1009,7 +989,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             }
         }
 
-        private void SafeWriteMessage(ContentType type, byte[] buf, int offset, int len)
+        private void SafeWriteMessage(byte type, byte[] buf, int offset, int len)
         {
             try
             {
@@ -1064,22 +1044,33 @@ namespace Org.BouncyCastle.Crypto.Tls
             while (len > 0)
             {
                 /*
-                 * Protect against known IV attack!
-                 *
-                 * DO NOT REMOVE THIS LINE, EXCEPT YOU KNOW EXACTLY WHAT
-                 * YOU ARE DOING HERE.
+                 * RFC 5246 6.2.1. Zero-length fragments of Application data MAY be sent as they are
+                 * potentially useful as a traffic analysis countermeasure.
+                 * 
+                 * NOTE: Actually, implementations appear to have settled on 1/n-1 record splitting.
                  */
-                SafeWriteMessage(ContentType.application_data, emptybuf, 0, 0);
 
-                /*
-                * We are only allowed to write fragments up to 2^14 bytes.
-                */
-                int toWrite = System.Math.Min(len, 1 << 14);
-
-                SafeWriteMessage(ContentType.application_data, buf, offset, toWrite);
+                //if (this.splitApplicationDataRecords)
+                {
+                    /*
+                     * Protect against known IV attack!
+                     * 
+                     * DO NOT REMOVE THIS CODE, EXCEPT YOU KNOW EXACTLY WHAT YOU ARE DOING HERE.
+                     */
+                    SafeWriteMessage(ContentType.application_data, buf, offset, 1);
+                    ++offset;
+                    --len;
+                }
 
-                offset += toWrite;
-                len -= toWrite;
+                if (len > 0)
+                {
+                    // Fragment data according to the current fragment limit.
+                    //int toWrite = System.Math.Min(len, recordStream.GetPlaintextLimit());
+                    int toWrite = System.Math.Min(len, 1 << 14);
+                    SafeWriteMessage(ContentType.application_data, buf, offset, toWrite);
+                    offset += toWrite;
+                    len -= toWrite;
+                }
             }
         }
 
@@ -1112,7 +1103,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         * @param alertDescription The exact alert message.
         * @throws IOException If alert was fatal.
         */
-        private void FailWithError(AlertLevel alertLevel, AlertDescription	alertDescription)
+        private void FailWithError(byte alertLevel, byte alertDescription)
         {
             /*
             * Check if the connection is still open.
@@ -1144,11 +1135,9 @@ namespace Org.BouncyCastle.Crypto.Tls
             }
         }
 
-        internal void SendAlert(AlertLevel alertLevel, AlertDescription alertDescription)
+        internal void SendAlert(byte alertLevel, byte alertDescription)
         {
-            byte[] error = new byte[2];
-            error[0] = (byte)alertLevel;
-            error[1] = (byte)alertDescription;
+            byte[] error = new byte[] { alertLevel, alertDescription };
 
             rs.WriteMessage(ContentType.alert, error, 0, 2);
         }
@@ -1197,7 +1186,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             get { return closed; }
         }
 
-        private static bool ArrayContains(CipherSuite[] a, CipherSuite n)
+        private static bool ArrayContains(byte[] a, byte n)
         {
             for (int i = 0; i < a.Length; ++i)
             {
@@ -1207,7 +1196,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             return false;
         }
 
-        private static bool ArrayContains(CompressionMethod[] a, CompressionMethod n)
+        private static bool ArrayContains(int[] a, int n)
         {
             for (int i = 0; i < a.Length; ++i)
             {
@@ -1224,9 +1213,9 @@ namespace Org.BouncyCastle.Crypto.Tls
             return buf.ToArray();
         }
 
-        private static void WriteExtension(Stream output, ExtensionType extType, byte[] extValue)
+        private static void WriteExtension(Stream output, int extType, byte[] extValue)
         {
-            TlsUtilities.WriteUint16((int)extType, output);
+            TlsUtilities.WriteUint16(extType, output);
             TlsUtilities.WriteOpaque16(extValue, output);
         }
     }
diff --git a/crypto/src/crypto/tls/TlsPskKeyExchange.cs b/crypto/src/crypto/tls/TlsPskKeyExchange.cs
index cadd643ca..9961fc9d1 100644
--- a/crypto/src/crypto/tls/TlsPskKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsPskKeyExchange.cs
@@ -8,42 +8,42 @@ using Org.BouncyCastle.Security;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	internal class TlsPskKeyExchange
-		: TlsKeyExchange
-	{
-		protected TlsClientContext context;
-		protected KeyExchangeAlgorithm keyExchange;
-		protected TlsPskIdentity pskIdentity;
+    internal class TlsPskKeyExchange
+        : TlsKeyExchange
+    {
+        protected TlsClientContext context;
+        protected int keyExchange;
+        protected TlsPskIdentity pskIdentity;
 
-		protected byte[] psk_identity_hint = null;
+        protected byte[] psk_identity_hint = null;
 
-		protected DHPublicKeyParameters dhAgreeServerPublicKey = null;
-		protected DHPrivateKeyParameters dhAgreeClientPrivateKey = null;
+        protected DHPublicKeyParameters dhAgreeServerPublicKey = null;
+        protected DHPrivateKeyParameters dhAgreeClientPrivateKey = null;
 
         protected AsymmetricKeyParameter serverPublicKey = null;
         protected RsaKeyParameters rsaServerPublicKey = null;
-		protected byte[] premasterSecret;
-
-		internal TlsPskKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange,
-			TlsPskIdentity pskIdentity)
-		{
-			switch (keyExchange)
-			{
-				case KeyExchangeAlgorithm.PSK:
-				case KeyExchangeAlgorithm.RSA_PSK:
-				case KeyExchangeAlgorithm.DHE_PSK:
-					break;
-				default:
-					throw new ArgumentException("unsupported key exchange algorithm", "keyExchange");
-			}
-
-			this.context = context;
-			this.keyExchange = keyExchange;
-			this.pskIdentity = pskIdentity;
-		}
-
-		public virtual void SkipServerCertificate()
-		{
+        protected byte[] premasterSecret;
+
+        internal TlsPskKeyExchange(TlsClientContext context, int keyExchange,
+            TlsPskIdentity pskIdentity)
+        {
+            switch (keyExchange)
+            {
+                case KeyExchangeAlgorithm.PSK:
+                case KeyExchangeAlgorithm.RSA_PSK:
+                case KeyExchangeAlgorithm.DHE_PSK:
+                    break;
+                default:
+                    throw new ArgumentException("unsupported key exchange algorithm", "keyExchange");
+            }
+
+            this.context = context;
+            this.keyExchange = keyExchange;
+            this.pskIdentity = pskIdentity;
+        }
+
+        public virtual void SkipServerCertificate()
+        {
             if (keyExchange == KeyExchangeAlgorithm.RSA_PSK)
             {
                 throw new TlsFatalAlert(AlertDescription.unexpected_message);
@@ -51,13 +51,13 @@ namespace Org.BouncyCastle.Crypto.Tls
         }
 
         public virtual void ProcessServerCertificate(Certificate serverCertificate)
-		{
+        {
             if (keyExchange != KeyExchangeAlgorithm.RSA_PSK)
             {
                 throw new TlsFatalAlert(AlertDescription.unexpected_message);
             }
 
-            X509CertificateStructure x509Cert = serverCertificate.certs[0];
+            X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0);
             SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
 
             try
@@ -88,107 +88,107 @@ namespace Org.BouncyCastle.Crypto.Tls
             */
         }
 
-		public virtual void SkipServerKeyExchange()
-		{
+        public virtual void SkipServerKeyExchange()
+        {
             if (keyExchange == KeyExchangeAlgorithm.DHE_PSK)
             {
                 throw new TlsFatalAlert(AlertDescription.unexpected_message);
             }
 
-            this.psk_identity_hint = new byte[0];
-		}
-
-		public virtual void ProcessServerKeyExchange(Stream input)
-		{
-			this.psk_identity_hint = TlsUtilities.ReadOpaque16(input);
-
-			if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
-			{
-				byte[] pBytes = TlsUtilities.ReadOpaque16(input);
-				byte[] gBytes = TlsUtilities.ReadOpaque16(input);
-				byte[] YsBytes = TlsUtilities.ReadOpaque16(input);
-
-				BigInteger p = new BigInteger(1, pBytes);
-				BigInteger g = new BigInteger(1, gBytes);
-				BigInteger Ys = new BigInteger(1, YsBytes);
-				
-				this.dhAgreeServerPublicKey = TlsDHUtilities.ValidateDHPublicKey(
-					new DHPublicKeyParameters(Ys, new DHParameters(p, g)));
-			}
-			else if (this.psk_identity_hint.Length == 0)
-			{
-				// TODO Should we enforce that this message should have been skipped if hint is empty?
-				//throw new TlsFatalAlert(AlertDescription.unexpected_message);
-			}
-		}
-
-		public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public virtual void SkipClientCredentials()
-		{
-			// OK
-		}
-
-		public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
-		{
-			throw new TlsFatalAlert(AlertDescription.internal_error);
-		}
-
-		public virtual void GenerateClientKeyExchange(Stream output)
-		{
-			if (psk_identity_hint == null || psk_identity_hint.Length == 0)
-			{
-				pskIdentity.SkipIdentityHint();
-			}
-			else
-			{
-				pskIdentity.NotifyIdentityHint(psk_identity_hint);
-			}
-
-			byte[] psk_identity = pskIdentity.GetPskIdentity();
-
-			TlsUtilities.WriteOpaque16(psk_identity, output);
-
-			if (this.keyExchange == KeyExchangeAlgorithm.RSA_PSK)
-			{
-				this.premasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(
-					context.SecureRandom, this.rsaServerPublicKey, output);
-			}
-			else if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
-			{
-				this.dhAgreeClientPrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(
-					context.SecureRandom, this.dhAgreeServerPublicKey.Parameters, output);
-			}
-		}
-
-		public virtual byte[] GeneratePremasterSecret()
-		{
-			byte[] psk = pskIdentity.GetPsk();
-			byte[] other_secret = GenerateOtherSecret(psk.Length);
-
-			MemoryStream buf = new MemoryStream(4 + other_secret.Length + psk.Length);
-			TlsUtilities.WriteOpaque16(other_secret, buf);
-			TlsUtilities.WriteOpaque16(psk, buf);
-			return buf.ToArray();
-		}
-
-		protected virtual byte[] GenerateOtherSecret(int pskLength)
-		{
-			if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
-			{
-				return TlsDHUtilities.CalculateDHBasicAgreement(dhAgreeServerPublicKey, dhAgreeClientPrivateKey);
-			}
-
-			if (this.keyExchange == KeyExchangeAlgorithm.RSA_PSK)
-			{
-				return this.premasterSecret;
-			}
-
-			return new byte[pskLength];
-		}
+            this.psk_identity_hint = TlsUtilities.EmptyBytes;
+        }
+
+        public virtual void ProcessServerKeyExchange(Stream input)
+        {
+            this.psk_identity_hint = TlsUtilities.ReadOpaque16(input);
+
+            if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
+            {
+                byte[] pBytes = TlsUtilities.ReadOpaque16(input);
+                byte[] gBytes = TlsUtilities.ReadOpaque16(input);
+                byte[] YsBytes = TlsUtilities.ReadOpaque16(input);
+
+                BigInteger p = new BigInteger(1, pBytes);
+                BigInteger g = new BigInteger(1, gBytes);
+                BigInteger Ys = new BigInteger(1, YsBytes);
+                
+                this.dhAgreeServerPublicKey = TlsDHUtilities.ValidateDHPublicKey(
+                    new DHPublicKeyParameters(Ys, new DHParameters(p, g)));
+            }
+            else if (this.psk_identity_hint.Length == 0)
+            {
+                // TODO Should we enforce that this message should have been skipped if hint is empty?
+                //throw new TlsFatalAlert(AlertDescription.unexpected_message);
+            }
+        }
+
+        public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public virtual void SkipClientCredentials()
+        {
+            // OK
+        }
+
+        public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
+        {
+            throw new TlsFatalAlert(AlertDescription.internal_error);
+        }
+
+        public virtual void GenerateClientKeyExchange(Stream output)
+        {
+            if (psk_identity_hint == null || psk_identity_hint.Length == 0)
+            {
+                pskIdentity.SkipIdentityHint();
+            }
+            else
+            {
+                pskIdentity.NotifyIdentityHint(psk_identity_hint);
+            }
+
+            byte[] psk_identity = pskIdentity.GetPskIdentity();
+
+            TlsUtilities.WriteOpaque16(psk_identity, output);
+
+            if (this.keyExchange == KeyExchangeAlgorithm.RSA_PSK)
+            {
+                this.premasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(
+                    context.SecureRandom, this.rsaServerPublicKey, output);
+            }
+            else if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
+            {
+                this.dhAgreeClientPrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(
+                    context.SecureRandom, this.dhAgreeServerPublicKey.Parameters, output);
+            }
+        }
+
+        public virtual byte[] GeneratePremasterSecret()
+        {
+            byte[] psk = pskIdentity.GetPsk();
+            byte[] other_secret = GenerateOtherSecret(psk.Length);
+
+            MemoryStream buf = new MemoryStream(4 + other_secret.Length + psk.Length);
+            TlsUtilities.WriteOpaque16(other_secret, buf);
+            TlsUtilities.WriteOpaque16(psk, buf);
+            return buf.ToArray();
+        }
+
+        protected virtual byte[] GenerateOtherSecret(int pskLength)
+        {
+            if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK)
+            {
+                return TlsDHUtilities.CalculateDHBasicAgreement(dhAgreeServerPublicKey, dhAgreeClientPrivateKey);
+            }
+
+            if (this.keyExchange == KeyExchangeAlgorithm.RSA_PSK)
+            {
+                return this.premasterSecret;
+            }
+
+            return new byte[pskLength];
+        }
 
         protected virtual RsaKeyParameters ValidateRsaPublicKey(RsaKeyParameters key)
         {
diff --git a/crypto/src/crypto/tls/TlsRsaKeyExchange.cs b/crypto/src/crypto/tls/TlsRsaKeyExchange.cs
index ad61f08de..aad482316 100644
--- a/crypto/src/crypto/tls/TlsRsaKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsRsaKeyExchange.cs
@@ -11,117 +11,117 @@ using Org.BouncyCastle.Security;
 
 namespace Org.BouncyCastle.Crypto.Tls
 {
-	/// <summary>
-	/// TLS 1.0 RSA key exchange.
-	/// </summary>
-	internal class TlsRsaKeyExchange
-		: TlsKeyExchange
-	{
-		protected TlsClientContext context;
+    /// <summary>
+    /// TLS 1.0 RSA key exchange.
+    /// </summary>
+    internal class TlsRsaKeyExchange
+        : TlsKeyExchange
+    {
+        protected TlsClientContext context;
 
-		protected AsymmetricKeyParameter serverPublicKey = null;
+        protected AsymmetricKeyParameter serverPublicKey = null;
 
         protected RsaKeyParameters rsaServerPublicKey = null;
 
         protected byte[] premasterSecret;
 
-		internal TlsRsaKeyExchange(TlsClientContext context)
-		{
-			this.context = context;
-		}
-
-		public virtual void SkipServerCertificate()
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public virtual void ProcessServerCertificate(Certificate serverCertificate)
-		{
-			X509CertificateStructure x509Cert = serverCertificate.certs[0];
-			SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
-
-			try
-			{
-				this.serverPublicKey = PublicKeyFactory.CreateKey(keyInfo);
-			}
+        internal TlsRsaKeyExchange(TlsClientContext context)
+        {
+            this.context = context;
+        }
+
+        public virtual void SkipServerCertificate()
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public virtual void ProcessServerCertificate(Certificate serverCertificate)
+        {
+            X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0);
+            SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
+
+            try
+            {
+                this.serverPublicKey = PublicKeyFactory.CreateKey(keyInfo);
+            }
 //			catch (RuntimeException)
-			catch (Exception)
-			{
-				throw new TlsFatalAlert(AlertDescription.unsupported_certificate);
-			}
-
-			// Sanity check the PublicKeyFactory
-			if (this.serverPublicKey.IsPrivate)
-			{
-				throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-
-			this.rsaServerPublicKey = ValidateRsaPublicKey((RsaKeyParameters)this.serverPublicKey);
-
-			TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyEncipherment);
-
-			// TODO
-			/*
-			* Perform various checks per RFC2246 7.4.2: "Unless otherwise specified, the
-			* signing algorithm for the certificate must be the same as the algorithm for the
-			* certificate key."
-			*/
-		}
-
-		public virtual void SkipServerKeyExchange()
-		{
-			// OK
-		}
-
-		public virtual void ProcessServerKeyExchange(Stream input)
-		{
-			throw new TlsFatalAlert(AlertDescription.unexpected_message);
-		}
-
-		public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
-		{
-			ClientCertificateType[] types = certificateRequest.CertificateTypes;
-			foreach (ClientCertificateType type in types)
-			{
-				switch (type)
-				{
-					case ClientCertificateType.rsa_sign:
-					case ClientCertificateType.dss_sign:
-					case ClientCertificateType.ecdsa_sign:
-						break;
-					default:
-						throw new TlsFatalAlert(AlertDescription.illegal_parameter);
-				}
-			}
-		}
-
-		public virtual void SkipClientCredentials()
-		{
-			// OK
-		}
-
-		public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
-		{
-			if (!(clientCredentials is TlsSignerCredentials))
-			{
-				throw new TlsFatalAlert(AlertDescription.internal_error);
-			}
-		}
-		
+            catch (Exception)
+            {
+                throw new TlsFatalAlert(AlertDescription.unsupported_certificate);
+            }
+
+            // Sanity check the PublicKeyFactory
+            if (this.serverPublicKey.IsPrivate)
+            {
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+
+            this.rsaServerPublicKey = ValidateRsaPublicKey((RsaKeyParameters)this.serverPublicKey);
+
+            TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyEncipherment);
+
+            // TODO
+            /*
+            * Perform various checks per RFC2246 7.4.2: "Unless otherwise specified, the
+            * signing algorithm for the certificate must be the same as the algorithm for the
+            * certificate key."
+            */
+        }
+
+        public virtual void SkipServerKeyExchange()
+        {
+            // OK
+        }
+
+        public virtual void ProcessServerKeyExchange(Stream input)
+        {
+            throw new TlsFatalAlert(AlertDescription.unexpected_message);
+        }
+
+        public virtual void ValidateCertificateRequest(CertificateRequest certificateRequest)
+        {
+            byte[] types = certificateRequest.CertificateTypes;
+            foreach (byte type in types)
+            {
+                switch (type)
+                {
+                    case ClientCertificateType.rsa_sign:
+                    case ClientCertificateType.dss_sign:
+                    case ClientCertificateType.ecdsa_sign:
+                        break;
+                    default:
+                        throw new TlsFatalAlert(AlertDescription.illegal_parameter);
+                }
+            }
+        }
+
+        public virtual void SkipClientCredentials()
+        {
+            // OK
+        }
+
+        public virtual void ProcessClientCredentials(TlsCredentials clientCredentials)
+        {
+            if (!(clientCredentials is TlsSignerCredentials))
+            {
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+            }
+        }
+        
         public virtual void GenerateClientKeyExchange(Stream output)
-		{
-			this.premasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(
-				context.SecureRandom, this.rsaServerPublicKey, output);
-		}
-
-		public virtual byte[] GeneratePremasterSecret()
-		{
-			byte[] tmp = this.premasterSecret;
-			this.premasterSecret = null;
-			return tmp;
-		}
-
-    	// Would be needed to process RSA_EXPORT server key exchange
+        {
+            this.premasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(
+                context.SecureRandom, this.rsaServerPublicKey, output);
+        }
+
+        public virtual byte[] GeneratePremasterSecret()
+        {
+            byte[] tmp = this.premasterSecret;
+            this.premasterSecret = null;
+            return tmp;
+        }
+
+        // Would be needed to process RSA_EXPORT server key exchange
 //	    protected virtual void ProcessRsaServerKeyExchange(Stream input, ISigner signer)
 //	    {
 //	        Stream sigIn = input;
@@ -150,16 +150,16 @@ namespace Org.BouncyCastle.Crypto.Tls
 //	    }
 
         protected virtual RsaKeyParameters ValidateRsaPublicKey(RsaKeyParameters key)
-		{
-			// TODO What is the minimum bit length required?
+        {
+            // TODO What is the minimum bit length required?
 //			key.Modulus.BitLength;
 
-			if (!key.Exponent.IsProbablePrime(2))
-			{
-				throw new TlsFatalAlert(AlertDescription.illegal_parameter);
-			}
+            if (!key.Exponent.IsProbablePrime(2))
+            {
+                throw new TlsFatalAlert(AlertDescription.illegal_parameter);
+            }
 
-			return key;
-		}
-	}
+            return key;
+        }
+    }
 }
diff --git a/crypto/src/crypto/tls/TlsSrpKeyExchange.cs b/crypto/src/crypto/tls/TlsSrpKeyExchange.cs
index cb4e26e58..950be87ba 100644
--- a/crypto/src/crypto/tls/TlsSrpKeyExchange.cs
+++ b/crypto/src/crypto/tls/TlsSrpKeyExchange.cs
@@ -22,7 +22,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         : TlsKeyExchange
     {
         protected TlsClientContext context;
-        protected KeyExchangeAlgorithm keyExchange;
+        protected int keyExchange;
         protected TlsSigner tlsSigner;
         protected byte[] identity;
         protected byte[] password;
@@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Crypto.Tls
         protected BigInteger B = null;
         protected Srp6Client srpClient = new Srp6Client();
 
-        internal TlsSrpKeyExchange(TlsClientContext context, KeyExchangeAlgorithm keyExchange,
+        internal TlsSrpKeyExchange(TlsClientContext context, int keyExchange,
             byte[] identity, byte[] password)
         {
             switch (keyExchange)
@@ -72,7 +72,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                 throw new TlsFatalAlert(AlertDescription.unexpected_message);
             }
 
-            X509CertificateStructure x509Cert = serverCertificate.certs[0];
+            X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0);
             SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo;
 
             try
diff --git a/crypto/src/crypto/tls/TlsStreamCipher.cs b/crypto/src/crypto/tls/TlsStreamCipher.cs
index 65d6054ff..35f794d96 100644
--- a/crypto/src/crypto/tls/TlsStreamCipher.cs
+++ b/crypto/src/crypto/tls/TlsStreamCipher.cs
@@ -18,40 +18,40 @@ namespace Org.BouncyCastle.Crypto.Tls
         protected TlsMac readMac;
 
         public TlsStreamCipher(TlsClientContext context, IStreamCipher encryptCipher,
-			IStreamCipher decryptCipher, IDigest writeDigest, IDigest readDigest, int cipherKeySize)
-		{
-			this.context = context;
-			this.encryptCipher = encryptCipher;
-			this.decryptCipher = decryptCipher;
+            IStreamCipher decryptCipher, IDigest writeDigest, IDigest readDigest, int cipherKeySize)
+        {
+            this.context = context;
+            this.encryptCipher = encryptCipher;
+            this.decryptCipher = decryptCipher;
 
             int prfSize = (2 * cipherKeySize) + writeDigest.GetDigestSize()
                 + readDigest.GetDigestSize();
 
-			SecurityParameters securityParameters = context.SecurityParameters;
+            SecurityParameters securityParameters = context.SecurityParameters;
 
-			byte[] keyBlock = TlsUtilities.PRF(securityParameters.masterSecret, "key expansion",
-				TlsUtilities.Concat(securityParameters.serverRandom, securityParameters.clientRandom),
-				prfSize);
+            byte[] keyBlock = TlsUtilities.PRF(securityParameters.masterSecret, "key expansion",
+                TlsUtilities.Concat(securityParameters.serverRandom, securityParameters.clientRandom),
+                prfSize);
 
-			int offset = 0;
+            int offset = 0;
 
-			// Init MACs
-			writeMac = CreateTlsMac(writeDigest, keyBlock, ref offset);
-			readMac = CreateTlsMac(readDigest, keyBlock, ref offset);
+            // Init MACs
+            writeMac = CreateTlsMac(writeDigest, keyBlock, ref offset);
+            readMac = CreateTlsMac(readDigest, keyBlock, ref offset);
 
-			// Build keys
-			KeyParameter encryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
-			KeyParameter decryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
+            // Build keys
+            KeyParameter encryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
+            KeyParameter decryptKey = CreateKeyParameter(keyBlock, ref offset, cipherKeySize);
 
-			if (offset != prfSize)
+            if (offset != prfSize)
                 throw new TlsFatalAlert(AlertDescription.internal_error);
 
             // Init Ciphers
             encryptCipher.Init(true, encryptKey);
             decryptCipher.Init(false, decryptKey);
-		}
+        }
 
-        public byte[] EncodePlaintext(ContentType type, byte[] plaintext, int offset, int len)
+        public byte[] EncodePlaintext(byte type, byte[] plaintext, int offset, int len)
         {
             byte[] mac = writeMac.CalculateMac(type, plaintext, offset, len);
             int size = len + mac.Length;
@@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             return outbuf;
         }
 
-        public byte[] DecodeCiphertext(ContentType type, byte[] ciphertext, int offset, int len)
+        public byte[] DecodeCiphertext(byte type, byte[] ciphertext, int offset, int len)
         {
             byte[] deciphered = new byte[len];
             decryptCipher.ProcessBytes(ciphertext, offset, len, deciphered, 0);
diff --git a/crypto/src/crypto/tls/TlsUtilities.cs b/crypto/src/crypto/tls/TlsUtilities.cs
index dca842a80..5ed659ce7 100644
--- a/crypto/src/crypto/tls/TlsUtilities.cs
+++ b/crypto/src/crypto/tls/TlsUtilities.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.IO;
 using System.Text;
 
@@ -16,6 +17,41 @@ namespace Org.BouncyCastle.Crypto.Tls
     /// <remarks>Some helper functions for MicroTLS.</remarks>
     public class TlsUtilities
     {
+        public static readonly byte[] EmptyBytes = new byte[0];
+
+        public static void CheckUint8(int i)
+        {
+            if (!IsValidUint8(i))
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+        }
+
+        public static void CheckUint16(int i)
+        {
+            if (!IsValidUint16(i))
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+        }
+
+        public static void CheckUint24(int i)
+        {
+            if (!IsValidUint24(i))
+                throw new TlsFatalAlert(AlertDescription.internal_error);
+        }
+
+        public static bool IsValidUint8(int i)
+        {
+            return (i & 0xFF) == i;
+        }
+
+        public static bool IsValidUint16(int i)
+        {
+            return (i & 0xFFFF) == i;
+        }
+
+        public static bool IsValidUint24(int i)
+        {
+            return (i & 0xFFFFFF) == i;
+        }
+
         internal static void WriteUint8(byte i, Stream os)
         {
             os.WriteByte(i);
@@ -99,6 +135,13 @@ namespace Org.BouncyCastle.Crypto.Tls
             os.Write(uints, 0, uints.Length);
         }
 
+        public static void WriteUint8ArrayWithUint8Length(byte[] uints, Stream output)
+        {
+            CheckUint8(uints.Length);
+            WriteUint8((byte)uints.Length, output);
+            WriteUint8Array(uints, output);
+        }
+
         internal static void WriteUint16Array(int[] uints, Stream os)
         {
             for (int i = 0; i < uints.Length; ++i)
@@ -140,6 +183,16 @@ namespace Org.BouncyCastle.Crypto.Tls
             return (i1 << 16) | (i2 << 8) | i3;
         }
 
+        public static byte[] ReadFully(int length, Stream input)
+        {
+            if (length < 1)
+                return EmptyBytes;
+            byte[] buf = new byte[length];
+            if (length != Streams.ReadFully(input, buf))
+                throw new EndOfStreamException();
+            return buf;
+        }
+
         internal static void ReadFully(byte[] buf, Stream inStr)
         {
             if (Streams.ReadFully(inStr, buf, 0, buf.Length) < buf.Length)
@@ -162,6 +215,12 @@ namespace Org.BouncyCastle.Crypto.Tls
             return bytes;
         }
 
+        public static byte[] ReadOpaque24(Stream input)
+        {
+            int length = ReadUint24(input);
+            return ReadFully(length, input);
+        }
+
         internal static void CheckVersion(byte[] readVersion)
         {
             if ((readVersion[0] != 3) || (readVersion[1] != 1))
@@ -180,6 +239,30 @@ namespace Org.BouncyCastle.Crypto.Tls
             }
         }
 
+        public static Asn1Object ReadAsn1Object(byte[] encoding)
+        {
+            Asn1InputStream asn1 = new Asn1InputStream(encoding);
+            Asn1Object result = asn1.ReadObject();
+            if (null == result)
+                throw new TlsFatalAlert(AlertDescription.decode_error);
+            if (null != asn1.ReadObject())
+                throw new TlsFatalAlert(AlertDescription.decode_error);
+            return result;
+        }
+
+        public static Asn1Object ReadDerObject(byte[] encoding)
+        {
+            /*
+             * NOTE: The current ASN.1 parsing code can't enforce DER-only parsing, but since DER is
+             * canonical, we can check it by re-encoding the result and comparing to the original.
+             */
+            Asn1Object result = ReadAsn1Object(encoding);
+            byte[] check = result.GetEncoded(Asn1Encodable.Der);
+            if (!Arrays.AreEqual(check, encoding))
+                throw new TlsFatalAlert(AlertDescription.decode_error);
+            return result;
+        }
+
         internal static void WriteGmtUnixTime(byte[] buf, int offset)
         {
             int t = (int)(DateTimeUtilities.CurrentUnixMs() / 1000L);
@@ -201,6 +284,35 @@ namespace Org.BouncyCastle.Crypto.Tls
             buf[offset + 1] = 1;
         }
 
+        public static void EncodeSupportedSignatureAlgorithms(IList supportedSignatureAlgorithms, bool allowAnonymous,
+            Stream output)
+        {
+            if (supportedSignatureAlgorithms == null || supportedSignatureAlgorithms.Count < 1
+                || supportedSignatureAlgorithms.Count >= (1 << 15))
+            {
+                throw new ArgumentException("must have length from 1 to (2^15 - 1)", "supportedSignatureAlgorithms");
+            }
+
+            // supported_signature_algorithms
+            int length = 2 * supportedSignatureAlgorithms.Count;
+            TlsUtilities.CheckUint16(length);
+            TlsUtilities.WriteUint16(length, output);
+
+            foreach (SignatureAndHashAlgorithm entry in supportedSignatureAlgorithms)
+            {
+                if (!allowAnonymous && entry.Signature == SignatureAlgorithm.anonymous)
+                {
+                    /*
+                     * RFC 5246 7.4.1.4.1 The "anonymous" value is meaningless in this context but used
+                     * in Section 7.4.3. It MUST NOT appear in this extension.
+                     */
+                    throw new ArgumentException(
+                        "SignatureAlgorithm.anonymous MUST NOT appear in the signature_algorithms extension");
+                }
+                entry.Encode(output);
+            }
+        }
+
         private static void hmac_hash(IDigest digest, byte[] secret, byte[] seed, byte[] output)
         {
             HMac mac = new HMac(digest);
diff --git a/crypto/src/math/BigInteger.cs b/crypto/src/math/BigInteger.cs
index 00f8f399d..04c04a55d 100644
--- a/crypto/src/math/BigInteger.cs
+++ b/crypto/src/math/BigInteger.cs
@@ -9,11 +9,11 @@ using Org.BouncyCastle.Utilities;
 namespace Org.BouncyCastle.Math
 {
 #if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT)
-	[Serializable]
+    [Serializable]
 #endif
-	public class BigInteger
-	{
-		// The first few odd primes
+    public class BigInteger
+    {
+        // The first few odd primes
         /*
                 3   5   7   11  13  17  19  23  29
             31  37  41  43  47  53  59  61  67  71
@@ -40,67 +40,67 @@ namespace Org.BouncyCastle.Math
         */
 
         // Each list has a product < 2^31
-		internal static readonly int[][] primeLists = new int[][]
-		{
-			new int[]{ 3, 5, 7, 11, 13, 17, 19, 23 },
-			new int[]{ 29, 31, 37, 41, 43 },
-			new int[]{ 47, 53, 59, 61, 67 },
-			new int[]{ 71, 73, 79, 83 },
-			new int[]{ 89, 97, 101, 103 },
-
-			new int[]{ 107, 109, 113, 127 },
-			new int[]{ 131, 137, 139, 149 },
-			new int[]{ 151, 157, 163, 167 },
-			new int[]{ 173, 179, 181, 191 },
-			new int[]{ 193, 197, 199, 211 },
-
-			new int[]{ 223, 227, 229 },
-			new int[]{ 233, 239, 241 },
-			new int[]{ 251, 257, 263 },
-			new int[]{ 269, 271, 277 },
-			new int[]{ 281, 283, 293 },
-
-			new int[]{ 307, 311, 313 },
-			new int[]{ 317, 331, 337 },
-			new int[]{ 347, 349, 353 },
-			new int[]{ 359, 367, 373 },
-			new int[]{ 379, 383, 389 },
-
-			new int[]{ 397, 401, 409 },
-			new int[]{ 419, 421, 431 },
-			new int[]{ 433, 439, 443 },
-			new int[]{ 449, 457, 461 },
-			new int[]{ 463, 467, 479 },
-
-			new int[]{ 487, 491, 499 },
-			new int[]{ 503, 509, 521 },
-			new int[]{ 523, 541, 547 },
-			new int[]{ 557, 563, 569 },
-			new int[]{ 571, 577, 587 },
-
-			new int[]{ 593, 599, 601 },
-			new int[]{ 607, 613, 617 },
-			new int[]{ 619, 631, 641 },
-			new int[]{ 643, 647, 653 },
-			new int[]{ 659, 661, 673 },
-
-			new int[]{ 677, 683, 691 },
-			new int[]{ 701, 709, 719 },
-			new int[]{ 727, 733, 739 },
-			new int[]{ 743, 751, 757 },
-			new int[]{ 761, 769, 773 },
-
-			new int[]{ 787, 797, 809 },
-			new int[]{ 811, 821, 823 },
-			new int[]{ 827, 829, 839 },
-			new int[]{ 853, 857, 859 },
-			new int[]{ 863, 877, 881 },
-
-			new int[]{ 883, 887, 907 },
-			new int[]{ 911, 919, 929 },
-			new int[]{ 937, 941, 947 },
-			new int[]{ 953, 967, 971 },
-			new int[]{ 977, 983, 991 },
+        internal static readonly int[][] primeLists = new int[][]
+        {
+            new int[]{ 3, 5, 7, 11, 13, 17, 19, 23 },
+            new int[]{ 29, 31, 37, 41, 43 },
+            new int[]{ 47, 53, 59, 61, 67 },
+            new int[]{ 71, 73, 79, 83 },
+            new int[]{ 89, 97, 101, 103 },
+
+            new int[]{ 107, 109, 113, 127 },
+            new int[]{ 131, 137, 139, 149 },
+            new int[]{ 151, 157, 163, 167 },
+            new int[]{ 173, 179, 181, 191 },
+            new int[]{ 193, 197, 199, 211 },
+
+            new int[]{ 223, 227, 229 },
+            new int[]{ 233, 239, 241 },
+            new int[]{ 251, 257, 263 },
+            new int[]{ 269, 271, 277 },
+            new int[]{ 281, 283, 293 },
+
+            new int[]{ 307, 311, 313 },
+            new int[]{ 317, 331, 337 },
+            new int[]{ 347, 349, 353 },
+            new int[]{ 359, 367, 373 },
+            new int[]{ 379, 383, 389 },
+
+            new int[]{ 397, 401, 409 },
+            new int[]{ 419, 421, 431 },
+            new int[]{ 433, 439, 443 },
+            new int[]{ 449, 457, 461 },
+            new int[]{ 463, 467, 479 },
+
+            new int[]{ 487, 491, 499 },
+            new int[]{ 503, 509, 521 },
+            new int[]{ 523, 541, 547 },
+            new int[]{ 557, 563, 569 },
+            new int[]{ 571, 577, 587 },
+
+            new int[]{ 593, 599, 601 },
+            new int[]{ 607, 613, 617 },
+            new int[]{ 619, 631, 641 },
+            new int[]{ 643, 647, 653 },
+            new int[]{ 659, 661, 673 },
+
+            new int[]{ 677, 683, 691 },
+            new int[]{ 701, 709, 719 },
+            new int[]{ 727, 733, 739 },
+            new int[]{ 743, 751, 757 },
+            new int[]{ 761, 769, 773 },
+
+            new int[]{ 787, 797, 809 },
+            new int[]{ 811, 821, 823 },
+            new int[]{ 827, 829, 839 },
+            new int[]{ 853, 857, 859 },
+            new int[]{ 863, 877, 881 },
+
+            new int[]{ 883, 887, 907 },
+            new int[]{ 911, 919, 929 },
+            new int[]{ 937, 941, 947 },
+            new int[]{ 953, 967, 971 },
+            new int[]{ 977, 983, 991 },
 
             new int[]{ 997, 1009, 1013 },
             new int[]{ 1019, 1021, 1031 },
@@ -122,15 +122,15 @@ namespace Org.BouncyCastle.Math
 
         internal static readonly int[] primeProducts;
 
-		private const long IMASK = 0xFFFFFFFFL;
+        private const long IMASK = 0xFFFFFFFFL;
         private const ulong UIMASK = 0xFFFFFFFFUL;
 
         private static readonly int[] ZeroMagnitude = new int[0];
-		private static readonly byte[] ZeroEncoding = new byte[0];
+        private static readonly byte[] ZeroEncoding = new byte[0];
 
         private static readonly BigInteger[] SMALL_CONSTANTS = new BigInteger[17];
-		public static readonly BigInteger Zero;
-		public static readonly BigInteger One;
+        public static readonly BigInteger Zero;
+        public static readonly BigInteger One;
         public static readonly BigInteger Two;
         public static readonly BigInteger Three;
         public static readonly BigInteger Ten;
@@ -156,8 +156,8 @@ namespace Org.BouncyCastle.Math
         //};
 
         private readonly static byte[] BitLengthTable =
-		{
-			0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
+        {
+            0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
             5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
             6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
             6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
@@ -173,11 +173,11 @@ namespace Org.BouncyCastle.Math
             8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
             8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
             8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
-		};
+        };
 
         // TODO Parse radix-2 64 bits at a time and radix-8 63 bits at a time
         private const int chunk2 = 1, chunk8 = 1, chunk10 = 19, chunk16 = 16;
-		private static readonly BigInteger radix2, radix2E, radix8, radix8E, radix10, radix10E, radix16, radix16E;
+        private static readonly BigInteger radix2, radix2E, radix8, radix8E, radix10, radix10E, radix16, radix16E;
 
         private static readonly Random RandomSource = new Random();
 
@@ -189,11 +189,11 @@ namespace Org.BouncyCastle.Math
         private static readonly int[] ExpWindowThresholds = { 7, 25, 81, 241, 673, 1793, 4609, Int32.MaxValue };
 
         private const int BitsPerByte = 8;
-		private const int BitsPerInt = 32;
-		private const int BytesPerInt = 4;
+        private const int BitsPerInt = 32;
+        private const int BytesPerInt = 4;
 
-		static BigInteger()
-		{
+        static BigInteger()
+        {
             Zero = new BigInteger(0, ZeroMagnitude, false);
             Zero.nBits = 0; Zero.nBitLength = 0;
 
@@ -215,105 +215,105 @@ namespace Org.BouncyCastle.Math
             radix8E = radix8.Pow(chunk8);
 
             radix10 = ValueOf(10);
-		    radix10E = radix10.Pow(chunk10);
+            radix10E = radix10.Pow(chunk10);
 
             radix16 = ValueOf(16);
             radix16E = radix16.Pow(chunk16);
 
             primeProducts = new int[primeLists.Length];
 
-			for (int i = 0; i < primeLists.Length; ++i)
-			{
-				int[] primeList = primeLists[i];
-				int product = primeList[0];
-				for (int j = 1; j < primeList.Length; ++j)
-				{
-					product *= primeList[j];
-				}
-				primeProducts[i] = product;
-			}
-		}
-
-		private int[] magnitude; // array of ints with [0] being the most significant
+            for (int i = 0; i < primeLists.Length; ++i)
+            {
+                int[] primeList = primeLists[i];
+                int product = primeList[0];
+                for (int j = 1; j < primeList.Length; ++j)
+                {
+                    product *= primeList[j];
+                }
+                primeProducts[i] = product;
+            }
+        }
+
+        private int[] magnitude; // array of ints with [0] being the most significant
         private int sign; // -1 means -ve; +1 means +ve; 0 means 0;
-		private int nBits = -1; // cache BitCount() value
-		private int nBitLength = -1; // cache BitLength() value
+        private int nBits = -1; // cache BitCount() value
+        private int nBitLength = -1; // cache BitLength() value
         private int mQuote = 0; // -m^(-1) mod b, b = 2^32 (see Montgomery mult.), 0 when uninitialised
 
         private static int GetByteLength(
-			int nBits)
-		{
-			return (nBits + BitsPerByte - 1) / BitsPerByte;
-		}
-
-		private BigInteger(
-			int		signum,
-			int[]	mag,
-			bool	checkMag)
-		{
-			if (checkMag)
-			{
-				int i = 0;
-				while (i < mag.Length && mag[i] == 0)
-				{
-					++i;
-				}
-
-				if (i == mag.Length)
-				{
-					this.sign = 0;
-					this.magnitude = ZeroMagnitude;
-				}
-				else
-				{
-					this.sign = signum;
-
-					if (i == 0)
-					{
-						this.magnitude = mag;
-					}
-					else
-					{
-						// strip leading 0 words
-						this.magnitude = new int[mag.Length - i];
-						Array.Copy(mag, i, this.magnitude, 0, this.magnitude.Length);
-					}
-				}
-			}
-			else
-			{
-				this.sign = signum;
-				this.magnitude = mag;
-			}
-		}
-
-		public BigInteger(
-			string value)
-			: this(value, 10)
-		{
-		}
-
-		public BigInteger(
-			string	str,
-			int		radix)
-		{
-			if (str.Length == 0)
-				throw new FormatException("Zero length BigInteger");
-
-			NumberStyles style;
-			int chunk;
-			BigInteger r;
-			BigInteger rE;
-
-			switch (radix)
-			{
-				case 2:
-					// Is there anyway to restrict to binary digits?
-					style = NumberStyles.Integer;
-					chunk = chunk2;
-					r = radix2;
-					rE = radix2E;
-					break;
+            int nBits)
+        {
+            return (nBits + BitsPerByte - 1) / BitsPerByte;
+        }
+
+        private BigInteger(
+            int		signum,
+            int[]	mag,
+            bool	checkMag)
+        {
+            if (checkMag)
+            {
+                int i = 0;
+                while (i < mag.Length && mag[i] == 0)
+                {
+                    ++i;
+                }
+
+                if (i == mag.Length)
+                {
+                    this.sign = 0;
+                    this.magnitude = ZeroMagnitude;
+                }
+                else
+                {
+                    this.sign = signum;
+
+                    if (i == 0)
+                    {
+                        this.magnitude = mag;
+                    }
+                    else
+                    {
+                        // strip leading 0 words
+                        this.magnitude = new int[mag.Length - i];
+                        Array.Copy(mag, i, this.magnitude, 0, this.magnitude.Length);
+                    }
+                }
+            }
+            else
+            {
+                this.sign = signum;
+                this.magnitude = mag;
+            }
+        }
+
+        public BigInteger(
+            string value)
+            : this(value, 10)
+        {
+        }
+
+        public BigInteger(
+            string	str,
+            int		radix)
+        {
+            if (str.Length == 0)
+                throw new FormatException("Zero length BigInteger");
+
+            NumberStyles style;
+            int chunk;
+            BigInteger r;
+            BigInteger rE;
+
+            switch (radix)
+            {
+                case 2:
+                    // Is there anyway to restrict to binary digits?
+                    style = NumberStyles.Integer;
+                    chunk = chunk2;
+                    r = radix2;
+                    rE = radix2E;
+                    break;
                 case 8:
                     // Is there anyway to restrict to octal digits?
                     style = NumberStyles.Integer;
@@ -322,79 +322,79 @@ namespace Org.BouncyCastle.Math
                     rE = radix8E;
                     break;
                 case 10:
-					// This style seems to handle spaces and minus sign already (our processing redundant?)
-					style = NumberStyles.Integer;
-					chunk = chunk10;
-					r = radix10;
-					rE = radix10E;
-					break;
-				case 16:
-					// TODO Should this be HexNumber?
-					style = NumberStyles.AllowHexSpecifier;
-					chunk = chunk16;
-					r = radix16;
-					rE = radix16E;
-					break;
-				default:
-					throw new FormatException("Only bases 2, 8, 10, or 16 allowed");
-			}
-
-
-			int index = 0;
-			sign = 1;
-
-			if (str[0] == '-')
-			{
-				if (str.Length == 1)
-					throw new FormatException("Zero length BigInteger");
-
-				sign = -1;
-				index = 1;
-			}
-
-			// strip leading zeros from the string str
-			while (index < str.Length && Int32.Parse(str[index].ToString(), style) == 0)
-			{
-				index++;
-			}
-
-			if (index >= str.Length)
-			{
-				// zero value - we're done
-				sign = 0;
-				magnitude = ZeroMagnitude;
-				return;
-			}
-
-			//////
-			// could we work out the max number of ints required to store
-			// str.Length digits in the given base, then allocate that
-			// storage in one hit?, then Generate the magnitude in one hit too?
-			//////
-
-			BigInteger b = Zero;
-
-
-			int next = index + chunk;
-
-			if (next <= str.Length)
-			{
-				do
-				{
-					string s = str.Substring(index, chunk);
-					ulong i = ulong.Parse(s, style);
-					BigInteger bi = CreateUValueOf(i);
-
-					switch (radix)
-					{
-						case 2:
-							// TODO Need this because we are parsing in radix 10 above
-							if (i >= 2)
-								throw new FormatException("Bad character in radix 2 string: " + s);
-
-							// TODO Parse 64 bits at a time
-							b = b.ShiftLeft(1);
-							break;
+                    // This style seems to handle spaces and minus sign already (our processing redundant?)
+                    style = NumberStyles.Integer;
+                    chunk = chunk10;
+                    r = radix10;
+                    rE = radix10E;
+                    break;
+                case 16:
+                    // TODO Should this be HexNumber?
+                    style = NumberStyles.AllowHexSpecifier;
+                    chunk = chunk16;
+                    r = radix16;
+                    rE = radix16E;
+                    break;
+                default:
+                    throw new FormatException("Only bases 2, 8, 10, or 16 allowed");
+            }
+
+
+            int index = 0;
+            sign = 1;
+
+            if (str[0] == '-')
+            {
+                if (str.Length == 1)
+                    throw new FormatException("Zero length BigInteger");
+
+                sign = -1;
+                index = 1;
+            }
+
+            // strip leading zeros from the string str
+            while (index < str.Length && Int32.Parse(str[index].ToString(), style) == 0)
+            {
+                index++;
+            }
+
+            if (index >= str.Length)
+            {
+                // zero value - we're done
+                sign = 0;
+                magnitude = ZeroMagnitude;
+                return;
+            }
+
+            //////
+            // could we work out the max number of ints required to store
+            // str.Length digits in the given base, then allocate that
+            // storage in one hit?, then Generate the magnitude in one hit too?
+            //////
+
+            BigInteger b = Zero;
+
+
+            int next = index + chunk;
+
+            if (next <= str.Length)
+            {
+                do
+                {
+                    string s = str.Substring(index, chunk);
+                    ulong i = ulong.Parse(s, style);
+                    BigInteger bi = CreateUValueOf(i);
+
+                    switch (radix)
+                    {
+                        case 2:
+                            // TODO Need this because we are parsing in radix 10 above
+                            if (i >= 2)
+                                throw new FormatException("Bad character in radix 2 string: " + s);
+
+                            // TODO Parse 64 bits at a time
+                            b = b.ShiftLeft(1);
+                            break;
                         case 8:
                             // TODO Need this because we are parsing in radix 10 above
                             if (i >= 8)
@@ -404,37 +404,37 @@ namespace Org.BouncyCastle.Math
                             b = b.ShiftLeft(3);
                             break;
                         case 16:
-							b = b.ShiftLeft(64);
-							break;
-						default:
-							b = b.Multiply(rE);
-							break;
-					}
-
-					b = b.Add(bi);
-
-					index = next;
-					next += chunk;
-				}
-				while (next <= str.Length);
-			}
-
-			if (index < str.Length)
-			{
-				string s = str.Substring(index);
-				ulong i = ulong.Parse(s, style);
-				BigInteger bi = CreateUValueOf(i);
-
-				if (b.sign > 0)
-				{
-					if (radix == 2)
-					{
-						// NB: Can't reach here since we are parsing one char at a time
-						Debug.Assert(false);
-
-						// TODO Parse all bits at once
+                            b = b.ShiftLeft(64);
+                            break;
+                        default:
+                            b = b.Multiply(rE);
+                            break;
+                    }
+
+                    b = b.Add(bi);
+
+                    index = next;
+                    next += chunk;
+                }
+                while (next <= str.Length);
+            }
+
+            if (index < str.Length)
+            {
+                string s = str.Substring(index);
+                ulong i = ulong.Parse(s, style);
+                BigInteger bi = CreateUValueOf(i);
+
+                if (b.sign > 0)
+                {
+                    if (radix == 2)
+                    {
+                        // NB: Can't reach here since we are parsing one char at a time
+                        Debug.Assert(false);
+
+                        // TODO Parse all bits at once
 //						b = b.ShiftLeft(s.Length);
-					}
+                    }
                     else if (radix == 8)
                     {
                         // NB: Can't reach here since we are parsing one char at a time
@@ -444,21 +444,21 @@ namespace Org.BouncyCastle.Math
 //						b = b.ShiftLeft(s.Length * 3);
                     }
                     else if (radix == 16)
-					{
-						b = b.ShiftLeft(s.Length << 2);
-					}
-					else
-					{
-						b = b.Multiply(r.Pow(s.Length));
-					}
-
-					b = b.Add(bi);
-				}
-				else
-				{
-					b = bi;
-				}
-			}
+                    {
+                        b = b.ShiftLeft(s.Length << 2);
+                    }
+                    else
+                    {
+                        b = b.Multiply(r.Pow(s.Length));
+                    }
+
+                    b = b.Add(bi);
+                }
+                else
+                {
+                    b = bi;
+                }
+            }
 
             // Note: This is the previous (slower) algorithm
 //			while (index < value.Length)
@@ -471,429 +471,429 @@ namespace Org.BouncyCastle.Math
 //                index++;
 //            }
 
-			magnitude = b.magnitude;
-		}
-
-		public BigInteger(
-			byte[] bytes)
-			: this(bytes, 0, bytes.Length)
-		{
-		}
-
-		public BigInteger(
-			byte[]	bytes,
-			int		offset,
-			int		length)
-		{
-			if (length == 0)
-				throw new FormatException("Zero length BigInteger");
-
-			// TODO Move this processing into MakeMagnitude (provide sign argument)
-			if ((sbyte)bytes[offset] < 0)
-			{
-				this.sign = -1;
-
-				int end = offset + length;
-
-				int iBval;
-				// strip leading sign bytes
-				for (iBval = offset; iBval < end && ((sbyte)bytes[iBval] == -1); iBval++)
-				{
-				}
-
-				if (iBval >= end)
-				{
-					this.magnitude = One.magnitude;
-				}
-				else
-				{
-					int numBytes = end - iBval;
-					byte[] inverse = new byte[numBytes];
-
-					int index = 0;
-					while (index < numBytes)
-					{
-						inverse[index++] = (byte)~bytes[iBval++];
-					}
-
-					Debug.Assert(iBval == end);
-
-					while (inverse[--index] == byte.MaxValue)
-					{
-						inverse[index] = byte.MinValue;
-					}
-
-					inverse[index]++;
-
-					this.magnitude = MakeMagnitude(inverse, 0, inverse.Length);
-				}
-			}
-			else
-			{
-				// strip leading zero bytes and return magnitude bytes
-				this.magnitude = MakeMagnitude(bytes, offset, length);
-				this.sign = this.magnitude.Length > 0 ? 1 : 0;
-			}
-		}
-
-		private static int[] MakeMagnitude(
-			byte[]	bytes,
-			int		offset,
-			int		length)
-		{
-			int end = offset + length;
-
-			// strip leading zeros
-			int firstSignificant;
-			for (firstSignificant = offset; firstSignificant < end
-				&& bytes[firstSignificant] == 0; firstSignificant++)
-			{
-			}
-
-			if (firstSignificant >= end)
-			{
-				return ZeroMagnitude;
-			}
-
-			int nInts = (end - firstSignificant + 3) / BytesPerInt;
-			int bCount = (end - firstSignificant) % BytesPerInt;
-			if (bCount == 0)
-			{
-				bCount = BytesPerInt;
-			}
-
-			if (nInts < 1)
-			{
-				return ZeroMagnitude;
-			}
-
-			int[] mag = new int[nInts];
-
-			int v = 0;
-			int magnitudeIndex = 0;
-			for (int i = firstSignificant; i < end; ++i)
-			{
-				v <<= 8;
-				v |= bytes[i] & 0xff;
-				bCount--;
-				if (bCount <= 0)
-				{
-					mag[magnitudeIndex] = v;
-					magnitudeIndex++;
-					bCount = BytesPerInt;
-					v = 0;
-				}
-			}
-
-			if (magnitudeIndex < mag.Length)
-			{
-				mag[magnitudeIndex] = v;
-			}
-
-			return mag;
-		}
-
-		public BigInteger(
-			int		sign,
-			byte[]	bytes)
-			: this(sign, bytes, 0, bytes.Length)
-		{
-		}
-
-		public BigInteger(
-			int		sign,
-			byte[]	bytes,
-			int		offset,
-			int		length)
-		{
-			if (sign < -1 || sign > 1)
-				throw new FormatException("Invalid sign value");
-
-			if (sign == 0)
-			{
-				this.sign = 0;
-				this.magnitude = ZeroMagnitude;
-			}
-			else
-			{
-				// copy bytes
-				this.magnitude = MakeMagnitude(bytes, offset, length);
-				this.sign = this.magnitude.Length < 1 ? 0 : sign;
-			}
-		}
-
-		public BigInteger(
-			int		sizeInBits,
-			Random	random)
-		{
-			if (sizeInBits < 0)
-				throw new ArgumentException("sizeInBits must be non-negative");
-
-			this.nBits = -1;
-			this.nBitLength = -1;
-
-			if (sizeInBits == 0)
-			{
-				this.sign = 0;
-				this.magnitude = ZeroMagnitude;
-				return;
-			}
-
-			int nBytes = GetByteLength(sizeInBits);
-			byte[] b = new byte[nBytes];
-			random.NextBytes(b);
-
-			// strip off any excess bits in the MSB
+            magnitude = b.magnitude;
+        }
+
+        public BigInteger(
+            byte[] bytes)
+            : this(bytes, 0, bytes.Length)
+        {
+        }
+
+        public BigInteger(
+            byte[]	bytes,
+            int		offset,
+            int		length)
+        {
+            if (length == 0)
+                throw new FormatException("Zero length BigInteger");
+
+            // TODO Move this processing into MakeMagnitude (provide sign argument)
+            if ((sbyte)bytes[offset] < 0)
+            {
+                this.sign = -1;
+
+                int end = offset + length;
+
+                int iBval;
+                // strip leading sign bytes
+                for (iBval = offset; iBval < end && ((sbyte)bytes[iBval] == -1); iBval++)
+                {
+                }
+
+                if (iBval >= end)
+                {
+                    this.magnitude = One.magnitude;
+                }
+                else
+                {
+                    int numBytes = end - iBval;
+                    byte[] inverse = new byte[numBytes];
+
+                    int index = 0;
+                    while (index < numBytes)
+                    {
+                        inverse[index++] = (byte)~bytes[iBval++];
+                    }
+
+                    Debug.Assert(iBval == end);
+
+                    while (inverse[--index] == byte.MaxValue)
+                    {
+                        inverse[index] = byte.MinValue;
+                    }
+
+                    inverse[index]++;
+
+                    this.magnitude = MakeMagnitude(inverse, 0, inverse.Length);
+                }
+            }
+            else
+            {
+                // strip leading zero bytes and return magnitude bytes
+                this.magnitude = MakeMagnitude(bytes, offset, length);
+                this.sign = this.magnitude.Length > 0 ? 1 : 0;
+            }
+        }
+
+        private static int[] MakeMagnitude(
+            byte[]	bytes,
+            int		offset,
+            int		length)
+        {
+            int end = offset + length;
+
+            // strip leading zeros
+            int firstSignificant;
+            for (firstSignificant = offset; firstSignificant < end
+                && bytes[firstSignificant] == 0; firstSignificant++)
+            {
+            }
+
+            if (firstSignificant >= end)
+            {
+                return ZeroMagnitude;
+            }
+
+            int nInts = (end - firstSignificant + 3) / BytesPerInt;
+            int bCount = (end - firstSignificant) % BytesPerInt;
+            if (bCount == 0)
+            {
+                bCount = BytesPerInt;
+            }
+
+            if (nInts < 1)
+            {
+                return ZeroMagnitude;
+            }
+
+            int[] mag = new int[nInts];
+
+            int v = 0;
+            int magnitudeIndex = 0;
+            for (int i = firstSignificant; i < end; ++i)
+            {
+                v <<= 8;
+                v |= bytes[i] & 0xff;
+                bCount--;
+                if (bCount <= 0)
+                {
+                    mag[magnitudeIndex] = v;
+                    magnitudeIndex++;
+                    bCount = BytesPerInt;
+                    v = 0;
+                }
+            }
+
+            if (magnitudeIndex < mag.Length)
+            {
+                mag[magnitudeIndex] = v;
+            }
+
+            return mag;
+        }
+
+        public BigInteger(
+            int		sign,
+            byte[]	bytes)
+            : this(sign, bytes, 0, bytes.Length)
+        {
+        }
+
+        public BigInteger(
+            int		sign,
+            byte[]	bytes,
+            int		offset,
+            int		length)
+        {
+            if (sign < -1 || sign > 1)
+                throw new FormatException("Invalid sign value");
+
+            if (sign == 0)
+            {
+                this.sign = 0;
+                this.magnitude = ZeroMagnitude;
+            }
+            else
+            {
+                // copy bytes
+                this.magnitude = MakeMagnitude(bytes, offset, length);
+                this.sign = this.magnitude.Length < 1 ? 0 : sign;
+            }
+        }
+
+        public BigInteger(
+            int		sizeInBits,
+            Random	random)
+        {
+            if (sizeInBits < 0)
+                throw new ArgumentException("sizeInBits must be non-negative");
+
+            this.nBits = -1;
+            this.nBitLength = -1;
+
+            if (sizeInBits == 0)
+            {
+                this.sign = 0;
+                this.magnitude = ZeroMagnitude;
+                return;
+            }
+
+            int nBytes = GetByteLength(sizeInBits);
+            byte[] b = new byte[nBytes];
+            random.NextBytes(b);
+
+            // strip off any excess bits in the MSB
             int xBits = BitsPerByte * nBytes - sizeInBits;
             b[0] &= (byte)(255U >> xBits);
 
             this.magnitude = MakeMagnitude(b, 0, b.Length);
-			this.sign = this.magnitude.Length < 1 ? 0 : 1;
-		}
+            this.sign = this.magnitude.Length < 1 ? 0 : 1;
+        }
 
         public BigInteger(
-			int		bitLength,
-			int		certainty,
-			Random	random)
-		{
-			if (bitLength < 2)
-				throw new ArithmeticException("bitLength < 2");
-
-			this.sign = 1;
-			this.nBitLength = bitLength;
-
-			if (bitLength == 2)
-			{
-				this.magnitude = random.Next(2) == 0
-					?	Two.magnitude
-					:	Three.magnitude;
-				return;
-			}
+            int		bitLength,
+            int		certainty,
+            Random	random)
+        {
+            if (bitLength < 2)
+                throw new ArithmeticException("bitLength < 2");
+
+            this.sign = 1;
+            this.nBitLength = bitLength;
+
+            if (bitLength == 2)
+            {
+                this.magnitude = random.Next(2) == 0
+                    ?	Two.magnitude
+                    :	Three.magnitude;
+                return;
+            }
              
-			int nBytes = GetByteLength(bitLength);
-			byte[] b = new byte[nBytes];
+            int nBytes = GetByteLength(bitLength);
+            byte[] b = new byte[nBytes];
 
-			int xBits = BitsPerByte * nBytes - bitLength;
+            int xBits = BitsPerByte * nBytes - bitLength;
             byte mask = (byte)(255U >> xBits);
 
             for (;;)
-			{
-				random.NextBytes(b);
-
-				// strip off any excess bits in the MSB
-				b[0] &= mask;
-
-				// ensure the leading bit is 1 (to meet the strength requirement)
-				b[0] |= (byte)(1 << (7 - xBits));
-
-				// ensure the trailing bit is 1 (i.e. must be odd)
-				b[nBytes - 1] |= 1;
-
-				this.magnitude = MakeMagnitude(b, 0, b.Length);
-				this.nBits = -1;
-				this.mQuote = 0;
-
-				if (certainty < 1)
-					break;
-
-				if (CheckProbablePrime(certainty, random))
-					break;
-
-				if (bitLength > 32)
-				{
-					for (int rep = 0; rep < 10000; ++rep)
-					{
-						int n = 33 + random.Next(bitLength - 2);
-						this.magnitude[this.magnitude.Length - (n >> 5)] ^= (1 << (n & 31));
-						this.magnitude[this.magnitude.Length - 1] ^= ((random.Next() + 1) << 1);
-						this.mQuote = 0;
-
-						if (CheckProbablePrime(certainty, random))
-							return;
-					}
-				}
-			}
-		}
-
-		public BigInteger Abs()
-		{
-			return sign >= 0 ? this : Negate();
-		}
-
-		/**
-		 * return a = a + b - b preserved.
-		 */
-		private static int[] AddMagnitudes(
-			int[] a,
-			int[] b)
-		{
-			int tI = a.Length - 1;
-			int vI = b.Length - 1;
-			long m = 0;
-
-			while (vI >= 0)
-			{
-				m += ((long)(uint)a[tI] + (long)(uint)b[vI--]);
-				a[tI--] = (int)m;
-				m = (long)((ulong)m >> 32);
-			}
-
-			if (m != 0)
-			{
-				while (tI >= 0 && ++a[tI--] == 0)
-				{
-				}
-			}
-
-			return a;
-		}
-
-		public BigInteger Add(
-			BigInteger value)
-		{
-			if (this.sign == 0)
-				return value;
-
-			if (this.sign != value.sign)
-			{
-				if (value.sign == 0)
-					return this;
-
-				if (value.sign < 0)
-					return Subtract(value.Negate());
-
-				return value.Subtract(Negate());
-			}
-
-			return AddToMagnitude(value.magnitude);
-		}
-
-		private BigInteger AddToMagnitude(
-			int[] magToAdd)
-		{
-			int[] big, small;
-			if (this.magnitude.Length < magToAdd.Length)
-			{
-				big = magToAdd;
-				small = this.magnitude;
-			}
-			else
-			{
-				big = this.magnitude;
-				small = magToAdd;
-			}
-
-			// Conservatively avoid over-allocation when no overflow possible
-			uint limit = uint.MaxValue;
-			if (big.Length == small.Length)
-				limit -= (uint) small[0];
-
-			bool possibleOverflow = (uint) big[0] >= limit;
-
-			int[] bigCopy;
-			if (possibleOverflow)
-			{
-				bigCopy = new int[big.Length + 1];
-				big.CopyTo(bigCopy, 1);
-			}
-			else
-			{
-				bigCopy = (int[]) big.Clone();
-			}
-
-			bigCopy = AddMagnitudes(bigCopy, small);
-
-			return new BigInteger(this.sign, bigCopy, possibleOverflow);
-		}
-
-		public BigInteger And(
-			BigInteger value)
-		{
-			if (this.sign == 0 || value.sign == 0)
-			{
-				return Zero;
-			}
-
-			int[] aMag = this.sign > 0
-				? this.magnitude
-				: Add(One).magnitude;
-
-			int[] bMag = value.sign > 0
-				? value.magnitude
-				: value.Add(One).magnitude;
-
-			bool resultNeg = sign < 0 && value.sign < 0;
-			int resultLength = System.Math.Max(aMag.Length, bMag.Length);
-			int[] resultMag = new int[resultLength];
-
-			int aStart = resultMag.Length - aMag.Length;
-			int bStart = resultMag.Length - bMag.Length;
-
-			for (int i = 0; i < resultMag.Length; ++i)
-			{
-				int aWord = i >= aStart ? aMag[i - aStart] : 0;
-				int bWord = i >= bStart ? bMag[i - bStart] : 0;
-
-				if (this.sign < 0)
-				{
-					aWord = ~aWord;
-				}
-
-				if (value.sign < 0)
-				{
-					bWord = ~bWord;
-				}
-
-				resultMag[i] = aWord & bWord;
-
-				if (resultNeg)
-				{
-					resultMag[i] = ~resultMag[i];
-				}
-			}
-
-			BigInteger result = new BigInteger(1, resultMag, true);
-
-			// TODO Optimise this case
-			if (resultNeg)
-			{
-				result = result.Not();
-			}
-
-			return result;
-		}
-
-		public BigInteger AndNot(
-			BigInteger val)
-		{
-			return And(val.Not());
-		}
-
-		public int BitCount
-		{
-			get
-			{
-				if (nBits == -1)
-				{
-					if (sign < 0)
-					{
-						// TODO Optimise this case
-						nBits = Not().BitCount;
-					}
-					else
-					{
-						int sum = 0;
-						for (int i = 0; i < magnitude.Length; ++i)
-						{
+            {
+                random.NextBytes(b);
+
+                // strip off any excess bits in the MSB
+                b[0] &= mask;
+
+                // ensure the leading bit is 1 (to meet the strength requirement)
+                b[0] |= (byte)(1 << (7 - xBits));
+
+                // ensure the trailing bit is 1 (i.e. must be odd)
+                b[nBytes - 1] |= 1;
+
+                this.magnitude = MakeMagnitude(b, 0, b.Length);
+                this.nBits = -1;
+                this.mQuote = 0;
+
+                if (certainty < 1)
+                    break;
+
+                if (CheckProbablePrime(certainty, random))
+                    break;
+
+                if (bitLength > 32)
+                {
+                    for (int rep = 0; rep < 10000; ++rep)
+                    {
+                        int n = 33 + random.Next(bitLength - 2);
+                        this.magnitude[this.magnitude.Length - (n >> 5)] ^= (1 << (n & 31));
+                        this.magnitude[this.magnitude.Length - 1] ^= ((random.Next() + 1) << 1);
+                        this.mQuote = 0;
+
+                        if (CheckProbablePrime(certainty, random))
+                            return;
+                    }
+                }
+            }
+        }
+
+        public BigInteger Abs()
+        {
+            return sign >= 0 ? this : Negate();
+        }
+
+        /**
+         * return a = a + b - b preserved.
+         */
+        private static int[] AddMagnitudes(
+            int[] a,
+            int[] b)
+        {
+            int tI = a.Length - 1;
+            int vI = b.Length - 1;
+            long m = 0;
+
+            while (vI >= 0)
+            {
+                m += ((long)(uint)a[tI] + (long)(uint)b[vI--]);
+                a[tI--] = (int)m;
+                m = (long)((ulong)m >> 32);
+            }
+
+            if (m != 0)
+            {
+                while (tI >= 0 && ++a[tI--] == 0)
+                {
+                }
+            }
+
+            return a;
+        }
+
+        public BigInteger Add(
+            BigInteger value)
+        {
+            if (this.sign == 0)
+                return value;
+
+            if (this.sign != value.sign)
+            {
+                if (value.sign == 0)
+                    return this;
+
+                if (value.sign < 0)
+                    return Subtract(value.Negate());
+
+                return value.Subtract(Negate());
+            }
+
+            return AddToMagnitude(value.magnitude);
+        }
+
+        private BigInteger AddToMagnitude(
+            int[] magToAdd)
+        {
+            int[] big, small;
+            if (this.magnitude.Length < magToAdd.Length)
+            {
+                big = magToAdd;
+                small = this.magnitude;
+            }
+            else
+            {
+                big = this.magnitude;
+                small = magToAdd;
+            }
+
+            // Conservatively avoid over-allocation when no overflow possible
+            uint limit = uint.MaxValue;
+            if (big.Length == small.Length)
+                limit -= (uint) small[0];
+
+            bool possibleOverflow = (uint) big[0] >= limit;
+
+            int[] bigCopy;
+            if (possibleOverflow)
+            {
+                bigCopy = new int[big.Length + 1];
+                big.CopyTo(bigCopy, 1);
+            }
+            else
+            {
+                bigCopy = (int[]) big.Clone();
+            }
+
+            bigCopy = AddMagnitudes(bigCopy, small);
+
+            return new BigInteger(this.sign, bigCopy, possibleOverflow);
+        }
+
+        public BigInteger And(
+            BigInteger value)
+        {
+            if (this.sign == 0 || value.sign == 0)
+            {
+                return Zero;
+            }
+
+            int[] aMag = this.sign > 0
+                ? this.magnitude
+                : Add(One).magnitude;
+
+            int[] bMag = value.sign > 0
+                ? value.magnitude
+                : value.Add(One).magnitude;
+
+            bool resultNeg = sign < 0 && value.sign < 0;
+            int resultLength = System.Math.Max(aMag.Length, bMag.Length);
+            int[] resultMag = new int[resultLength];
+
+            int aStart = resultMag.Length - aMag.Length;
+            int bStart = resultMag.Length - bMag.Length;
+
+            for (int i = 0; i < resultMag.Length; ++i)
+            {
+                int aWord = i >= aStart ? aMag[i - aStart] : 0;
+                int bWord = i >= bStart ? bMag[i - bStart] : 0;
+
+                if (this.sign < 0)
+                {
+                    aWord = ~aWord;
+                }
+
+                if (value.sign < 0)
+                {
+                    bWord = ~bWord;
+                }
+
+                resultMag[i] = aWord & bWord;
+
+                if (resultNeg)
+                {
+                    resultMag[i] = ~resultMag[i];
+                }
+            }
+
+            BigInteger result = new BigInteger(1, resultMag, true);
+
+            // TODO Optimise this case
+            if (resultNeg)
+            {
+                result = result.Not();
+            }
+
+            return result;
+        }
+
+        public BigInteger AndNot(
+            BigInteger val)
+        {
+            return And(val.Not());
+        }
+
+        public int BitCount
+        {
+            get
+            {
+                if (nBits == -1)
+                {
+                    if (sign < 0)
+                    {
+                        // TODO Optimise this case
+                        nBits = Not().BitCount;
+                    }
+                    else
+                    {
+                        int sum = 0;
+                        for (int i = 0; i < magnitude.Length; ++i)
+                        {
                             sum += BitCnt(magnitude[i]);
-						}
-						nBits = sum;
-					}
-				}
+                        }
+                        nBits = sum;
+                    }
+                }
 
-				return nBits;
-			}
-		}
+                return nBits;
+            }
+        }
 
         public static int BitCnt(int i)
         {
@@ -908,62 +908,62 @@ namespace Org.BouncyCastle.Math
         }
 
         private static int CalcBitLength(int sign, int indx, int[]	mag)
-		{
-			for (;;)
-			{
-				if (indx >= mag.Length)
-					return 0;
+        {
+            for (;;)
+            {
+                if (indx >= mag.Length)
+                    return 0;
 
                 if (mag[indx] != 0)
-					break;
-
-				++indx;
-			}
-
-			// bit length for everything after the first int
-			int bitLength = 32 * ((mag.Length - indx) - 1);
-
-			// and determine bitlength of first int
-			int firstMag = mag[indx];
-			bitLength += BitLen(firstMag);
-
-			// Check for negative powers of two
-			if (sign < 0 && ((firstMag & -firstMag) == firstMag))
-			{
-				do
-				{
-					if (++indx >= mag.Length)
-					{
-						--bitLength;
-						break;
-					}
-				}
-				while (mag[indx] == 0);
-			}
-
-			return bitLength;
-		}
-
-		public int BitLength
-		{
-			get
-			{
-				if (nBitLength == -1)
-				{
-					nBitLength = sign == 0
-						? 0
-						: CalcBitLength(sign, 0, magnitude);
-				}
-
-				return nBitLength;
-			}
-		}
-
-		//
-		// BitLen(value) is the number of bits in value.
-		//
-		private static int BitLen(int w)
-		{
+                    break;
+
+                ++indx;
+            }
+
+            // bit length for everything after the first int
+            int bitLength = 32 * ((mag.Length - indx) - 1);
+
+            // and determine bitlength of first int
+            int firstMag = mag[indx];
+            bitLength += BitLen(firstMag);
+
+            // Check for negative powers of two
+            if (sign < 0 && ((firstMag & -firstMag) == firstMag))
+            {
+                do
+                {
+                    if (++indx >= mag.Length)
+                    {
+                        --bitLength;
+                        break;
+                    }
+                }
+                while (mag[indx] == 0);
+            }
+
+            return bitLength;
+        }
+
+        public int BitLength
+        {
+            get
+            {
+                if (nBitLength == -1)
+                {
+                    nBitLength = sign == 0
+                        ? 0
+                        : CalcBitLength(sign, 0, magnitude);
+                }
+
+                return nBitLength;
+            }
+        }
+
+        //
+        // BitLen(value) is the number of bits in value.
+        //
+        private static int BitLen(int w)
+        {
             uint v = (uint)w;
             uint t = v >> 24;
             if (t != 0)
@@ -975,280 +975,280 @@ namespace Org.BouncyCastle.Math
             if (t != 0)
                 return 8 + BitLengthTable[t];
             return BitLengthTable[v];
-		}
+        }
 
         private bool QuickPow2Check()
-		{
-			return sign > 0 && nBits == 1;
-		}
-
-		public int CompareTo(
-			object obj)
-		{
-			return CompareTo((BigInteger)obj);
-		}
-
-		/**
-		 * unsigned comparison on two arrays - note the arrays may
-		 * start with leading zeros.
-		 */
-		private static int CompareTo(
-			int		xIndx,
-			int[]	x,
-			int		yIndx,
-			int[]	y)
-		{
-			while (xIndx != x.Length && x[xIndx] == 0)
-			{
-				xIndx++;
-			}
-
-			while (yIndx != y.Length && y[yIndx] == 0)
-			{
-				yIndx++;
-			}
-
-			return CompareNoLeadingZeroes(xIndx, x, yIndx, y);
-		}
-
-		private static int CompareNoLeadingZeroes(
-			int		xIndx,
-			int[]	x,
-			int		yIndx,
-			int[]	y)
-		{
-			int diff = (x.Length - y.Length) - (xIndx - yIndx);
-
-			if (diff != 0)
-			{
-				return diff < 0 ? -1 : 1;
-			}
-
-			// lengths of magnitudes the same, test the magnitude values
-
-			while (xIndx < x.Length)
-			{
-				uint v1 = (uint)x[xIndx++];
-				uint v2 = (uint)y[yIndx++];
-
-				if (v1 != v2)
-					return v1 < v2 ? -1 : 1;
-			}
-
-			return 0;
-		}
-
-		public int CompareTo(
-			BigInteger value)
-		{
-			return sign < value.sign ? -1
-				: sign > value.sign ? 1
-				: sign == 0 ? 0
-				: sign * CompareNoLeadingZeroes(0, magnitude, 0, value.magnitude);
-		}
-
-		/**
-		 * return z = x / y - done in place (z value preserved, x contains the
-		 * remainder)
-		 */
-		private int[] Divide(
-			int[]	x,
-			int[]	y)
-		{
-			int xStart = 0;
-			while (xStart < x.Length && x[xStart] == 0)
-			{
-				++xStart;
-			}
-
-			int yStart = 0;
-			while (yStart < y.Length && y[yStart] == 0)
-			{
-				++yStart;
-			}
-
-			Debug.Assert(yStart < y.Length);
-
-			int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
-			int[] count;
-
-			if (xyCmp > 0)
-			{
-				int yBitLength = CalcBitLength(1, yStart, y);
-				int xBitLength = CalcBitLength(1, xStart, x);
-				int shift = xBitLength - yBitLength;
-
-				int[] iCount;
-				int iCountStart = 0;
-
-				int[] c;
-				int cStart = 0;
-				int cBitLength = yBitLength;
-				if (shift > 0)
-				{
+        {
+            return sign > 0 && nBits == 1;
+        }
+
+        public int CompareTo(
+            object obj)
+        {
+            return CompareTo((BigInteger)obj);
+        }
+
+        /**
+         * unsigned comparison on two arrays - note the arrays may
+         * start with leading zeros.
+         */
+        private static int CompareTo(
+            int		xIndx,
+            int[]	x,
+            int		yIndx,
+            int[]	y)
+        {
+            while (xIndx != x.Length && x[xIndx] == 0)
+            {
+                xIndx++;
+            }
+
+            while (yIndx != y.Length && y[yIndx] == 0)
+            {
+                yIndx++;
+            }
+
+            return CompareNoLeadingZeroes(xIndx, x, yIndx, y);
+        }
+
+        private static int CompareNoLeadingZeroes(
+            int		xIndx,
+            int[]	x,
+            int		yIndx,
+            int[]	y)
+        {
+            int diff = (x.Length - y.Length) - (xIndx - yIndx);
+
+            if (diff != 0)
+            {
+                return diff < 0 ? -1 : 1;
+            }
+
+            // lengths of magnitudes the same, test the magnitude values
+
+            while (xIndx < x.Length)
+            {
+                uint v1 = (uint)x[xIndx++];
+                uint v2 = (uint)y[yIndx++];
+
+                if (v1 != v2)
+                    return v1 < v2 ? -1 : 1;
+            }
+
+            return 0;
+        }
+
+        public int CompareTo(
+            BigInteger value)
+        {
+            return sign < value.sign ? -1
+                : sign > value.sign ? 1
+                : sign == 0 ? 0
+                : sign * CompareNoLeadingZeroes(0, magnitude, 0, value.magnitude);
+        }
+
+        /**
+         * return z = x / y - done in place (z value preserved, x contains the
+         * remainder)
+         */
+        private int[] Divide(
+            int[]	x,
+            int[]	y)
+        {
+            int xStart = 0;
+            while (xStart < x.Length && x[xStart] == 0)
+            {
+                ++xStart;
+            }
+
+            int yStart = 0;
+            while (yStart < y.Length && y[yStart] == 0)
+            {
+                ++yStart;
+            }
+
+            Debug.Assert(yStart < y.Length);
+
+            int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
+            int[] count;
+
+            if (xyCmp > 0)
+            {
+                int yBitLength = CalcBitLength(1, yStart, y);
+                int xBitLength = CalcBitLength(1, xStart, x);
+                int shift = xBitLength - yBitLength;
+
+                int[] iCount;
+                int iCountStart = 0;
+
+                int[] c;
+                int cStart = 0;
+                int cBitLength = yBitLength;
+                if (shift > 0)
+                {
 //					iCount = ShiftLeft(One.magnitude, shift);
-					iCount = new int[(shift >> 5) + 1];
-					iCount[0] = 1 << (shift % 32);
-
-					c = ShiftLeft(y, shift);
-					cBitLength += shift;
-				}
-				else
-				{
-					iCount = new int[] { 1 };
-
-					int len = y.Length - yStart;
-					c = new int[len];
-					Array.Copy(y, yStart, c, 0, len);
-				}
-
-				count = new int[iCount.Length];
-
-				for (;;)
-				{
-					if (cBitLength < xBitLength
-						|| CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0)
-					{
-						Subtract(xStart, x, cStart, c);
-						AddMagnitudes(count, iCount);
-
-						while (x[xStart] == 0)
-						{
-							if (++xStart == x.Length)
-								return count;
-						}
-
-						//xBitLength = CalcBitLength(xStart, x);
-						xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
-
-						if (xBitLength <= yBitLength)
-						{
-							if (xBitLength < yBitLength)
-								return count;
-
-							xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
-
-							if (xyCmp <= 0)
-								break;
-						}
-					}
-
-					shift = cBitLength - xBitLength;
-
-					// NB: The case where c[cStart] is 1-bit is harmless
-					if (shift == 1)
-					{
-						uint firstC = (uint) c[cStart] >> 1;
-						uint firstX = (uint) x[xStart];
-						if (firstC > firstX)
-							++shift;
-					}
-
-					if (shift < 2)
-					{
-						ShiftRightOneInPlace(cStart, c);
-						--cBitLength;
-						ShiftRightOneInPlace(iCountStart, iCount);
-					}
-					else
-					{
-						ShiftRightInPlace(cStart, c, shift);
-						cBitLength -= shift;
-						ShiftRightInPlace(iCountStart, iCount, shift);
-					}
-
-					//cStart = c.Length - ((cBitLength + 31) / 32);
-					while (c[cStart] == 0)
-					{
-						++cStart;
-					}
-
-					while (iCount[iCountStart] == 0)
-					{
-						++iCountStart;
-					}
-				}
-			}
-			else
-			{
-				count = new int[1];
-			}
-
-			if (xyCmp == 0)
-			{
-				AddMagnitudes(count, One.magnitude);
-				Array.Clear(x, xStart, x.Length - xStart);
-			}
-
-			return count;
-		}
-
-		public BigInteger Divide(
-			BigInteger val)
-		{
-			if (val.sign == 0)
-				throw new ArithmeticException("Division by zero error");
-
-			if (sign == 0)
-				return Zero;
-
-			if (val.QuickPow2Check()) // val is power of two
-			{
-				BigInteger result = this.Abs().ShiftRight(val.Abs().BitLength - 1);
-				return val.sign == this.sign ? result : result.Negate();
-			}
-
-			int[] mag = (int[]) this.magnitude.Clone();
-
-			return new BigInteger(this.sign * val.sign, Divide(mag, val.magnitude), true);
-		}
-
-		public BigInteger[] DivideAndRemainder(
-			BigInteger val)
-		{
-			if (val.sign == 0)
-				throw new ArithmeticException("Division by zero error");
-
-			BigInteger[] biggies = new BigInteger[2];
-
-			if (sign == 0)
-			{
-				biggies[0] = Zero;
-				biggies[1] = Zero;
-			}
-			else if (val.QuickPow2Check()) // val is power of two
-			{
-				int e = val.Abs().BitLength - 1;
-				BigInteger quotient = this.Abs().ShiftRight(e);
-				int[] remainder = this.LastNBits(e);
-
-				biggies[0] = val.sign == this.sign ? quotient : quotient.Negate();
-				biggies[1] = new BigInteger(this.sign, remainder, true);
-			}
-			else
-			{
-				int[] remainder = (int[]) this.magnitude.Clone();
-				int[] quotient = Divide(remainder, val.magnitude);
-
-				biggies[0] = new BigInteger(this.sign * val.sign, quotient, true);
-				biggies[1] = new BigInteger(this.sign, remainder, true);
-			}
-
-			return biggies;
-		}
-
-		public override bool Equals(
-			object obj)
-		{
-			if (obj == this)
-				return true;
-
-			BigInteger biggie = obj as BigInteger;
-			if (biggie == null)
-				return false;
+                    iCount = new int[(shift >> 5) + 1];
+                    iCount[0] = 1 << (shift % 32);
+
+                    c = ShiftLeft(y, shift);
+                    cBitLength += shift;
+                }
+                else
+                {
+                    iCount = new int[] { 1 };
+
+                    int len = y.Length - yStart;
+                    c = new int[len];
+                    Array.Copy(y, yStart, c, 0, len);
+                }
+
+                count = new int[iCount.Length];
+
+                for (;;)
+                {
+                    if (cBitLength < xBitLength
+                        || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0)
+                    {
+                        Subtract(xStart, x, cStart, c);
+                        AddMagnitudes(count, iCount);
+
+                        while (x[xStart] == 0)
+                        {
+                            if (++xStart == x.Length)
+                                return count;
+                        }
+
+                        //xBitLength = CalcBitLength(xStart, x);
+                        xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
+
+                        if (xBitLength <= yBitLength)
+                        {
+                            if (xBitLength < yBitLength)
+                                return count;
+
+                            xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
+
+                            if (xyCmp <= 0)
+                                break;
+                        }
+                    }
+
+                    shift = cBitLength - xBitLength;
+
+                    // NB: The case where c[cStart] is 1-bit is harmless
+                    if (shift == 1)
+                    {
+                        uint firstC = (uint) c[cStart] >> 1;
+                        uint firstX = (uint) x[xStart];
+                        if (firstC > firstX)
+                            ++shift;
+                    }
+
+                    if (shift < 2)
+                    {
+                        ShiftRightOneInPlace(cStart, c);
+                        --cBitLength;
+                        ShiftRightOneInPlace(iCountStart, iCount);
+                    }
+                    else
+                    {
+                        ShiftRightInPlace(cStart, c, shift);
+                        cBitLength -= shift;
+                        ShiftRightInPlace(iCountStart, iCount, shift);
+                    }
+
+                    //cStart = c.Length - ((cBitLength + 31) / 32);
+                    while (c[cStart] == 0)
+                    {
+                        ++cStart;
+                    }
+
+                    while (iCount[iCountStart] == 0)
+                    {
+                        ++iCountStart;
+                    }
+                }
+            }
+            else
+            {
+                count = new int[1];
+            }
+
+            if (xyCmp == 0)
+            {
+                AddMagnitudes(count, One.magnitude);
+                Array.Clear(x, xStart, x.Length - xStart);
+            }
+
+            return count;
+        }
+
+        public BigInteger Divide(
+            BigInteger val)
+        {
+            if (val.sign == 0)
+                throw new ArithmeticException("Division by zero error");
+
+            if (sign == 0)
+                return Zero;
+
+            if (val.QuickPow2Check()) // val is power of two
+            {
+                BigInteger result = this.Abs().ShiftRight(val.Abs().BitLength - 1);
+                return val.sign == this.sign ? result : result.Negate();
+            }
+
+            int[] mag = (int[]) this.magnitude.Clone();
+
+            return new BigInteger(this.sign * val.sign, Divide(mag, val.magnitude), true);
+        }
+
+        public BigInteger[] DivideAndRemainder(
+            BigInteger val)
+        {
+            if (val.sign == 0)
+                throw new ArithmeticException("Division by zero error");
+
+            BigInteger[] biggies = new BigInteger[2];
+
+            if (sign == 0)
+            {
+                biggies[0] = Zero;
+                biggies[1] = Zero;
+            }
+            else if (val.QuickPow2Check()) // val is power of two
+            {
+                int e = val.Abs().BitLength - 1;
+                BigInteger quotient = this.Abs().ShiftRight(e);
+                int[] remainder = this.LastNBits(e);
+
+                biggies[0] = val.sign == this.sign ? quotient : quotient.Negate();
+                biggies[1] = new BigInteger(this.sign, remainder, true);
+            }
+            else
+            {
+                int[] remainder = (int[]) this.magnitude.Clone();
+                int[] quotient = Divide(remainder, val.magnitude);
+
+                biggies[0] = new BigInteger(this.sign * val.sign, quotient, true);
+                biggies[1] = new BigInteger(this.sign, remainder, true);
+            }
+
+            return biggies;
+        }
+
+        public override bool Equals(
+            object obj)
+        {
+            if (obj == this)
+                return true;
+
+            BigInteger biggie = obj as BigInteger;
+            if (biggie == null)
+                return false;
 
             return sign == biggie.sign && IsEqualMagnitude(biggie);
-		}
+        }
 
         private bool IsEqualMagnitude(BigInteger x)
         {
@@ -1264,58 +1264,58 @@ namespace Org.BouncyCastle.Math
         }
 
         public BigInteger Gcd(
-			BigInteger value)
-		{
-			if (value.sign == 0)
-				return Abs();
-
-			if (sign == 0)
-				return value.Abs();
-
-			BigInteger r;
-			BigInteger u = this;
-			BigInteger v = value;
-
-			while (v.sign != 0)
-			{
-				r = u.Mod(v);
-				u = v;
-				v = r;
-			}
-
-			return u;
-		}
-
-		public override int GetHashCode()
-		{
-			int hc = magnitude.Length;
-			if (magnitude.Length > 0)
-			{
-				hc ^= magnitude[0];
-
-				if (magnitude.Length > 1)
-				{
-					hc ^= magnitude[magnitude.Length - 1];
-				}
-			}
-
-			return sign < 0 ? ~hc : hc;
-		}
-
-		// TODO Make public?
-		private BigInteger Inc()
-		{
-			if (this.sign == 0)
-				return One;
-
-			if (this.sign < 0)
-				return new BigInteger(-1, doSubBigLil(this.magnitude, One.magnitude), true);
-
-			return AddToMagnitude(One.magnitude);
-		}
-
-		public int IntValue
-		{
+            BigInteger value)
+        {
+            if (value.sign == 0)
+                return Abs();
+
+            if (sign == 0)
+                return value.Abs();
+
+            BigInteger r;
+            BigInteger u = this;
+            BigInteger v = value;
+
+            while (v.sign != 0)
+            {
+                r = u.Mod(v);
+                u = v;
+                v = r;
+            }
+
+            return u;
+        }
+
+        public override int GetHashCode()
+        {
+            int hc = magnitude.Length;
+            if (magnitude.Length > 0)
+            {
+                hc ^= magnitude[0];
+
+                if (magnitude.Length > 1)
+                {
+                    hc ^= magnitude[magnitude.Length - 1];
+                }
+            }
+
+            return sign < 0 ? ~hc : hc;
+        }
+
+        // TODO Make public?
+        private BigInteger Inc()
+        {
+            if (this.sign == 0)
+                return One;
+
+            if (this.sign < 0)
+                return new BigInteger(-1, doSubBigLil(this.magnitude, One.magnitude), true);
+
+            return AddToMagnitude(One.magnitude);
+        }
+
+        public int IntValue
+        {
             get
             {
                 if (sign == 0)
@@ -1327,69 +1327,69 @@ namespace Org.BouncyCastle.Math
 
                 return sign < 0 ? -v : v;
             }
-		}
+        }
 
         /**
-		 * return whether or not a BigInteger is probably prime with a
-		 * probability of 1 - (1/2)**certainty.
-		 * <p>From Knuth Vol 2, pg 395.</p>
-		 */
-		public bool IsProbablePrime(
-			int certainty)
-		{
-			if (certainty <= 0)
-				return true;
-
-			BigInteger n = Abs();
-
-			if (!n.TestBit(0))
-				return n.Equals(Two);
-
-			if (n.Equals(One))
-				return false;
-
-			return n.CheckProbablePrime(certainty, RandomSource);
-		}
-
-		private bool CheckProbablePrime(
-			int		certainty,
-			Random	random)
-		{
-			Debug.Assert(certainty > 0);
-			Debug.Assert(CompareTo(Two) > 0);
-			Debug.Assert(TestBit(0));
-
-
-			// Try to reduce the penalty for really small numbers
-			int numLists = System.Math.Min(BitLength - 1, primeLists.Length);
-
-			for (int i = 0; i < numLists; ++i)
-			{
-				int test = Remainder(primeProducts[i]);
-
-				int[] primeList = primeLists[i];
-				for (int j = 0; j < primeList.Length; ++j)
-				{
-					int prime = primeList[j];
-					int qRem = test % prime;
-					if (qRem == 0)
-					{
-						// We may find small numbers in the list
-						return BitLength < 16 && IntValue == prime;
-					}
-				}
-			}
-
-
-			// TODO Special case for < 10^16 (RabinMiller fixed list)
+         * return whether or not a BigInteger is probably prime with a
+         * probability of 1 - (1/2)**certainty.
+         * <p>From Knuth Vol 2, pg 395.</p>
+         */
+        public bool IsProbablePrime(
+            int certainty)
+        {
+            if (certainty <= 0)
+                return true;
+
+            BigInteger n = Abs();
+
+            if (!n.TestBit(0))
+                return n.Equals(Two);
+
+            if (n.Equals(One))
+                return false;
+
+            return n.CheckProbablePrime(certainty, RandomSource);
+        }
+
+        private bool CheckProbablePrime(
+            int		certainty,
+            Random	random)
+        {
+            Debug.Assert(certainty > 0);
+            Debug.Assert(CompareTo(Two) > 0);
+            Debug.Assert(TestBit(0));
+
+
+            // Try to reduce the penalty for really small numbers
+            int numLists = System.Math.Min(BitLength - 1, primeLists.Length);
+
+            for (int i = 0; i < numLists; ++i)
+            {
+                int test = Remainder(primeProducts[i]);
+
+                int[] primeList = primeLists[i];
+                for (int j = 0; j < primeList.Length; ++j)
+                {
+                    int prime = primeList[j];
+                    int qRem = test % prime;
+                    if (qRem == 0)
+                    {
+                        // We may find small numbers in the list
+                        return BitLength < 16 && IntValue == prime;
+                    }
+                }
+            }
+
+
+            // TODO Special case for < 10^16 (RabinMiller fixed list)
 //			if (BitLength < 30)
 //			{
 //				RabinMiller against 2, 3, 5, 7, 11, 13, 23 is sufficient
 //			}
 
 
-			// TODO Is it worth trying to create a hybrid of these two?
-			return RabinMillerTest(certainty, random);
+            // TODO Is it worth trying to create a hybrid of these two?
+            return RabinMillerTest(certainty, random);
 //			return SolovayStrassenTest(certainty, random);
 
 //			bool rbTest = RabinMillerTest(certainty, random);
@@ -1398,15 +1398,15 @@ namespace Org.BouncyCastle.Math
 //			Debug.Assert(rbTest == ssTest);
 //
 //			return rbTest;
-		}
+        }
 
-		public bool RabinMillerTest(int certainty, Random random)
-		{
-			Debug.Assert(certainty > 0);
-			Debug.Assert(BitLength > 2);
-			Debug.Assert(TestBit(0));
+        public bool RabinMillerTest(int certainty, Random random)
+        {
+            Debug.Assert(certainty > 0);
+            Debug.Assert(BitLength > 2);
+            Debug.Assert(TestBit(0));
 
-			// let n = 1 + d . 2^s
+            // let n = 1 + d . 2^s
             BigInteger n = this;
             int s = n.GetLowestSetBitMaskFirst(-1 << 1);
             Debug.Assert(s >= 1);
@@ -1418,8 +1418,8 @@ namespace Org.BouncyCastle.Math
             BigInteger minusMontRadix = n.Subtract(montRadix);
 
             do
-			{
-				BigInteger a;
+            {
+                BigInteger a;
                 do
                 {
                     a = new BigInteger(n.BitLength, random);
@@ -1427,29 +1427,29 @@ namespace Org.BouncyCastle.Math
                 while (a.sign == 0 || a.CompareTo(n) >= 0
                     || a.IsEqualMagnitude(montRadix) || a.IsEqualMagnitude(minusMontRadix));
 
-				BigInteger y = ModPowMonty(a, r, n, false);
+                BigInteger y = ModPowMonty(a, r, n, false);
 
                 if (!y.Equals(montRadix))
                 {
                     int j = 0;
                     while (!y.Equals(minusMontRadix))
-					{
-						if (++j == s)
-							return false;
+                    {
+                        if (++j == s)
+                            return false;
 
-						y = ModPowMonty(y, Two, n, false);
+                        y = ModPowMonty(y, Two, n, false);
 
                         if (y.Equals(montRadix))
-							return false;
-					}
-				}
+                            return false;
+                    }
+                }
 
-				certainty -= 2; // composites pass for only 1/4 possible 'a'
-			}
-			while (certainty > 0);
+                certainty -= 2; // composites pass for only 1/4 possible 'a'
+            }
+            while (certainty > 0);
 
-			return true;
-		}
+            return true;
+        }
 
 //		private bool SolovayStrassenTest(
 //			int		certainty,
@@ -1540,8 +1540,8 @@ namespace Org.BouncyCastle.Math
 //			return totalS;
 //		}
 
-		public long LongValue
-		{
+        public long LongValue
+        {
             get
             {
                 if (sign == 0)
@@ -1560,35 +1560,35 @@ namespace Org.BouncyCastle.Math
         }
 
         public BigInteger Max(
-			BigInteger value)
-		{
-			return CompareTo(value) > 0 ? this : value;
-		}
-
-		public BigInteger Min(
-			BigInteger value)
-		{
-			return CompareTo(value) < 0 ? this : value;
-		}
-
-		public BigInteger Mod(
-			BigInteger m)
-		{
-			if (m.sign < 1)
-				throw new ArithmeticException("Modulus must be positive");
-
-			BigInteger biggie = Remainder(m);
-
-			return (biggie.sign >= 0 ? biggie : biggie.Add(m));
-		}
-
-		public BigInteger ModInverse(
-			BigInteger m)
-		{
-			if (m.sign < 1)
-				throw new ArithmeticException("Modulus must be positive");
-
-			// TODO Too slow at the moment
+            BigInteger value)
+        {
+            return CompareTo(value) > 0 ? this : value;
+        }
+
+        public BigInteger Min(
+            BigInteger value)
+        {
+            return CompareTo(value) < 0 ? this : value;
+        }
+
+        public BigInteger Mod(
+            BigInteger m)
+        {
+            if (m.sign < 1)
+                throw new ArithmeticException("Modulus must be positive");
+
+            BigInteger biggie = Remainder(m);
+
+            return (biggie.sign >= 0 ? biggie : biggie.Add(m));
+        }
+
+        public BigInteger ModInverse(
+            BigInteger m)
+        {
+            if (m.sign < 1)
+                throw new ArithmeticException("Modulus must be positive");
+
+            // TODO Too slow at the moment
 //			// "Fast Key Exchange with Elliptic Curve Systems" R.Schoeppel
 //			if (m.TestBit(0))
 //			{
@@ -1635,16 +1635,16 @@ namespace Org.BouncyCastle.Math
             BigInteger x;
             BigInteger gcd = ExtEuclid(d, m, out x);
 
-			if (!gcd.Equals(One))
-				throw new ArithmeticException("Numbers not relatively prime.");
+            if (!gcd.Equals(One))
+                throw new ArithmeticException("Numbers not relatively prime.");
 
-			if (x.sign < 0)
-			{
+            if (x.sign < 0)
+            {
                 x = x.Add(m);
-			}
+            }
 
-			return x;
-		}
+            return x;
+        }
 
         private BigInteger ModInversePow2(BigInteger m)
         {
@@ -1678,11 +1678,11 @@ namespace Org.BouncyCastle.Math
                     bitsCorrect <<= 1;
                 }
                 while (bitsCorrect < pow);
+            }
 
-                if (x.sign < 0)
-                {
-                    x = x.Add(m);
-                }
+            if (x.sign < 0)
+            {
+                x = x.Add(m);
             }
 
             return x;
@@ -1715,46 +1715,46 @@ namespace Org.BouncyCastle.Math
             return x;
         }
 
-		/**
-		 * Calculate the numbers u1, u2, and u3 such that:
-		 *
-		 * u1 * a + u2 * b = u3
-		 *
-		 * where u3 is the greatest common divider of a and b.
-		 * a and b using the extended Euclid algorithm (refer p. 323
-		 * of The Art of Computer Programming vol 2, 2nd ed).
-		 * This also seems to have the side effect of calculating
-		 * some form of multiplicative inverse.
-		 *
-		 * @param a    First number to calculate gcd for
-		 * @param b    Second number to calculate gcd for
-		 * @param u1Out      the return object for the u1 value
-		 * @param u2Out      the return object for the u2 value
-		 * @return     The greatest common divisor of a and b
-		 */
-		private static BigInteger ExtEuclid(
-			BigInteger	    a,
-			BigInteger	    b,
-			out BigInteger  u1Out)
+        /**
+         * Calculate the numbers u1, u2, and u3 such that:
+         *
+         * u1 * a + u2 * b = u3
+         *
+         * where u3 is the greatest common divider of a and b.
+         * a and b using the extended Euclid algorithm (refer p. 323
+         * of The Art of Computer Programming vol 2, 2nd ed).
+         * This also seems to have the side effect of calculating
+         * some form of multiplicative inverse.
+         *
+         * @param a    First number to calculate gcd for
+         * @param b    Second number to calculate gcd for
+         * @param u1Out      the return object for the u1 value
+         * @param u2Out      the return object for the u2 value
+         * @return     The greatest common divisor of a and b
+         */
+        private static BigInteger ExtEuclid(
+            BigInteger	    a,
+            BigInteger	    b,
+            out BigInteger  u1Out)
             //BigInteger	    u2Out)
-		{
-			BigInteger u1 = One;
-			BigInteger u3 = a;
-			BigInteger v1 = Zero;
-			BigInteger v3 = b;
+        {
+            BigInteger u1 = One;
+            BigInteger u3 = a;
+            BigInteger v1 = Zero;
+            BigInteger v3 = b;
 
-			while (v3.sign > 0)
-			{
-				BigInteger[] q = u3.DivideAndRemainder(v3);
+            while (v3.sign > 0)
+            {
+                BigInteger[] q = u3.DivideAndRemainder(v3);
 
-				BigInteger tmp = v1.Multiply(q[0]);
-				BigInteger tn = u1.Subtract(tmp);
-				u1 = v1;
-				v1 = tn;
+                BigInteger tmp = v1.Multiply(q[0]);
+                BigInteger tn = u1.Subtract(tmp);
+                u1 = v1;
+                v1 = tn;
 
-				u3 = v3;
-				v3 = q[1];
-			}
+                u3 = v3;
+                v3 = q[1];
+            }
 
             //if (u1Out != null)
             //{
@@ -1772,14 +1772,14 @@ namespace Org.BouncyCastle.Math
             //    u2Out.magnitude = res.magnitude;
             //}
 
-			return u3;
-		}
+            return u3;
+        }
 
-		private static void ZeroOut(
-			int[] x)
-		{
-			Array.Clear(x, 0, x.Length);
-		}
+        private static void ZeroOut(
+            int[] x)
+        {
+            Array.Clear(x, 0, x.Length);
+        }
 
         public BigInteger ModPow(BigInteger e, BigInteger m)
         {
@@ -2084,12 +2084,12 @@ namespace Org.BouncyCastle.Math
         }
 
         /**
-		 * return w with w = x * x - w is assumed to have enough space.
-		 */
-		private static int[] Square(
-			int[]	w,
-			int[]	x)
-		{
+         * return w with w = x * x - w is assumed to have enough space.
+         */
+        private static int[] Square(
+            int[]	w,
+            int[]	x)
+        {
             // Note: this method allows w to be only (2 * x.Length - 1) words if result will fit
 //			if (w.Length != 2 * x.Length)
 //				throw new ArgumentException("no I don't think so...");
@@ -2145,62 +2145,62 @@ namespace Org.BouncyCastle.Math
             }
 
             return w;
-		}
+        }
 
         /**
-		 * return x with x = y * z - x is assumed to have enough space.
-		 */
-		private static int[] Multiply(int[]	x, int[] y, int[] z)
-		{
-			int i = z.Length;
-
-			if (i < 1)
-				return x;
-
-			int xBase = x.Length - y.Length;
-
-			do
-			{
-				long a = z[--i] & IMASK;
-				long val = 0;
-
-				if (a != 0)
-				{
-					for (int j = y.Length - 1; j >= 0; j--)
-					{
-						val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK);
-	
-						x[xBase + j] = (int)val;
-	
-						val = (long)((ulong)val >> 32);
-					}
-				}
-
-				--xBase;
-
-				if (xBase >= 0)
-				{
-					x[xBase] = (int)val;
-				}
-				else
-				{
-					Debug.Assert(val == 0);
-				}
-			}
-			while (i > 0);
-
-			return x;
-		}
+         * return x with x = y * z - x is assumed to have enough space.
+         */
+        private static int[] Multiply(int[]	x, int[] y, int[] z)
+        {
+            int i = z.Length;
+
+            if (i < 1)
+                return x;
+
+            int xBase = x.Length - y.Length;
+
+            do
+            {
+                long a = z[--i] & IMASK;
+                long val = 0;
+
+                if (a != 0)
+                {
+                    for (int j = y.Length - 1; j >= 0; j--)
+                    {
+                        val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK);
+    
+                        x[xBase + j] = (int)val;
+    
+                        val = (long)((ulong)val >> 32);
+                    }
+                }
+
+                --xBase;
+
+                if (xBase >= 0)
+                {
+                    x[xBase] = (int)val;
+                }
+                else
+                {
+                    Debug.Assert(val == 0);
+                }
+            }
+            while (i > 0);
+
+            return x;
+        }
 
         /**
-		 * Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size)
-		 */
+         * Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size)
+         */
         private int GetMQuote()
-		{
-			if (mQuote != 0)
-			{
-				return mQuote; // already calculated
-			}
+        {
+            if (mQuote != 0)
+            {
+                return mQuote; // already calculated
+            }
 
             Debug.Assert(this.sign > 0);
 
@@ -2209,7 +2209,7 @@ namespace Org.BouncyCastle.Math
             Debug.Assert((d & 1) != 0);
 
             return mQuote = ModInverse32(d);
-		}
+        }
 
         private static void MontgomeryReduce(int[] x, int[] m, uint mDash) // mDash = -m^(-1) mod b
         {
@@ -2245,21 +2245,21 @@ namespace Org.BouncyCastle.Math
         }
 
         /**
-		 * Montgomery multiplication: a = x * y * R^(-1) mod m
-		 * <br/>
-		 * Based algorithm 14.36 of Handbook of Applied Cryptography.
-		 * <br/>
-		 * <li> m, x, y should have length n </li>
-		 * <li> a should have length (n + 1) </li>
-		 * <li> b = 2^32, R = b^n </li>
-		 * <br/>
-		 * The result is put in x
-		 * <br/>
-		 * NOTE: the indices of x, y, m, a different in HAC and in Java
-		 */
-		private static void MultiplyMonty(int[]	a, int[] x, int[] y, int[] m, uint mDash, bool smallMontyModulus)
-			// mDash = -m^(-1) mod b
-		{
+         * Montgomery multiplication: a = x * y * R^(-1) mod m
+         * <br/>
+         * Based algorithm 14.36 of Handbook of Applied Cryptography.
+         * <br/>
+         * <li> m, x, y should have length n </li>
+         * <li> a should have length (n + 1) </li>
+         * <li> b = 2^32, R = b^n </li>
+         * <br/>
+         * The result is put in x
+         * <br/>
+         * NOTE: the indices of x, y, m, a different in HAC and in Java
+         */
+        private static void MultiplyMonty(int[]	a, int[] x, int[] y, int[] m, uint mDash, bool smallMontyModulus)
+            // mDash = -m^(-1) mod b
+        {
             int n = m.Length;
 
             if (n == 1)
@@ -2269,6 +2269,7 @@ namespace Org.BouncyCastle.Math
             }
 
             uint y0 = (uint)y[n - 1];
+            int aMax;
 
             {
                 ulong xi = (uint)x[n - 1];
@@ -2292,7 +2293,7 @@ namespace Org.BouncyCastle.Math
                 }
 
                 a[1] = (int)carry;
-                a[0] = (int)(carry >> 32);
+                aMax = (int)(carry >> 32);
             }
 
             for (int i = n - 2; i >= 0; --i)
@@ -2319,11 +2320,13 @@ namespace Org.BouncyCastle.Math
                     carry = (carry >> 32) + (prod1 >> 32) + (prod2 >> 32);
                 }
 
-                carry += (uint)a[0];
+                carry += (uint)aMax;
                 a[1] = (int)carry;
-                a[0] = (int)(carry >> 32);
+                aMax = (int)(carry >> 32);
             }
 
+            a[0] = aMax;
+
             if (!smallMontyModulus && CompareTo(0, a, 0, m) >= 0)
             {
                 Subtract(0, a, 0, m);
@@ -2345,6 +2348,7 @@ namespace Org.BouncyCastle.Math
             }
 
             ulong x0 = (uint)x[n - 1];
+            int aMax;
 
             {
                 ulong carry = x0 * x0;
@@ -2366,7 +2370,7 @@ namespace Org.BouncyCastle.Math
                 }
 
                 a[1] = (int)carry;
-                a[0] = (int)(carry >> 32);
+                aMax = (int)(carry >> 32);
             }
 
             for (int i = n - 2; i >= 0; --i)
@@ -2406,11 +2410,13 @@ namespace Org.BouncyCastle.Math
                     carry = (carry >> 32) + (prod1 >> 31) + (prod2 >> 32);
                 }
 
-                carry += (uint)a[0];
+                carry += (uint)aMax;
                 a[1] = (int)carry;
-                a[0] = (int)(carry >> 32);
+                aMax = (int)(carry >> 32);
             }
 
+            a[0] = aMax;
+
             if (!smallMontyModulus && CompareTo(0, a, 0, m) >= 0)
             {
                 Subtract(0, a, 0, m);
@@ -2420,7 +2426,7 @@ namespace Org.BouncyCastle.Math
         }
 
         private static uint MultiplyMontyNIsOne(uint x, uint y, uint m, uint mDash)
-		{
+        {
             ulong carry = (ulong)x * y;
             uint t = (uint)carry * mDash;
             ulong um = m;
@@ -2434,28 +2440,28 @@ namespace Org.BouncyCastle.Math
             }
             Debug.Assert(carry < um);
             return (uint)carry;
-		}
+        }
 
         public BigInteger Multiply(
-			BigInteger val)
-		{
+            BigInteger val)
+        {
             if (val == this)
                 return Square();
 
             if ((sign & val.sign) == 0)
-				return Zero;
+                return Zero;
 
             if (val.QuickPow2Check()) // val is power of two
-			{
-				BigInteger result = this.ShiftLeft(val.Abs().BitLength - 1);
-				return val.sign > 0 ? result : result.Negate();
-			}
+            {
+                BigInteger result = this.ShiftLeft(val.Abs().BitLength - 1);
+                return val.sign > 0 ? result : result.Negate();
+            }
 
-			if (this.QuickPow2Check()) // this is power of two
-			{
-				BigInteger result = val.ShiftLeft(this.Abs().BitLength - 1);
-				return this.sign > 0 ? result : result.Negate();
-			}
+            if (this.QuickPow2Check()) // this is power of two
+            {
+                BigInteger result = val.ShiftLeft(this.Abs().BitLength - 1);
+                return this.sign > 0 ? result : result.Negate();
+            }
 
             int resLength = magnitude.Length + val.magnitude.Length;
             int[] res = new int[resLength];
@@ -2464,7 +2470,7 @@ namespace Org.BouncyCastle.Math
 
             int resSign = sign ^ val.sign ^ 1;
             return new BigInteger(resSign, res, true);
-		}
+        }
 
         public BigInteger Square()
         {
@@ -2481,50 +2487,50 @@ namespace Org.BouncyCastle.Math
         }
 
         public BigInteger Negate()
-		{
-			if (sign == 0)
-				return this;
+        {
+            if (sign == 0)
+                return this;
 
-			return new BigInteger(-sign, magnitude, false);
-		}
+            return new BigInteger(-sign, magnitude, false);
+        }
 
-		public BigInteger NextProbablePrime()
-		{
-			if (sign < 0)
-				throw new ArithmeticException("Cannot be called on value < 0");
+        public BigInteger NextProbablePrime()
+        {
+            if (sign < 0)
+                throw new ArithmeticException("Cannot be called on value < 0");
 
-			if (CompareTo(Two) < 0)
-				return Two;
+            if (CompareTo(Two) < 0)
+                return Two;
 
-			BigInteger n = Inc().SetBit(0);
+            BigInteger n = Inc().SetBit(0);
 
-			while (!n.CheckProbablePrime(100, RandomSource))
-			{
-				n = n.Add(Two);
-			}
+            while (!n.CheckProbablePrime(100, RandomSource))
+            {
+                n = n.Add(Two);
+            }
 
-			return n;
-		}
+            return n;
+        }
 
-		public BigInteger Not()
-		{
-			return Inc().Negate();
-		}
+        public BigInteger Not()
+        {
+            return Inc().Negate();
+        }
 
-		public BigInteger Pow(int exp)
-		{
-			if (exp <= 0)
-			{
+        public BigInteger Pow(int exp)
+        {
+            if (exp <= 0)
+            {
                 if (exp < 0)
-    				throw new ArithmeticException("Negative exponent");
+                    throw new ArithmeticException("Negative exponent");
 
                 return One;
-			}
+            }
 
             if (sign == 0)
-			{
-				return this;
-			}
+            {
+                return this;
+            }
 
             if (QuickPow2Check())
             {
@@ -2537,212 +2543,212 @@ namespace Org.BouncyCastle.Math
             }
 
             BigInteger y = One;
-			BigInteger z = this;
-
-			for (;;)
-			{
-				if ((exp & 0x1) == 1)
-				{
-					y = y.Multiply(z);
-				}
-				exp >>= 1;
-				if (exp == 0) break;
-				z = z.Multiply(z);
-			}
-
-			return y;
-		}
-
-		public static BigInteger ProbablePrime(
-			int bitLength,
-			Random random)
-		{
-			return new BigInteger(bitLength, 100, random);
-		}
-
-		private int Remainder(
-			int m)
-		{
-			Debug.Assert(m > 0);
-
-			long acc = 0;
-			for (int pos = 0; pos < magnitude.Length; ++pos)
-			{
-				long posVal = (uint) magnitude[pos];
-				acc = (acc << 32 | posVal) % m;
-			}
-
-			return (int) acc;
-		}
-
-		/**
-		 * return x = x % y - done in place (y value preserved)
-		 */
-		private static int[] Remainder(
-			int[] x,
-			int[] y)
-		{
-			int xStart = 0;
-			while (xStart < x.Length && x[xStart] == 0)
-			{
-				++xStart;
-			}
-
-			int yStart = 0;
-			while (yStart < y.Length && y[yStart] == 0)
-			{
-				++yStart;
-			}
-
-			Debug.Assert(yStart < y.Length);
-
-			int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
-
-			if (xyCmp > 0)
-			{
-				int yBitLength = CalcBitLength(1, yStart, y);
-				int xBitLength = CalcBitLength(1, xStart, x);
-				int shift = xBitLength - yBitLength;
-
-				int[] c;
-				int cStart = 0;
-				int cBitLength = yBitLength;
-				if (shift > 0)
-				{
-					c = ShiftLeft(y, shift);
-					cBitLength += shift;
-					Debug.Assert(c[0] != 0);
-				}
-				else
-				{
-					int len = y.Length - yStart;
-					c = new int[len];
-					Array.Copy(y, yStart, c, 0, len);
-				}
-
-				for (;;)
-				{
-					if (cBitLength < xBitLength
-						|| CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0)
-					{
-						Subtract(xStart, x, cStart, c);
-
-						while (x[xStart] == 0)
-						{
-							if (++xStart == x.Length)
-								return x;
-						}
-
-						//xBitLength = CalcBitLength(xStart, x);
-						xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
-
-						if (xBitLength <= yBitLength)
-						{
-							if (xBitLength < yBitLength)
-								return x;
-
-							xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
-
-							if (xyCmp <= 0)
-								break;
-						}
-					}
-
-					shift = cBitLength - xBitLength;
-
-					// NB: The case where c[cStart] is 1-bit is harmless
-					if (shift == 1)
-					{
-						uint firstC = (uint) c[cStart] >> 1;
-						uint firstX = (uint) x[xStart];
-						if (firstC > firstX)
-							++shift;
-					}
-
-					if (shift < 2)
-					{
-						ShiftRightOneInPlace(cStart, c);
-						--cBitLength;
-					}
-					else
-					{
-						ShiftRightInPlace(cStart, c, shift);
-						cBitLength -= shift;
-					}
-
-					//cStart = c.Length - ((cBitLength + 31) / 32);
-					while (c[cStart] == 0)
-					{
-						++cStart;
-					}
-				}
-			}
-
-			if (xyCmp == 0)
-			{
-				Array.Clear(x, xStart, x.Length - xStart);
-			}
-
-			return x;
-		}
-
-		public BigInteger Remainder(
-			BigInteger n)
-		{
-			if (n.sign == 0)
-				throw new ArithmeticException("Division by zero error");
-
-			if (this.sign == 0)
-				return Zero;
-
-			// For small values, use fast remainder method
-			if (n.magnitude.Length == 1)
-			{
-				int val = n.magnitude[0];
-
-				if (val > 0)
-				{
-					if (val == 1)
-						return Zero;
-
-					// TODO Make this func work on uint, and handle val == 1?
-					int rem = Remainder(val);
-
-					return rem == 0
-						?	Zero
-						:	new BigInteger(sign, new int[]{ rem }, false);
-				}
-			}
-
-			if (CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude) < 0)
-				return this;
-
-			int[] result;
-			if (n.QuickPow2Check())  // n is power of two
-			{
-				// TODO Move before small values branch above?
-				result = LastNBits(n.Abs().BitLength - 1);
-			}
-			else
-			{
-				result = (int[]) this.magnitude.Clone();
-				result = Remainder(result, n.magnitude);
-			}
-
-			return new BigInteger(sign, result, true);
-		}
-
-		private int[] LastNBits(
-			int n)
-		{
-			if (n < 1)
-				return ZeroMagnitude;
-
-			int numWords = (n + BitsPerInt - 1) / BitsPerInt;
-			numWords = System.Math.Min(numWords, this.magnitude.Length);
-			int[] result = new int[numWords];
-
-			Array.Copy(this.magnitude, this.magnitude.Length - numWords, result, 0, numWords);
+            BigInteger z = this;
+
+            for (;;)
+            {
+                if ((exp & 0x1) == 1)
+                {
+                    y = y.Multiply(z);
+                }
+                exp >>= 1;
+                if (exp == 0) break;
+                z = z.Multiply(z);
+            }
+
+            return y;
+        }
+
+        public static BigInteger ProbablePrime(
+            int bitLength,
+            Random random)
+        {
+            return new BigInteger(bitLength, 100, random);
+        }
+
+        private int Remainder(
+            int m)
+        {
+            Debug.Assert(m > 0);
+
+            long acc = 0;
+            for (int pos = 0; pos < magnitude.Length; ++pos)
+            {
+                long posVal = (uint) magnitude[pos];
+                acc = (acc << 32 | posVal) % m;
+            }
+
+            return (int) acc;
+        }
+
+        /**
+         * return x = x % y - done in place (y value preserved)
+         */
+        private static int[] Remainder(
+            int[] x,
+            int[] y)
+        {
+            int xStart = 0;
+            while (xStart < x.Length && x[xStart] == 0)
+            {
+                ++xStart;
+            }
+
+            int yStart = 0;
+            while (yStart < y.Length && y[yStart] == 0)
+            {
+                ++yStart;
+            }
+
+            Debug.Assert(yStart < y.Length);
+
+            int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
+
+            if (xyCmp > 0)
+            {
+                int yBitLength = CalcBitLength(1, yStart, y);
+                int xBitLength = CalcBitLength(1, xStart, x);
+                int shift = xBitLength - yBitLength;
+
+                int[] c;
+                int cStart = 0;
+                int cBitLength = yBitLength;
+                if (shift > 0)
+                {
+                    c = ShiftLeft(y, shift);
+                    cBitLength += shift;
+                    Debug.Assert(c[0] != 0);
+                }
+                else
+                {
+                    int len = y.Length - yStart;
+                    c = new int[len];
+                    Array.Copy(y, yStart, c, 0, len);
+                }
+
+                for (;;)
+                {
+                    if (cBitLength < xBitLength
+                        || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0)
+                    {
+                        Subtract(xStart, x, cStart, c);
+
+                        while (x[xStart] == 0)
+                        {
+                            if (++xStart == x.Length)
+                                return x;
+                        }
+
+                        //xBitLength = CalcBitLength(xStart, x);
+                        xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
+
+                        if (xBitLength <= yBitLength)
+                        {
+                            if (xBitLength < yBitLength)
+                                return x;
+
+                            xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y);
+
+                            if (xyCmp <= 0)
+                                break;
+                        }
+                    }
+
+                    shift = cBitLength - xBitLength;
+
+                    // NB: The case where c[cStart] is 1-bit is harmless
+                    if (shift == 1)
+                    {
+                        uint firstC = (uint) c[cStart] >> 1;
+                        uint firstX = (uint) x[xStart];
+                        if (firstC > firstX)
+                            ++shift;
+                    }
+
+                    if (shift < 2)
+                    {
+                        ShiftRightOneInPlace(cStart, c);
+                        --cBitLength;
+                    }
+                    else
+                    {
+                        ShiftRightInPlace(cStart, c, shift);
+                        cBitLength -= shift;
+                    }
+
+                    //cStart = c.Length - ((cBitLength + 31) / 32);
+                    while (c[cStart] == 0)
+                    {
+                        ++cStart;
+                    }
+                }
+            }
+
+            if (xyCmp == 0)
+            {
+                Array.Clear(x, xStart, x.Length - xStart);
+            }
+
+            return x;
+        }
+
+        public BigInteger Remainder(
+            BigInteger n)
+        {
+            if (n.sign == 0)
+                throw new ArithmeticException("Division by zero error");
+
+            if (this.sign == 0)
+                return Zero;
+
+            // For small values, use fast remainder method
+            if (n.magnitude.Length == 1)
+            {
+                int val = n.magnitude[0];
+
+                if (val > 0)
+                {
+                    if (val == 1)
+                        return Zero;
+
+                    // TODO Make this func work on uint, and handle val == 1?
+                    int rem = Remainder(val);
+
+                    return rem == 0
+                        ?	Zero
+                        :	new BigInteger(sign, new int[]{ rem }, false);
+                }
+            }
+
+            if (CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude) < 0)
+                return this;
+
+            int[] result;
+            if (n.QuickPow2Check())  // n is power of two
+            {
+                // TODO Move before small values branch above?
+                result = LastNBits(n.Abs().BitLength - 1);
+            }
+            else
+            {
+                result = (int[]) this.magnitude.Clone();
+                result = Remainder(result, n.magnitude);
+            }
+
+            return new BigInteger(sign, result, true);
+        }
+
+        private int[] LastNBits(
+            int n)
+        {
+            if (n < 1)
+                return ZeroMagnitude;
+
+            int numWords = (n + BitsPerInt - 1) / BitsPerInt;
+            numWords = System.Math.Min(numWords, this.magnitude.Length);
+            int[] result = new int[numWords];
+
+            Array.Copy(this.magnitude, this.magnitude.Length - numWords, result, 0, numWords);
 
             int excessBits = (numWords << 5) - n;
             if (excessBits > 0)
@@ -2751,7 +2757,7 @@ namespace Org.BouncyCastle.Math
             }
 
             return result;
-		}
+        }
 
         private BigInteger DivideWords(int w)
         {
@@ -2776,52 +2782,52 @@ namespace Org.BouncyCastle.Math
         }
 
         /**
-		 * do a left shift - this returns a new array.
-		 */
-		private static int[] ShiftLeft(
-			int[]	mag,
-			int		n)
-		{
-			int nInts = (int)((uint)n >> 5);
-			int nBits = n & 0x1f;
-			int magLen = mag.Length;
-			int[] newMag;
-
-			if (nBits == 0)
-			{
-				newMag = new int[magLen + nInts];
-				mag.CopyTo(newMag, 0);
-			}
-			else
-			{
-				int i = 0;
-				int nBits2 = 32 - nBits;
-				int highBits = (int)((uint)mag[0] >> nBits2);
-
-				if (highBits != 0)
-				{
-					newMag = new int[magLen + nInts + 1];
-					newMag[i++] = highBits;
-				}
-				else
-				{
-					newMag = new int[magLen + nInts];
-				}
-
-				int m = mag[0];
-				for (int j = 0; j < magLen - 1; j++)
-				{
-					int next = mag[j + 1];
-
-					newMag[i++] = (m << nBits) | (int)((uint)next >> nBits2);
-					m = next;
-				}
-
-				newMag[i] = mag[magLen - 1] << nBits;
-			}
-
-			return newMag;
-		}
+         * do a left shift - this returns a new array.
+         */
+        private static int[] ShiftLeft(
+            int[]	mag,
+            int		n)
+        {
+            int nInts = (int)((uint)n >> 5);
+            int nBits = n & 0x1f;
+            int magLen = mag.Length;
+            int[] newMag;
+
+            if (nBits == 0)
+            {
+                newMag = new int[magLen + nInts];
+                mag.CopyTo(newMag, 0);
+            }
+            else
+            {
+                int i = 0;
+                int nBits2 = 32 - nBits;
+                int highBits = (int)((uint)mag[0] >> nBits2);
+
+                if (highBits != 0)
+                {
+                    newMag = new int[magLen + nInts + 1];
+                    newMag[i++] = highBits;
+                }
+                else
+                {
+                    newMag = new int[magLen + nInts];
+                }
+
+                int m = mag[0];
+                for (int j = 0; j < magLen - 1; j++)
+                {
+                    int next = mag[j + 1];
+
+                    newMag[i++] = (m << nBits) | (int)((uint)next >> nBits2);
+                    m = next;
+                }
+
+                newMag[i] = mag[magLen - 1] << nBits;
+            }
+
+            return newMag;
+        }
 
         private static int ShiftLeftOneInPlace(int[] x, int carry)
         {
@@ -2836,109 +2842,109 @@ namespace Org.BouncyCastle.Math
             return carry;
         }
 
-		public BigInteger ShiftLeft(
-			int n)
-		{
-			if (sign == 0 || magnitude.Length == 0)
-				return Zero;
-
-			if (n == 0)
-				return this;
-
-			if (n < 0)
-				return ShiftRight(-n);
-
-			BigInteger result = new BigInteger(sign, ShiftLeft(magnitude, n), true);
-
-			if (this.nBits != -1)
-			{
-				result.nBits = sign > 0
-					?	this.nBits
-					:	this.nBits + n;
-			}
-
-			if (this.nBitLength != -1)
-			{
-				result.nBitLength = this.nBitLength + n;
-			}
-
-			return result;
-		}
-
-		/**
-		 * do a right shift - this does it in place.
-		 */
-		private static void ShiftRightInPlace(
-			int		start,
-			int[]	mag,
-			int		n)
-		{
-			int nInts = (int)((uint)n >> 5) + start;
-			int nBits = n & 0x1f;
-			int magEnd = mag.Length - 1;
-
-			if (nInts != start)
-			{
-				int delta = (nInts - start);
-
-				for (int i = magEnd; i >= nInts; i--)
-				{
-					mag[i] = mag[i - delta];
-				}
-				for (int i = nInts - 1; i >= start; i--)
-				{
-					mag[i] = 0;
-				}
-			}
-
-			if (nBits != 0)
-			{
-				int nBits2 = 32 - nBits;
-				int m = mag[magEnd];
-
-				for (int i = magEnd; i > nInts; --i)
-				{
-					int next = mag[i - 1];
-
-					mag[i] = (int)((uint)m >> nBits) | (next << nBits2);
-					m = next;
-				}
-
-				mag[nInts] = (int)((uint)mag[nInts] >> nBits);
-			}
-		}
-
-		/**
-		 * do a right shift by one - this does it in place.
-		 */
-		private static void ShiftRightOneInPlace(
-			int		start,
-			int[]	mag)
-		{
-			int i = mag.Length;
-			int m = mag[i - 1];
-
-			while (--i > start)
-			{
-				int next = mag[i - 1];
-				mag[i] = ((int)((uint)m >> 1)) | (next << 31);
-				m = next;
-			}
-
-			mag[start] = (int)((uint)mag[start] >> 1);
-		}
+        public BigInteger ShiftLeft(
+            int n)
+        {
+            if (sign == 0 || magnitude.Length == 0)
+                return Zero;
+
+            if (n == 0)
+                return this;
+
+            if (n < 0)
+                return ShiftRight(-n);
+
+            BigInteger result = new BigInteger(sign, ShiftLeft(magnitude, n), true);
+
+            if (this.nBits != -1)
+            {
+                result.nBits = sign > 0
+                    ?	this.nBits
+                    :	this.nBits + n;
+            }
+
+            if (this.nBitLength != -1)
+            {
+                result.nBitLength = this.nBitLength + n;
+            }
+
+            return result;
+        }
+
+        /**
+         * do a right shift - this does it in place.
+         */
+        private static void ShiftRightInPlace(
+            int		start,
+            int[]	mag,
+            int		n)
+        {
+            int nInts = (int)((uint)n >> 5) + start;
+            int nBits = n & 0x1f;
+            int magEnd = mag.Length - 1;
+
+            if (nInts != start)
+            {
+                int delta = (nInts - start);
+
+                for (int i = magEnd; i >= nInts; i--)
+                {
+                    mag[i] = mag[i - delta];
+                }
+                for (int i = nInts - 1; i >= start; i--)
+                {
+                    mag[i] = 0;
+                }
+            }
+
+            if (nBits != 0)
+            {
+                int nBits2 = 32 - nBits;
+                int m = mag[magEnd];
+
+                for (int i = magEnd; i > nInts; --i)
+                {
+                    int next = mag[i - 1];
+
+                    mag[i] = (int)((uint)m >> nBits) | (next << nBits2);
+                    m = next;
+                }
+
+                mag[nInts] = (int)((uint)mag[nInts] >> nBits);
+            }
+        }
+
+        /**
+         * do a right shift by one - this does it in place.
+         */
+        private static void ShiftRightOneInPlace(
+            int		start,
+            int[]	mag)
+        {
+            int i = mag.Length;
+            int m = mag[i - 1];
+
+            while (--i > start)
+            {
+                int next = mag[i - 1];
+                mag[i] = ((int)((uint)m >> 1)) | (next << 31);
+                m = next;
+            }
+
+            mag[start] = (int)((uint)mag[start] >> 1);
+        }
 
         public BigInteger ShiftRight(
-			int n)
-		{
-			if (n == 0)
-				return this;
+            int n)
+        {
+            if (n == 0)
+                return this;
 
-			if (n < 0)
-				return ShiftLeft(-n);
+            if (n < 0)
+                return ShiftLeft(-n);
 
-			if (n >= BitLength)
-				return (this.sign < 0 ? One.Negate() : Zero);
+            if (n >= BitLength)
+                return (this.sign < 0 ? One.Negate() : Zero);
 
 //			int[] res = (int[]) this.magnitude.Clone();
 //
@@ -2946,213 +2952,213 @@ namespace Org.BouncyCastle.Math
 //
 //			return new BigInteger(this.sign, res, true);
 
-			int resultLength = (BitLength - n + 31) >> 5;
-			int[] res = new int[resultLength];
+            int resultLength = (BitLength - n + 31) >> 5;
+            int[] res = new int[resultLength];
 
-			int numInts = n >> 5;
-			int numBits = n & 31;
+            int numInts = n >> 5;
+            int numBits = n & 31;
 
-			if (numBits == 0)
-			{
-				Array.Copy(this.magnitude, 0, res, 0, res.Length);
-			}
-			else
-			{
-				int numBits2 = 32 - numBits;
+            if (numBits == 0)
+            {
+                Array.Copy(this.magnitude, 0, res, 0, res.Length);
+            }
+            else
+            {
+                int numBits2 = 32 - numBits;
 
-				int magPos = this.magnitude.Length - 1 - numInts;
-				for (int i = resultLength - 1; i >= 0; --i)
-				{
-					res[i] = (int)((uint) this.magnitude[magPos--] >> numBits);
+                int magPos = this.magnitude.Length - 1 - numInts;
+                for (int i = resultLength - 1; i >= 0; --i)
+                {
+                    res[i] = (int)((uint) this.magnitude[magPos--] >> numBits);
 
-					if (magPos >= 0)
-					{
-						res[i] |= this.magnitude[magPos] << numBits2;
-					}
-				}
-			}
+                    if (magPos >= 0)
+                    {
+                        res[i] |= this.magnitude[magPos] << numBits2;
+                    }
+                }
+            }
 
-			Debug.Assert(res[0] != 0);
+            Debug.Assert(res[0] != 0);
 
-			return new BigInteger(this.sign, res, false);
-		}
+            return new BigInteger(this.sign, res, false);
+        }
 
         public int SignValue
-		{
-			get { return sign; }
-		}
-
-		/**
-		 * returns x = x - y - we assume x is >= y
-		 */
-		private static int[] Subtract(
-			int		xStart,
-			int[]	x,
-			int		yStart,
-			int[]	y)
-		{
-			Debug.Assert(yStart < y.Length);
-			Debug.Assert(x.Length - xStart >= y.Length - yStart);
-
-			int iT = x.Length;
-			int iV = y.Length;
-			long m;
-			int borrow = 0;
-
-			do
-			{
-				m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow;
-				x[iT] = (int) m;
+        {
+            get { return sign; }
+        }
+
+        /**
+         * returns x = x - y - we assume x is >= y
+         */
+        private static int[] Subtract(
+            int		xStart,
+            int[]	x,
+            int		yStart,
+            int[]	y)
+        {
+            Debug.Assert(yStart < y.Length);
+            Debug.Assert(x.Length - xStart >= y.Length - yStart);
+
+            int iT = x.Length;
+            int iV = y.Length;
+            long m;
+            int borrow = 0;
+
+            do
+            {
+                m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow;
+                x[iT] = (int) m;
 
 //				borrow = (m < 0) ? -1 : 0;
-				borrow = (int)(m >> 63);
-			}
-			while (iV > yStart);
-
-			if (borrow != 0)
-			{
-				while (--x[--iT] == -1)
-				{
-				}
-			}
-
-			return x;
-		}
-
-		public BigInteger Subtract(
-			BigInteger n)
-		{
-			if (n.sign == 0)
-				return this;
-
-			if (this.sign == 0)
-				return n.Negate();
-
-			if (this.sign != n.sign)
-				return Add(n.Negate());
-
-			int compare = CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude);
-			if (compare == 0)
-				return Zero;
-
-			BigInteger bigun, lilun;
-			if (compare < 0)
-			{
-				bigun = n;
-				lilun = this;
-			}
-			else
-			{
-				bigun = this;
-				lilun = n;
-			}
-
-			return new BigInteger(this.sign * compare, doSubBigLil(bigun.magnitude, lilun.magnitude), true);
-		}
-
-		private static int[] doSubBigLil(
-			int[]	bigMag,
-			int[]	lilMag)
-		{
-			int[] res = (int[]) bigMag.Clone();
-
-			return Subtract(0, res, 0, lilMag);
-		}
-
-		public byte[] ToByteArray()
-		{
-			return ToByteArray(false);
-		}
-
-		public byte[] ToByteArrayUnsigned()
-		{
-			return ToByteArray(true);
-		}
-
-		private byte[] ToByteArray(
-			bool unsigned)
-		{
-			if (sign == 0)
-				return unsigned ? ZeroEncoding : new byte[1];
-
-			int nBits = (unsigned && sign > 0)
-				?	BitLength
-				:	BitLength + 1;
-
-			int nBytes = GetByteLength(nBits);
-			byte[] bytes = new byte[nBytes];
-
-			int magIndex = magnitude.Length;
-			int bytesIndex = bytes.Length;
-
-			if (sign > 0)
-			{
-				while (magIndex > 1)
-				{
-					uint mag = (uint) magnitude[--magIndex];
-					bytes[--bytesIndex] = (byte) mag;
-					bytes[--bytesIndex] = (byte)(mag >> 8);
-					bytes[--bytesIndex] = (byte)(mag >> 16);
-					bytes[--bytesIndex] = (byte)(mag >> 24);
-				}
-
-				uint lastMag = (uint) magnitude[0];
-				while (lastMag > byte.MaxValue)
-				{
-					bytes[--bytesIndex] = (byte) lastMag;
-					lastMag >>= 8;
-				}
-
-				bytes[--bytesIndex] = (byte) lastMag;
-			}
-			else // sign < 0
-			{
-				bool carry = true;
-
-				while (magIndex > 1)
-				{
-					uint mag = ~((uint) magnitude[--magIndex]);
-
-					if (carry)
-					{
-						carry = (++mag == uint.MinValue);
-					}
-
-					bytes[--bytesIndex] = (byte) mag;
-					bytes[--bytesIndex] = (byte)(mag >> 8);
-					bytes[--bytesIndex] = (byte)(mag >> 16);
-					bytes[--bytesIndex] = (byte)(mag >> 24);
-				}
-
-				uint lastMag = (uint) magnitude[0];
-
-				if (carry)
-				{
-					// Never wraps because magnitude[0] != 0
-					--lastMag;
-				}
-
-				while (lastMag > byte.MaxValue)
-				{
-					bytes[--bytesIndex] = (byte) ~lastMag;
-					lastMag >>= 8;
-				}
-
-				bytes[--bytesIndex] = (byte) ~lastMag;
-
-				if (bytesIndex > 0)
-				{
-					bytes[--bytesIndex] = byte.MaxValue;
-				}
-			}
-
-			return bytes;
-		}
-
-		public override string ToString()
-		{
-			return ToString(10);
-		}
+                borrow = (int)(m >> 63);
+            }
+            while (iV > yStart);
+
+            if (borrow != 0)
+            {
+                while (--x[--iT] == -1)
+                {
+                }
+            }
+
+            return x;
+        }
+
+        public BigInteger Subtract(
+            BigInteger n)
+        {
+            if (n.sign == 0)
+                return this;
+
+            if (this.sign == 0)
+                return n.Negate();
+
+            if (this.sign != n.sign)
+                return Add(n.Negate());
+
+            int compare = CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude);
+            if (compare == 0)
+                return Zero;
+
+            BigInteger bigun, lilun;
+            if (compare < 0)
+            {
+                bigun = n;
+                lilun = this;
+            }
+            else
+            {
+                bigun = this;
+                lilun = n;
+            }
+
+            return new BigInteger(this.sign * compare, doSubBigLil(bigun.magnitude, lilun.magnitude), true);
+        }
+
+        private static int[] doSubBigLil(
+            int[]	bigMag,
+            int[]	lilMag)
+        {
+            int[] res = (int[]) bigMag.Clone();
+
+            return Subtract(0, res, 0, lilMag);
+        }
+
+        public byte[] ToByteArray()
+        {
+            return ToByteArray(false);
+        }
+
+        public byte[] ToByteArrayUnsigned()
+        {
+            return ToByteArray(true);
+        }
+
+        private byte[] ToByteArray(
+            bool unsigned)
+        {
+            if (sign == 0)
+                return unsigned ? ZeroEncoding : new byte[1];
+
+            int nBits = (unsigned && sign > 0)
+                ?	BitLength
+                :	BitLength + 1;
+
+            int nBytes = GetByteLength(nBits);
+            byte[] bytes = new byte[nBytes];
+
+            int magIndex = magnitude.Length;
+            int bytesIndex = bytes.Length;
+
+            if (sign > 0)
+            {
+                while (magIndex > 1)
+                {
+                    uint mag = (uint) magnitude[--magIndex];
+                    bytes[--bytesIndex] = (byte) mag;
+                    bytes[--bytesIndex] = (byte)(mag >> 8);
+                    bytes[--bytesIndex] = (byte)(mag >> 16);
+                    bytes[--bytesIndex] = (byte)(mag >> 24);
+                }
+
+                uint lastMag = (uint) magnitude[0];
+                while (lastMag > byte.MaxValue)
+                {
+                    bytes[--bytesIndex] = (byte) lastMag;
+                    lastMag >>= 8;
+                }
+
+                bytes[--bytesIndex] = (byte) lastMag;
+            }
+            else // sign < 0
+            {
+                bool carry = true;
+
+                while (magIndex > 1)
+                {
+                    uint mag = ~((uint) magnitude[--magIndex]);
+
+                    if (carry)
+                    {
+                        carry = (++mag == uint.MinValue);
+                    }
+
+                    bytes[--bytesIndex] = (byte) mag;
+                    bytes[--bytesIndex] = (byte)(mag >> 8);
+                    bytes[--bytesIndex] = (byte)(mag >> 16);
+                    bytes[--bytesIndex] = (byte)(mag >> 24);
+                }
+
+                uint lastMag = (uint) magnitude[0];
+
+                if (carry)
+                {
+                    // Never wraps because magnitude[0] != 0
+                    --lastMag;
+                }
+
+                while (lastMag > byte.MaxValue)
+                {
+                    bytes[--bytesIndex] = (byte) ~lastMag;
+                    lastMag >>= 8;
+                }
+
+                bytes[--bytesIndex] = (byte) ~lastMag;
+
+                if (bytesIndex > 0)
+                {
+                    bytes[--bytesIndex] = byte.MaxValue;
+                }
+            }
+
+            return bytes;
+        }
+
+        public override string ToString()
+        {
+            return ToString(10);
+        }
 
         public string ToString(int radix)
         {
@@ -3297,60 +3303,60 @@ namespace Org.BouncyCastle.Math
         }
 
         private static BigInteger CreateUValueOf(
-			ulong value)
-		{
-			int msw = (int)(value >> 32);
-			int lsw = (int)value;
-
-			if (msw != 0)
-				return new BigInteger(1, new int[] { msw, lsw }, false);
-
-			if (lsw != 0)
-			{
-				BigInteger n = new BigInteger(1, new int[] { lsw }, false);
-				// Check for a power of two
-				if ((lsw & -lsw) == lsw)
-				{
-					n.nBits = 1;
-				}
-				return n;
-			}
-
-			return Zero;
-		}
-
-		private static BigInteger CreateValueOf(
-			long value)
-		{
-			if (value < 0)
-			{
-				if (value == long.MinValue)
-					return CreateValueOf(~value).Not();
-
-				return CreateValueOf(-value).Negate();
-			}
-
-			return CreateUValueOf((ulong)value);
-		}
+            ulong value)
+        {
+            int msw = (int)(value >> 32);
+            int lsw = (int)value;
+
+            if (msw != 0)
+                return new BigInteger(1, new int[] { msw, lsw }, false);
+
+            if (lsw != 0)
+            {
+                BigInteger n = new BigInteger(1, new int[] { lsw }, false);
+                // Check for a power of two
+                if ((lsw & -lsw) == lsw)
+                {
+                    n.nBits = 1;
+                }
+                return n;
+            }
+
+            return Zero;
+        }
+
+        private static BigInteger CreateValueOf(
+            long value)
+        {
+            if (value < 0)
+            {
+                if (value == long.MinValue)
+                    return CreateValueOf(~value).Not();
+
+                return CreateValueOf(-value).Negate();
+            }
+
+            return CreateUValueOf((ulong)value);
+        }
 
         public static BigInteger ValueOf(
-			long value)
-		{
+            long value)
+        {
             if (value >= 0 && value < SMALL_CONSTANTS.Length)
             {
                 return SMALL_CONSTANTS[value];
             }
 
             return CreateValueOf(value);
-		}
+        }
 
         public int GetLowestSetBit()
-		{
-			if (this.sign == 0)
-				return -1;
+        {
+            if (this.sign == 0)
+                return -1;
 
             return GetLowestSetBitMaskFirst(-1);
-		}
+        }
 
         private int GetLowestSetBitMaskFirst(int firstWordMask)
         {
@@ -3381,195 +3387,195 @@ namespace Org.BouncyCastle.Math
         }
 
         public bool TestBit(
-			int n)
-		{
-			if (n < 0)
-				throw new ArithmeticException("Bit position must not be negative");
-
-			if (sign < 0)
-				return !Not().TestBit(n);
-
-			int wordNum = n / 32;
-			if (wordNum >= magnitude.Length)
-				return false;
-
-			int word = magnitude[magnitude.Length - 1 - wordNum];
-			return ((word >> (n % 32)) & 1) > 0;
-		}
-
-		public BigInteger Or(
-			BigInteger value)
-		{
-			if (this.sign == 0)
-				return value;
-
-			if (value.sign == 0)
-				return this;
-
-			int[] aMag = this.sign > 0
-				? this.magnitude
-				: Add(One).magnitude;
-
-			int[] bMag = value.sign > 0
-				? value.magnitude
-				: value.Add(One).magnitude;
-
-			bool resultNeg = sign < 0 || value.sign < 0;
-			int resultLength = System.Math.Max(aMag.Length, bMag.Length);
-			int[] resultMag = new int[resultLength];
-
-			int aStart = resultMag.Length - aMag.Length;
-			int bStart = resultMag.Length - bMag.Length;
-
-			for (int i = 0; i < resultMag.Length; ++i)
-			{
-				int aWord = i >= aStart ? aMag[i - aStart] : 0;
-				int bWord = i >= bStart ? bMag[i - bStart] : 0;
-
-				if (this.sign < 0)
-				{
-					aWord = ~aWord;
-				}
-
-				if (value.sign < 0)
-				{
-					bWord = ~bWord;
-				}
-
-				resultMag[i] = aWord | bWord;
-
-				if (resultNeg)
-				{
-					resultMag[i] = ~resultMag[i];
-				}
-			}
-
-			BigInteger result = new BigInteger(1, resultMag, true);
-
-			// TODO Optimise this case
-			if (resultNeg)
-			{
-				result = result.Not();
-			}
-
-			return result;
-		}
-
-		public BigInteger Xor(
-			BigInteger value)
-		{
-			if (this.sign == 0)
-				return value;
-
-			if (value.sign == 0)
-				return this;
-
-			int[] aMag = this.sign > 0
-				? this.magnitude
-				: Add(One).magnitude;
-
-			int[] bMag = value.sign > 0
-				? value.magnitude
-				: value.Add(One).magnitude;
-
-			// TODO Can just replace with sign != value.sign?
-			bool resultNeg = (sign < 0 && value.sign >= 0) || (sign >= 0 && value.sign < 0);
-			int resultLength = System.Math.Max(aMag.Length, bMag.Length);
-			int[] resultMag = new int[resultLength];
-
-			int aStart = resultMag.Length - aMag.Length;
-			int bStart = resultMag.Length - bMag.Length;
-
-			for (int i = 0; i < resultMag.Length; ++i)
-			{
-				int aWord = i >= aStart ? aMag[i - aStart] : 0;
-				int bWord = i >= bStart ? bMag[i - bStart] : 0;
-
-				if (this.sign < 0)
-				{
-					aWord = ~aWord;
-				}
-
-				if (value.sign < 0)
-				{
-					bWord = ~bWord;
-				}
-
-				resultMag[i] = aWord ^ bWord;
-
-				if (resultNeg)
-				{
-					resultMag[i] = ~resultMag[i];
-				}
-			}
-
-			BigInteger result = new BigInteger(1, resultMag, true);
-
-			// TODO Optimise this case
-			if (resultNeg)
-			{
-				result = result.Not();
-			}
-
-			return result;
-		}
-
-		public BigInteger SetBit(
-			int n)
-		{
-			if (n < 0)
-				throw new ArithmeticException("Bit address less than zero");
-
-			if (TestBit(n))
-				return this;
-
-			// TODO Handle negative values and zero
-			if (sign > 0 && n < (BitLength - 1))
-				return FlipExistingBit(n);
-
-			return Or(One.ShiftLeft(n));
-		}
-
-		public BigInteger ClearBit(
-			int n)
-		{
-			if (n < 0)
-				throw new ArithmeticException("Bit address less than zero");
-
-			if (!TestBit(n))
-				return this;
-
-			// TODO Handle negative values
-			if (sign > 0 && n < (BitLength - 1))
-				return FlipExistingBit(n);
-
-			return AndNot(One.ShiftLeft(n));
-		}
-
-		public BigInteger FlipBit(
-			int n)
-		{
-			if (n < 0)
-				throw new ArithmeticException("Bit address less than zero");
-
-			// TODO Handle negative values and zero
-			if (sign > 0 && n < (BitLength - 1))
-				return FlipExistingBit(n);
-
-			return Xor(One.ShiftLeft(n));
-		}
-
-		private BigInteger FlipExistingBit(
-			int n)
-		{
-			Debug.Assert(sign > 0);
-			Debug.Assert(n >= 0);
-			Debug.Assert(n < BitLength - 1);
-
-			int[] mag = (int[]) this.magnitude.Clone();
-			mag[mag.Length - 1 - (n >> 5)] ^= (1 << (n & 31)); // Flip bit
-			//mag[mag.Length - 1 - (n / 32)] ^= (1 << (n % 32));
-			return new BigInteger(this.sign, mag, false);
-		}
-	}
+            int n)
+        {
+            if (n < 0)
+                throw new ArithmeticException("Bit position must not be negative");
+
+            if (sign < 0)
+                return !Not().TestBit(n);
+
+            int wordNum = n / 32;
+            if (wordNum >= magnitude.Length)
+                return false;
+
+            int word = magnitude[magnitude.Length - 1 - wordNum];
+            return ((word >> (n % 32)) & 1) > 0;
+        }
+
+        public BigInteger Or(
+            BigInteger value)
+        {
+            if (this.sign == 0)
+                return value;
+
+            if (value.sign == 0)
+                return this;
+
+            int[] aMag = this.sign > 0
+                ? this.magnitude
+                : Add(One).magnitude;
+
+            int[] bMag = value.sign > 0
+                ? value.magnitude
+                : value.Add(One).magnitude;
+
+            bool resultNeg = sign < 0 || value.sign < 0;
+            int resultLength = System.Math.Max(aMag.Length, bMag.Length);
+            int[] resultMag = new int[resultLength];
+
+            int aStart = resultMag.Length - aMag.Length;
+            int bStart = resultMag.Length - bMag.Length;
+
+            for (int i = 0; i < resultMag.Length; ++i)
+            {
+                int aWord = i >= aStart ? aMag[i - aStart] : 0;
+                int bWord = i >= bStart ? bMag[i - bStart] : 0;
+
+                if (this.sign < 0)
+                {
+                    aWord = ~aWord;
+                }
+
+                if (value.sign < 0)
+                {
+                    bWord = ~bWord;
+                }
+
+                resultMag[i] = aWord | bWord;
+
+                if (resultNeg)
+                {
+                    resultMag[i] = ~resultMag[i];
+                }
+            }
+
+            BigInteger result = new BigInteger(1, resultMag, true);
+
+            // TODO Optimise this case
+            if (resultNeg)
+            {
+                result = result.Not();
+            }
+
+            return result;
+        }
+
+        public BigInteger Xor(
+            BigInteger value)
+        {
+            if (this.sign == 0)
+                return value;
+
+            if (value.sign == 0)
+                return this;
+
+            int[] aMag = this.sign > 0
+                ? this.magnitude
+                : Add(One).magnitude;
+
+            int[] bMag = value.sign > 0
+                ? value.magnitude
+                : value.Add(One).magnitude;
+
+            // TODO Can just replace with sign != value.sign?
+            bool resultNeg = (sign < 0 && value.sign >= 0) || (sign >= 0 && value.sign < 0);
+            int resultLength = System.Math.Max(aMag.Length, bMag.Length);
+            int[] resultMag = new int[resultLength];
+
+            int aStart = resultMag.Length - aMag.Length;
+            int bStart = resultMag.Length - bMag.Length;
+
+            for (int i = 0; i < resultMag.Length; ++i)
+            {
+                int aWord = i >= aStart ? aMag[i - aStart] : 0;
+                int bWord = i >= bStart ? bMag[i - bStart] : 0;
+
+                if (this.sign < 0)
+                {
+                    aWord = ~aWord;
+                }
+
+                if (value.sign < 0)
+                {
+                    bWord = ~bWord;
+                }
+
+                resultMag[i] = aWord ^ bWord;
+
+                if (resultNeg)
+                {
+                    resultMag[i] = ~resultMag[i];
+                }
+            }
+
+            BigInteger result = new BigInteger(1, resultMag, true);
+
+            // TODO Optimise this case
+            if (resultNeg)
+            {
+                result = result.Not();
+            }
+
+            return result;
+        }
+
+        public BigInteger SetBit(
+            int n)
+        {
+            if (n < 0)
+                throw new ArithmeticException("Bit address less than zero");
+
+            if (TestBit(n))
+                return this;
+
+            // TODO Handle negative values and zero
+            if (sign > 0 && n < (BitLength - 1))
+                return FlipExistingBit(n);
+
+            return Or(One.ShiftLeft(n));
+        }
+
+        public BigInteger ClearBit(
+            int n)
+        {
+            if (n < 0)
+                throw new ArithmeticException("Bit address less than zero");
+
+            if (!TestBit(n))
+                return this;
+
+            // TODO Handle negative values
+            if (sign > 0 && n < (BitLength - 1))
+                return FlipExistingBit(n);
+
+            return AndNot(One.ShiftLeft(n));
+        }
+
+        public BigInteger FlipBit(
+            int n)
+        {
+            if (n < 0)
+                throw new ArithmeticException("Bit address less than zero");
+
+            // TODO Handle negative values and zero
+            if (sign > 0 && n < (BitLength - 1))
+                return FlipExistingBit(n);
+
+            return Xor(One.ShiftLeft(n));
+        }
+
+        private BigInteger FlipExistingBit(
+            int n)
+        {
+            Debug.Assert(sign > 0);
+            Debug.Assert(n >= 0);
+            Debug.Assert(n < BitLength - 1);
+
+            int[] mag = (int[]) this.magnitude.Clone();
+            mag[mag.Length - 1 - (n >> 5)] ^= (1 << (n & 31)); // Flip bit
+            //mag[mag.Length - 1 - (n / 32)] ^= (1 << (n % 32));
+            return new BigInteger(this.sign, mag, false);
+        }
+    }
 }
diff --git a/crypto/src/math/ec/ECCurve.cs b/crypto/src/math/ec/ECCurve.cs
index 396d42f28..ab98af8f1 100644
--- a/crypto/src/math/ec/ECCurve.cs
+++ b/crypto/src/math/ec/ECCurve.cs
@@ -114,12 +114,13 @@ namespace Org.BouncyCastle.Math.EC
      */
     public class FpCurve : ECCurve
     {
-        private readonly BigInteger q;
+        private readonly BigInteger q, r;
         private readonly FpPoint infinity;
 
         public FpCurve(BigInteger q, BigInteger a, BigInteger b)
         {
             this.q = q;
+            this.r = FpFieldElement.CalculateResidue(q);
             this.a = FromBigInteger(a);
             this.b = FromBigInteger(b);
             this.infinity = new FpPoint(this, null, null);
@@ -142,7 +143,7 @@ namespace Org.BouncyCastle.Math.EC
 
         public override ECFieldElement FromBigInteger(BigInteger x)
         {
-            return new FpFieldElement(this.q, x);
+            return new FpFieldElement(this.q, this.r, x);
         }
 
         public override ECPoint CreatePoint(
@@ -179,7 +180,7 @@ namespace Org.BouncyCastle.Math.EC
             if (bit0 != yTilde)
             {
                 // Use the other root
-                beta = FromBigInteger(q.Subtract(betaValue));
+                beta = beta.Negate();
             }
 
             return new FpPoint(this, x, beta, true);
diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs
index 5235c6c0e..cc5050002 100644
--- a/crypto/src/math/ec/ECFieldElement.cs
+++ b/crypto/src/math/ec/ECFieldElement.cs
@@ -5,365 +5,391 @@ using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Math.EC
 {
-	public abstract class ECFieldElement
-	{
-		public abstract BigInteger ToBigInteger();
-		public abstract string FieldName { get; }
-		public abstract int FieldSize { get; }
-		public abstract ECFieldElement Add(ECFieldElement b);
-		public abstract ECFieldElement Subtract(ECFieldElement b);
-		public abstract ECFieldElement Multiply(ECFieldElement b);
-		public abstract ECFieldElement Divide(ECFieldElement b);
-		public abstract ECFieldElement Negate();
-		public abstract ECFieldElement Square();
-		public abstract ECFieldElement Invert();
-		public abstract ECFieldElement Sqrt();
-
-		public override bool Equals(
-			object obj)
-		{
-			if (obj == this)
-				return true;
-
-			ECFieldElement other = obj as ECFieldElement;
-
-			if (other == null)
-				return false;
-
-			return Equals(other);
-		}
-
-		protected bool Equals(
-			ECFieldElement other)
-		{
-			return ToBigInteger().Equals(other.ToBigInteger());
-		}
-
-		public override int GetHashCode()
-		{
-			return ToBigInteger().GetHashCode();
-		}
-
-		public override string ToString()
-		{
-			return this.ToBigInteger().ToString(2);
-		}
-	}
-
-	public class FpFieldElement
-		: ECFieldElement
-	{
-		private readonly BigInteger q, x;
-
-		public FpFieldElement(
-			BigInteger	q,
-			BigInteger	x)
-		{
-			if (x.CompareTo(q) >= 0)
-				throw new ArgumentException("x value too large in field element");
-
-			this.q = q;
-			this.x = x;
-		}
-
-		public override BigInteger ToBigInteger()
-		{
-			return x;
-		}
-
-		/**
-		 * return the field name for this field.
-		 *
-		 * @return the string "Fp".
-		 */
-		public override string FieldName
-		{
-			get { return "Fp"; }
-		}
-
-		public override int FieldSize
-		{
-			get { return q.BitLength; }
-		}
-
-		public BigInteger Q
-		{
-			get { return q; }
-		}
-
-		public override ECFieldElement Add(
-			ECFieldElement b)
-		{
-			return new FpFieldElement(q, x.Add(b.ToBigInteger()).Mod(q));
-		}
-
-		public override ECFieldElement Subtract(
-			ECFieldElement b)
-		{
-			return new FpFieldElement(q, x.Subtract(b.ToBigInteger()).Mod(q));
-		}
-
-		public override ECFieldElement Multiply(
-			ECFieldElement b)
-		{
-			return new FpFieldElement(q, x.Multiply(b.ToBigInteger()).Mod(q));
-		}
-
-		public override ECFieldElement Divide(
-			ECFieldElement b)
-		{
-			return new FpFieldElement(q, x.Multiply(b.ToBigInteger().ModInverse(q)).Mod(q));
-		}
-
-		public override ECFieldElement Negate()
-		{
-			return new FpFieldElement(q, x.Negate().Mod(q));
-		}
-
-		public override ECFieldElement Square()
-		{
-			return new FpFieldElement(q, x.Multiply(x).Mod(q));
-		}
-
-		public override ECFieldElement Invert()
-		{
-			return new FpFieldElement(q, x.ModInverse(q));
-		}
-
-		// D.1.4 91
-		/**
-		 * return a sqrt root - the routine verifies that the calculation
-		 * returns the right value - if none exists it returns null.
-		 */
-		public override ECFieldElement Sqrt()
-		{
-			if (!q.TestBit(0))
-				throw Platform.CreateNotImplementedException("even value of q");
-
-			// p mod 4 == 3
-			if (q.TestBit(1))
-			{
-				// TODO Can this be optimised (inline the Square?)
-				// z = g^(u+1) + p, p = 4u + 3
-				ECFieldElement z = new FpFieldElement(q, x.ModPow(q.ShiftRight(2).Add(BigInteger.One), q));
-
-                return this.Equals(z.Square()) ? z : null;
-			}
-
-			// p mod 4 == 1
-			BigInteger qMinusOne = q.Subtract(BigInteger.One);
-
-			BigInteger legendreExponent = qMinusOne.ShiftRight(1);
-			if (!(x.ModPow(legendreExponent, q).Equals(BigInteger.One)))
-				return null;
-
-			BigInteger u = qMinusOne.ShiftRight(2);
-			BigInteger k = u.ShiftLeft(1).Add(BigInteger.One);
-
-			BigInteger Q = this.x;
-			BigInteger fourQ = Q.ShiftLeft(2).Mod(q);
-
-			BigInteger U, V;
-			do
-			{
-				Random rand = new Random();
-				BigInteger P;
-				do
-				{
-					P = new BigInteger(q.BitLength, rand);
-				}
-				while (P.CompareTo(q) >= 0
-					|| !(P.Multiply(P).Subtract(fourQ).ModPow(legendreExponent, q).Equals(qMinusOne)));
-
-				BigInteger[] result = fastLucasSequence(q, P, Q, k);
-				U = result[0];
-				V = result[1];
-
-				if (V.Multiply(V).Mod(q).Equals(fourQ))
-				{
-					// Integer division by 2, mod q
-					if (V.TestBit(0))
-					{
-						V = V.Add(q);
-					}
-
-					V = V.ShiftRight(1);
-
-					Debug.Assert(V.Multiply(V).Mod(q).Equals(x));
-
-					return new FpFieldElement(q, V);
-				}
-			}
-			while (U.Equals(BigInteger.One) || U.Equals(qMinusOne));
-
-			return null;
-
-
-//			BigInteger qMinusOne = q.Subtract(BigInteger.One);
-//
-//			BigInteger legendreExponent = qMinusOne.ShiftRight(1);
-//			if (!(x.ModPow(legendreExponent, q).Equals(BigInteger.One)))
-//				return null;
-//
-//			Random rand = new Random();
-//			BigInteger fourX = x.ShiftLeft(2);
-//
-//			BigInteger r;
-//			do
-//			{
-//				r = new BigInteger(q.BitLength, rand);
-//			}
-//			while (r.CompareTo(q) >= 0
-//				|| !(r.Multiply(r).Subtract(fourX).ModPow(legendreExponent, q).Equals(qMinusOne)));
-//
-//			BigInteger n1 = qMinusOne.ShiftRight(2);
-//			BigInteger n2 = n1.Add(BigInteger.One);
-//
-//			BigInteger wOne = WOne(r, x, q);
-//			BigInteger wSum = W(n1, wOne, q).Add(W(n2, wOne, q)).Mod(q);
-//			BigInteger twoR = r.ShiftLeft(1);
-//
-//			BigInteger root = twoR.ModPow(q.Subtract(BigInteger.Two), q)
-//				.Multiply(x).Mod(q)
-//				.Multiply(wSum).Mod(q);
-//
-//			return new FpFieldElement(q, root);
-		}
-
-//		private static BigInteger W(BigInteger n, BigInteger wOne, BigInteger p)
-//		{
-//			if (n.Equals(BigInteger.One))
-//				return wOne;
-//
-//			bool isEven = !n.TestBit(0);
-//			n = n.ShiftRight(1);
-//			if (isEven)
-//			{
-//				BigInteger w = W(n, wOne, p);
-//				return w.Multiply(w).Subtract(BigInteger.Two).Mod(p);
-//			}
-//			BigInteger w1 = W(n.Add(BigInteger.One), wOne, p);
-//			BigInteger w2 = W(n, wOne, p);
-//			return w1.Multiply(w2).Subtract(wOne).Mod(p);
-//		}
-//
-//		private BigInteger WOne(BigInteger r, BigInteger x, BigInteger p)
-//		{
-//			return r.Multiply(r).Multiply(x.ModPow(q.Subtract(BigInteger.Two), q)).Subtract(BigInteger.Two).Mod(p);
-//		}
-
-		private static BigInteger[] fastLucasSequence(
-			BigInteger	p,
-			BigInteger	P,
-			BigInteger	Q,
-			BigInteger	k)
-		{
-			// TODO Research and apply "common-multiplicand multiplication here"
-
-			int n = k.BitLength;
-			int s = k.GetLowestSetBit();
-
-			Debug.Assert(k.TestBit(s));
-
-			BigInteger Uh = BigInteger.One;
-			BigInteger Vl = BigInteger.Two;
-			BigInteger Vh = P;
-			BigInteger Ql = BigInteger.One;
-			BigInteger Qh = BigInteger.One;
-
-			for (int j = n - 1; j >= s + 1; --j)
-			{
-				Ql = Ql.Multiply(Qh).Mod(p);
-
-				if (k.TestBit(j))
-				{
-					Qh = Ql.Multiply(Q).Mod(p);
-					Uh = Uh.Multiply(Vh).Mod(p);
-					Vl = Vh.Multiply(Vl).Subtract(P.Multiply(Ql)).Mod(p);
-					Vh = Vh.Multiply(Vh).Subtract(Qh.ShiftLeft(1)).Mod(p);
-				}
-				else
-				{
-					Qh = Ql;
-					Uh = Uh.Multiply(Vl).Subtract(Ql).Mod(p);
-					Vh = Vh.Multiply(Vl).Subtract(P.Multiply(Ql)).Mod(p);
-					Vl = Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1)).Mod(p);
-				}
-			}
-
-			Ql = Ql.Multiply(Qh).Mod(p);
-			Qh = Ql.Multiply(Q).Mod(p);
-			Uh = Uh.Multiply(Vl).Subtract(Ql).Mod(p);
-			Vl = Vh.Multiply(Vl).Subtract(P.Multiply(Ql)).Mod(p);
-			Ql = Ql.Multiply(Qh).Mod(p);
-
-			for (int j = 1; j <= s; ++j)
-			{
-				Uh = Uh.Multiply(Vl).Mod(p);
-				Vl = Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1)).Mod(p);
-				Ql = Ql.Multiply(Ql).Mod(p);
-			}
-
-			return new BigInteger[]{ Uh, Vl };
-		}
-
-//		private static BigInteger[] verifyLucasSequence(
-//			BigInteger	p,
-//			BigInteger	P,
-//			BigInteger	Q,
-//			BigInteger	k)
-//		{
-//			BigInteger[] actual = fastLucasSequence(p, P, Q, k);
-//			BigInteger[] plus1 = fastLucasSequence(p, P, Q, k.Add(BigInteger.One));
-//			BigInteger[] plus2 = fastLucasSequence(p, P, Q, k.Add(BigInteger.Two));
-//
-//			BigInteger[] check = stepLucasSequence(p, P, Q, actual, plus1);
-//
-//			Debug.Assert(check[0].Equals(plus2[0]));
-//			Debug.Assert(check[1].Equals(plus2[1]));
-//
-//			return actual;
-//		}
-//
-//		private static BigInteger[] stepLucasSequence(
-//			BigInteger		p,
-//			BigInteger		P,
-//			BigInteger		Q,
-//			BigInteger[]	backTwo,
-//			BigInteger[]	backOne)
-//		{
-//			return new BigInteger[]
-//			{
-//				P.Multiply(backOne[0]).Subtract(Q.Multiply(backTwo[0])).Mod(p),
-//				P.Multiply(backOne[1]).Subtract(Q.Multiply(backTwo[1])).Mod(p)
-//			};
-//		}
-
-		public override bool Equals(
-			object obj)
-		{
-			if (obj == this)
-				return true;
-
-			FpFieldElement other = obj as FpFieldElement;
-
-			if (other == null)
-				return false;
-
-			return Equals(other);
-		}
-
-		protected bool Equals(
-			FpFieldElement other)
-		{
-			return q.Equals(other.q) && base.Equals(other);
-		}
-
-		public override int GetHashCode()
-		{
-			return q.GetHashCode() ^ base.GetHashCode();
-		}
-	}
+    public abstract class ECFieldElement
+    {
+        public abstract BigInteger ToBigInteger();
+        public abstract string FieldName { get; }
+        public abstract int FieldSize { get; }
+        public abstract ECFieldElement Add(ECFieldElement b);
+        public abstract ECFieldElement Subtract(ECFieldElement b);
+        public abstract ECFieldElement Multiply(ECFieldElement b);
+        public abstract ECFieldElement Divide(ECFieldElement b);
+        public abstract ECFieldElement Negate();
+        public abstract ECFieldElement Square();
+        public abstract ECFieldElement Invert();
+        public abstract ECFieldElement Sqrt();
+
+        public virtual int BitLength
+        {
+            get { return ToBigInteger().BitLength; }
+        }
+
+        public virtual bool IsOne
+        {
+            get { return BitLength == 1; }
+        }
+
+        public virtual bool IsZero
+        {
+            get { return 0 == ToBigInteger().SignValue; }
+        }
+
+        public virtual bool TestBitZero()
+        {
+            return ToBigInteger().TestBit(0);
+        }
+
+        public override bool Equals(
+            object obj)
+        {
+            if (obj == this)
+                return true;
+
+            ECFieldElement other = obj as ECFieldElement;
+
+            if (other == null)
+                return false;
+
+            return Equals(other);
+        }
+
+        public virtual bool Equals(
+            ECFieldElement other)
+        {
+            return ToBigInteger().Equals(other.ToBigInteger());
+        }
+
+        public override int GetHashCode()
+        {
+            return ToBigInteger().GetHashCode();
+        }
+
+        public override string ToString()
+        {
+            return this.ToBigInteger().ToString(16);
+        }
+
+        public virtual byte[] GetEncoded()
+        {
+            return BigIntegers.AsUnsignedByteArray((FieldSize + 7) / 8, ToBigInteger());
+        }
+    }
+
+    public class FpFieldElement
+        : ECFieldElement
+    {
+        private readonly BigInteger q, r, x;
+
+        internal static BigInteger CalculateResidue(BigInteger p)
+        {
+            int bitLength = p.BitLength;
+            if (bitLength > 128)
+            {
+                BigInteger firstWord = p.ShiftRight(bitLength - 64);
+                if (firstWord.LongValue == -1L)
+                {
+                    return BigInteger.One.ShiftLeft(bitLength).Subtract(p);
+                }
+            }
+            return null;
+        }
+
+        [Obsolete("Use ECCurve.FromBigInteger to construct field elements")]
+        public FpFieldElement(BigInteger q, BigInteger x)
+            : this(q, CalculateResidue(q), x)
+        {
+        }
+
+        internal FpFieldElement(BigInteger q, BigInteger r, BigInteger x)
+        {
+            if (x == null || x.SignValue < 0 || x.CompareTo(q) >= 0)
+                throw new ArgumentException("value invalid in Fp field element", "x");
+
+            this.q = q;
+            this.r = r;
+            this.x = x;
+        }
+
+        public override BigInteger ToBigInteger()
+        {
+            return x;
+        }
+
+        /**
+         * return the field name for this field.
+         *
+         * @return the string "Fp".
+         */
+        public override string FieldName
+        {
+            get { return "Fp"; }
+        }
+
+        public override int FieldSize
+        {
+            get { return q.BitLength; }
+        }
+
+        public BigInteger Q
+        {
+            get { return q; }
+        }
+
+        public override ECFieldElement Add(
+            ECFieldElement b)
+        {
+            return new FpFieldElement(q, r, ModAdd(x, b.ToBigInteger()));
+        }
+
+        public override ECFieldElement Subtract(
+            ECFieldElement b)
+        {
+            BigInteger x2 = b.ToBigInteger();
+            BigInteger x3 = x.Subtract(x2);
+            if (x3.SignValue < 0)
+            {
+                x3 = x3.Add(q);
+            }
+            return new FpFieldElement(q, r, x3);
+        }
+
+        public override ECFieldElement Multiply(
+            ECFieldElement b)
+        {
+            return new FpFieldElement(q, r, ModMult(x, b.ToBigInteger()));
+        }
+
+        public override ECFieldElement Divide(
+            ECFieldElement b)
+        {
+            return new FpFieldElement(q, r, ModMult(x, b.ToBigInteger().ModInverse(q)));
+        }
+
+        public override ECFieldElement Negate()
+        {
+            return x.SignValue == 0 ? this : new FpFieldElement(q, r, q.Subtract(x));
+        }
+
+        public override ECFieldElement Square()
+        {
+            return new FpFieldElement(q, r, ModMult(x, x));
+        }
+
+        public override ECFieldElement Invert()
+        {
+            // TODO Modular inversion can be faster for a (Generalized) Mersenne Prime.
+            return new FpFieldElement(q, r, x.ModInverse(q));
+        }
+
+        // D.1.4 91
+        /**
+         * return a sqrt root - the routine verifies that the calculation
+         * returns the right value - if none exists it returns null.
+         */
+        public override ECFieldElement Sqrt()
+        {
+            if (!q.TestBit(0))
+                throw Platform.CreateNotImplementedException("even value of q");
+
+            // p mod 4 == 3
+            if (q.TestBit(1))
+            {
+                // TODO Can this be optimised (inline the Square?)
+                // z = g^(u+1) + p, p = 4u + 3
+                ECFieldElement z = new FpFieldElement(q, r, x.ModPow(q.ShiftRight(2).Add(BigInteger.One), q));
+
+                return z.Square().Equals(this) ? z : null;
+            }
+
+            // p mod 4 == 1
+            BigInteger qMinusOne = q.Subtract(BigInteger.One);
+
+            BigInteger legendreExponent = qMinusOne.ShiftRight(1);
+            if (!(x.ModPow(legendreExponent, q).Equals(BigInteger.One)))
+                return null;
+
+            BigInteger u = qMinusOne.ShiftRight(2);
+            BigInteger k = u.ShiftLeft(1).Add(BigInteger.One);
+
+            BigInteger X = this.x;
+            BigInteger fourX = ModDouble(ModDouble(X)); ;
+
+            BigInteger U, V;
+            Random rand = new Random();
+            do
+            {
+                BigInteger P;
+                do
+                {
+                    P = new BigInteger(q.BitLength, rand);
+                }
+                while (P.CompareTo(q) >= 0
+                    || !(ModMult(P, P).Subtract(fourX).ModPow(legendreExponent, q).Equals(qMinusOne)));
+
+                BigInteger[] result = LucasSequence(P, X, k);
+                U = result[0];
+                V = result[1];
+
+                if (ModMult(V, V).Equals(fourX))
+                {
+                    // Integer division by 2, mod q
+                    if (V.TestBit(0))
+                    {
+                        V = V.Add(q);
+                    }
+
+                    V = V.ShiftRight(1);
+
+                    Debug.Assert(ModMult(V, V).Equals(X));
+
+                    return new FpFieldElement(q, r, V);
+                }
+            }
+            while (U.Equals(BigInteger.One) || U.Equals(qMinusOne));
+
+            return null;
+        }
+
+        private BigInteger[] LucasSequence(
+            BigInteger	P,
+            BigInteger	Q,
+            BigInteger	k)
+        {
+            // TODO Research and apply "common-multiplicand multiplication here"
+
+            int n = k.BitLength;
+            int s = k.GetLowestSetBit();
+
+            Debug.Assert(k.TestBit(s));
+
+            BigInteger Uh = BigInteger.One;
+            BigInteger Vl = BigInteger.Two;
+            BigInteger Vh = P;
+            BigInteger Ql = BigInteger.One;
+            BigInteger Qh = BigInteger.One;
+
+            for (int j = n - 1; j >= s + 1; --j)
+            {
+                Ql = ModMult(Ql, Qh);
+
+                if (k.TestBit(j))
+                {
+                    Qh = ModMult(Ql, Q);
+                    Uh = ModMult(Uh, Vh);
+                    Vl = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql)));
+                    Vh = ModReduce(Vh.Multiply(Vh).Subtract(Qh.ShiftLeft(1)));
+                }
+                else
+                {
+                    Qh = Ql;
+                    Uh = ModReduce(Uh.Multiply(Vl).Subtract(Ql));
+                    Vh = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql)));
+                    Vl = ModReduce(Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1)));
+                }
+            }
+
+            Ql = ModMult(Ql, Qh);
+            Qh = ModMult(Ql, Q);
+            Uh = ModReduce(Uh.Multiply(Vl).Subtract(Ql));
+            Vl = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql)));
+            Ql = ModMult(Ql, Qh);
+
+            for (int j = 1; j <= s; ++j)
+            {
+                Uh = ModMult(Uh, Vl);
+                Vl = ModReduce(Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1)));
+                Ql = ModMult(Ql, Ql);
+            }
+
+            return new BigInteger[] { Uh, Vl };
+        }
+
+        protected virtual BigInteger ModAdd(BigInteger x1, BigInteger x2)
+        {
+            BigInteger x3 = x1.Add(x2);
+            if (x3.CompareTo(q) >= 0)
+            {
+                x3 = x3.Subtract(q);
+            }
+            return x3;
+        }
+
+        protected virtual BigInteger ModDouble(BigInteger x)
+        {
+            BigInteger _2x = x.ShiftLeft(1);
+            if (_2x.CompareTo(q) >= 0)
+            {
+                _2x = _2x.Subtract(q);
+            }
+            return _2x;
+        }
+
+        protected virtual BigInteger ModMult(BigInteger x1, BigInteger x2)
+        {
+            return ModReduce(x1.Multiply(x2));
+        }
+
+        protected virtual BigInteger ModReduce(BigInteger x)
+        {
+            if (r != null)
+            {
+                bool negative = x.SignValue < 0;
+                if (negative)
+                {
+                    x = x.Abs();
+                }
+                int qLen = q.BitLength;
+                while (x.BitLength > (qLen + 1))
+                {
+                    BigInteger u = x.ShiftRight(qLen);
+                    BigInteger v = x.Subtract(u.ShiftLeft(qLen));
+                    if (!r.Equals(BigInteger.One))
+                    {
+                        u = u.Multiply(r);
+                    }
+                    x = u.Add(v);
+                }
+                while (x.CompareTo(q) >= 0)
+                {
+                    x = x.Subtract(q);
+                }
+                if (negative && x.SignValue != 0)
+                {
+                    x = q.Subtract(x);
+                }
+            }
+            else
+            {
+                x = x.Mod(q);
+            }
+            return x;
+        }
+
+        public override bool Equals(
+            object obj)
+        {
+            if (obj == this)
+                return true;
+
+            FpFieldElement other = obj as FpFieldElement;
+
+            if (other == null)
+                return false;
+
+            return Equals(other);
+        }
+
+        public virtual bool Equals(
+            FpFieldElement other)
+        {
+            return q.Equals(other.q) && base.Equals(other);
+        }
+
+        public override int GetHashCode()
+        {
+            return q.GetHashCode() ^ base.GetHashCode();
+        }
+    }
 
 //	/**
 //	 * Class representing the Elements of the finite field
@@ -815,439 +841,439 @@ namespace Org.BouncyCastle.Math.EC
 //		}
 //	}
 
-	/**
-	 * Class representing the Elements of the finite field
-	 * <code>F<sub>2<sup>m</sup></sub></code> in polynomial basis (PB)
-	 * representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial
-	 * basis representations are supported. Gaussian normal basis (GNB)
-	 * representation is not supported.
-	 */
-	public class F2mFieldElement
-		: ECFieldElement
-	{
-		/**
-		 * Indicates gaussian normal basis representation (GNB). Number chosen
-		 * according to X9.62. GNB is not implemented at present.
-		 */
-		public const int Gnb = 1;
-
-		/**
-		 * Indicates trinomial basis representation (Tpb). Number chosen
-		 * according to X9.62.
-		 */
-		public const int Tpb = 2;
-
-		/**
-		 * Indicates pentanomial basis representation (Ppb). Number chosen
-		 * according to X9.62.
-		 */
-		public const int Ppb = 3;
-
-		/**
-		 * Tpb or Ppb.
-		 */
-		private int representation;
-
-		/**
-		 * The exponent <code>m</code> of <code>F<sub>2<sup>m</sup></sub></code>.
-		 */
-		private int m;
-
-		/**
-		 * Tpb: The integer <code>k</code> where <code>x<sup>m</sup> +
-		 * x<sup>k</sup> + 1</code> represents the reduction polynomial
-		 * <code>f(z)</code>.<br/>
-		 * Ppb: The integer <code>k1</code> where <code>x<sup>m</sup> +
-		 * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-		 * represents the reduction polynomial <code>f(z)</code>.<br/>
-		 */
-		private int k1;
-
-		/**
-		 * Tpb: Always set to <code>0</code><br/>
-		 * Ppb: The integer <code>k2</code> where <code>x<sup>m</sup> +
-		 * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-		 * represents the reduction polynomial <code>f(z)</code>.<br/>
-		 */
-		private int k2;
-
-		/**
-			* Tpb: Always set to <code>0</code><br/>
-			* Ppb: The integer <code>k3</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.<br/>
-			*/
-		private int k3;
-
-		/**
-		 * The <code>IntArray</code> holding the bits.
-		 */
-		private IntArray x;
-
-		/**
-		 * The number of <code>int</code>s required to hold <code>m</code> bits.
-		 */
-		private readonly int t;
-
-		/**
-			* Constructor for Ppb.
-			* @param m  The exponent <code>m</code> of
-			* <code>F<sub>2<sup>m</sup></sub></code>.
-			* @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.
-			* @param k2 The integer <code>k2</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.
-			* @param k3 The integer <code>k3</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.
-			* @param x The BigInteger representing the value of the field element.
-			*/
-		public F2mFieldElement(
-			int			m,
-			int			k1,
-			int			k2,
-			int			k3,
-			BigInteger	x)
-		{
-			// t = m / 32 rounded up to the next integer
-			this.t = (m + 31) >> 5;
-			this.x = new IntArray(x, t);
-
-			if ((k2 == 0) && (k3 == 0))
-			{
-				this.representation = Tpb;
-			}
-			else
-			{
-				if (k2 >= k3)
-					throw new ArgumentException("k2 must be smaller than k3");
-				if (k2 <= 0)
-					throw new ArgumentException("k2 must be larger than 0");
-
-				this.representation = Ppb;
-			}
-
-			if (x.SignValue < 0)
-				throw new ArgumentException("x value cannot be negative");
-
-			this.m = m;
-			this.k1 = k1;
-			this.k2 = k2;
-			this.k3 = k3;
-		}
-
-		/**
-			* Constructor for Tpb.
-			* @param m  The exponent <code>m</code> of
-			* <code>F<sub>2<sup>m</sup></sub></code>.
-			* @param k The integer <code>k</code> where <code>x<sup>m</sup> +
-			* x<sup>k</sup> + 1</code> represents the reduction
-			* polynomial <code>f(z)</code>.
-			* @param x The BigInteger representing the value of the field element.
-			*/
-		public F2mFieldElement(
-			int			m,
-			int			k,
-			BigInteger	x)
-			: this(m, k, 0, 0, x)
-		{
-			// Set k1 to k, and set k2 and k3 to 0
-		}
-
-		private F2mFieldElement(int m, int k1, int k2, int k3, IntArray x)
-		{
-			t = (m + 31) >> 5;
-			this.x = x;
-			this.m = m;
-			this.k1 = k1;
-			this.k2 = k2;
-			this.k3 = k3;
-
-			if ((k2 == 0) && (k3 == 0))
-			{
-				this.representation = Tpb;
-			}
-			else
-			{
-				this.representation = Ppb;
-			}
-		}
-
-		public override BigInteger ToBigInteger()
-		{
-			return x.ToBigInteger();
-		}
-
-		public override string FieldName
-		{
-			get { return "F2m"; }
-		}
-
-		public override int FieldSize
-		{
-			get { return m; }
-		}
-
-		/**
-		* Checks, if the ECFieldElements <code>a</code> and <code>b</code>
-		* are elements of the same field <code>F<sub>2<sup>m</sup></sub></code>
-		* (having the same representation).
-		* @param a field element.
-		* @param b field element to be compared.
-		* @throws ArgumentException if <code>a</code> and <code>b</code>
-		* are not elements of the same field
-		* <code>F<sub>2<sup>m</sup></sub></code> (having the same
-		* representation).
-		*/
-		public static void CheckFieldElements(
-			ECFieldElement	a,
-			ECFieldElement	b)
-		{
-			if (!(a is F2mFieldElement) || !(b is F2mFieldElement))
-			{
-				throw new ArgumentException("Field elements are not "
-					+ "both instances of F2mFieldElement");
-			}
-
-			F2mFieldElement aF2m = (F2mFieldElement)a;
-			F2mFieldElement bF2m = (F2mFieldElement)b;
-
-			if ((aF2m.m != bF2m.m) || (aF2m.k1 != bF2m.k1)
-				|| (aF2m.k2 != bF2m.k2) || (aF2m.k3 != bF2m.k3))
-			{
-				throw new ArgumentException("Field elements are not "
-					+ "elements of the same field F2m");
-			}
-
-			if (aF2m.representation != bF2m.representation)
-			{
-				// Should never occur
-				throw new ArgumentException(
-					"One of the field "
-					+ "elements are not elements has incorrect representation");
-			}
-		}
-
-		public override ECFieldElement Add(
-			ECFieldElement b)
-		{
-			// No check performed here for performance reasons. Instead the
-			// elements involved are checked in ECPoint.F2m
-			// checkFieldElements(this, b);
-			IntArray iarrClone = (IntArray) this.x.Copy();
-			F2mFieldElement bF2m = (F2mFieldElement) b;
-			iarrClone.AddShifted(bF2m.x, 0);
-			return new F2mFieldElement(m, k1, k2, k3, iarrClone);
-		}
-
-		public override ECFieldElement Subtract(
-			ECFieldElement b)
-		{
-			// Addition and subtraction are the same in F2m
-			return Add(b);
-		}
-
-		public override ECFieldElement Multiply(
-			ECFieldElement b)
-		{
-			// Right-to-left comb multiplication in the IntArray
-			// Input: Binary polynomials a(z) and b(z) of degree at most m-1
-			// Output: c(z) = a(z) * b(z) mod f(z)
-
-			// No check performed here for performance reasons. Instead the
-			// elements involved are checked in ECPoint.F2m
-			// checkFieldElements(this, b);
-			F2mFieldElement bF2m = (F2mFieldElement) b;
-			IntArray mult = x.Multiply(bF2m.x, m);
-			mult.Reduce(m, new int[]{k1, k2, k3});
-			return new F2mFieldElement(m, k1, k2, k3, mult);
-		}
-
-		public override ECFieldElement Divide(
-			ECFieldElement b)
-		{
-			// There may be more efficient implementations
-			ECFieldElement bInv = b.Invert();
-			return Multiply(bInv);
-		}
-
-		public override ECFieldElement Negate()
-		{
-			// -x == x holds for all x in F2m
-			return this;
-		}
-
-		public override ECFieldElement Square()
-		{
-			IntArray squared = x.Square(m);
-			squared.Reduce(m, new int[]{k1, k2, k3});
-			return new F2mFieldElement(m, k1, k2, k3, squared);
-		}
-
-		public override ECFieldElement Invert()
-		{
-			// Inversion in F2m using the extended Euclidean algorithm
-			// Input: A nonzero polynomial a(z) of degree at most m-1
-			// Output: a(z)^(-1) mod f(z)
-
-			// u(z) := a(z)
+    /**
+     * Class representing the Elements of the finite field
+     * <code>F<sub>2<sup>m</sup></sub></code> in polynomial basis (PB)
+     * representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial
+     * basis representations are supported. Gaussian normal basis (GNB)
+     * representation is not supported.
+     */
+    public class F2mFieldElement
+        : ECFieldElement
+    {
+        /**
+         * Indicates gaussian normal basis representation (GNB). Number chosen
+         * according to X9.62. GNB is not implemented at present.
+         */
+        public const int Gnb = 1;
+
+        /**
+         * Indicates trinomial basis representation (Tpb). Number chosen
+         * according to X9.62.
+         */
+        public const int Tpb = 2;
+
+        /**
+         * Indicates pentanomial basis representation (Ppb). Number chosen
+         * according to X9.62.
+         */
+        public const int Ppb = 3;
+
+        /**
+         * Tpb or Ppb.
+         */
+        private int representation;
+
+        /**
+         * The exponent <code>m</code> of <code>F<sub>2<sup>m</sup></sub></code>.
+         */
+        private int m;
+
+        /**
+         * Tpb: The integer <code>k</code> where <code>x<sup>m</sup> +
+         * x<sup>k</sup> + 1</code> represents the reduction polynomial
+         * <code>f(z)</code>.<br/>
+         * Ppb: The integer <code>k1</code> where <code>x<sup>m</sup> +
+         * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+         * represents the reduction polynomial <code>f(z)</code>.<br/>
+         */
+        private int k1;
+
+        /**
+         * Tpb: Always set to <code>0</code><br/>
+         * Ppb: The integer <code>k2</code> where <code>x<sup>m</sup> +
+         * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+         * represents the reduction polynomial <code>f(z)</code>.<br/>
+         */
+        private int k2;
+
+        /**
+            * Tpb: Always set to <code>0</code><br/>
+            * Ppb: The integer <code>k3</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.<br/>
+            */
+        private int k3;
+
+        /**
+         * The <code>IntArray</code> holding the bits.
+         */
+        private IntArray x;
+
+        /**
+         * The number of <code>int</code>s required to hold <code>m</code> bits.
+         */
+        private readonly int t;
+
+        /**
+            * Constructor for Ppb.
+            * @param m  The exponent <code>m</code> of
+            * <code>F<sub>2<sup>m</sup></sub></code>.
+            * @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.
+            * @param k2 The integer <code>k2</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.
+            * @param k3 The integer <code>k3</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.
+            * @param x The BigInteger representing the value of the field element.
+            */
+        public F2mFieldElement(
+            int			m,
+            int			k1,
+            int			k2,
+            int			k3,
+            BigInteger	x)
+        {
+            // t = m / 32 rounded up to the next integer
+            this.t = (m + 31) >> 5;
+            this.x = new IntArray(x, t);
+
+            if ((k2 == 0) && (k3 == 0))
+            {
+                this.representation = Tpb;
+            }
+            else
+            {
+                if (k2 >= k3)
+                    throw new ArgumentException("k2 must be smaller than k3");
+                if (k2 <= 0)
+                    throw new ArgumentException("k2 must be larger than 0");
+
+                this.representation = Ppb;
+            }
+
+            if (x.SignValue < 0)
+                throw new ArgumentException("x value cannot be negative");
+
+            this.m = m;
+            this.k1 = k1;
+            this.k2 = k2;
+            this.k3 = k3;
+        }
+
+        /**
+            * Constructor for Tpb.
+            * @param m  The exponent <code>m</code> of
+            * <code>F<sub>2<sup>m</sup></sub></code>.
+            * @param k The integer <code>k</code> where <code>x<sup>m</sup> +
+            * x<sup>k</sup> + 1</code> represents the reduction
+            * polynomial <code>f(z)</code>.
+            * @param x The BigInteger representing the value of the field element.
+            */
+        public F2mFieldElement(
+            int			m,
+            int			k,
+            BigInteger	x)
+            : this(m, k, 0, 0, x)
+        {
+            // Set k1 to k, and set k2 and k3 to 0
+        }
+
+        private F2mFieldElement(int m, int k1, int k2, int k3, IntArray x)
+        {
+            t = (m + 31) >> 5;
+            this.x = x;
+            this.m = m;
+            this.k1 = k1;
+            this.k2 = k2;
+            this.k3 = k3;
+
+            if ((k2 == 0) && (k3 == 0))
+            {
+                this.representation = Tpb;
+            }
+            else
+            {
+                this.representation = Ppb;
+            }
+        }
+
+        public override BigInteger ToBigInteger()
+        {
+            return x.ToBigInteger();
+        }
+
+        public override string FieldName
+        {
+            get { return "F2m"; }
+        }
+
+        public override int FieldSize
+        {
+            get { return m; }
+        }
+
+        /**
+        * Checks, if the ECFieldElements <code>a</code> and <code>b</code>
+        * are elements of the same field <code>F<sub>2<sup>m</sup></sub></code>
+        * (having the same representation).
+        * @param a field element.
+        * @param b field element to be compared.
+        * @throws ArgumentException if <code>a</code> and <code>b</code>
+        * are not elements of the same field
+        * <code>F<sub>2<sup>m</sup></sub></code> (having the same
+        * representation).
+        */
+        public static void CheckFieldElements(
+            ECFieldElement	a,
+            ECFieldElement	b)
+        {
+            if (!(a is F2mFieldElement) || !(b is F2mFieldElement))
+            {
+                throw new ArgumentException("Field elements are not "
+                    + "both instances of F2mFieldElement");
+            }
+
+            F2mFieldElement aF2m = (F2mFieldElement)a;
+            F2mFieldElement bF2m = (F2mFieldElement)b;
+
+            if ((aF2m.m != bF2m.m) || (aF2m.k1 != bF2m.k1)
+                || (aF2m.k2 != bF2m.k2) || (aF2m.k3 != bF2m.k3))
+            {
+                throw new ArgumentException("Field elements are not "
+                    + "elements of the same field F2m");
+            }
+
+            if (aF2m.representation != bF2m.representation)
+            {
+                // Should never occur
+                throw new ArgumentException(
+                    "One of the field "
+                    + "elements are not elements has incorrect representation");
+            }
+        }
+
+        public override ECFieldElement Add(
+            ECFieldElement b)
+        {
+            // No check performed here for performance reasons. Instead the
+            // elements involved are checked in ECPoint.F2m
+            // checkFieldElements(this, b);
+            IntArray iarrClone = (IntArray) this.x.Copy();
+            F2mFieldElement bF2m = (F2mFieldElement) b;
+            iarrClone.AddShifted(bF2m.x, 0);
+            return new F2mFieldElement(m, k1, k2, k3, iarrClone);
+        }
+
+        public override ECFieldElement Subtract(
+            ECFieldElement b)
+        {
+            // Addition and subtraction are the same in F2m
+            return Add(b);
+        }
+
+        public override ECFieldElement Multiply(
+            ECFieldElement b)
+        {
+            // Right-to-left comb multiplication in the IntArray
+            // Input: Binary polynomials a(z) and b(z) of degree at most m-1
+            // Output: c(z) = a(z) * b(z) mod f(z)
+
+            // No check performed here for performance reasons. Instead the
+            // elements involved are checked in ECPoint.F2m
+            // checkFieldElements(this, b);
+            F2mFieldElement bF2m = (F2mFieldElement) b;
+            IntArray mult = x.Multiply(bF2m.x, m);
+            mult.Reduce(m, new int[]{k1, k2, k3});
+            return new F2mFieldElement(m, k1, k2, k3, mult);
+        }
+
+        public override ECFieldElement Divide(
+            ECFieldElement b)
+        {
+            // There may be more efficient implementations
+            ECFieldElement bInv = b.Invert();
+            return Multiply(bInv);
+        }
+
+        public override ECFieldElement Negate()
+        {
+            // -x == x holds for all x in F2m
+            return this;
+        }
+
+        public override ECFieldElement Square()
+        {
+            IntArray squared = x.Square(m);
+            squared.Reduce(m, new int[]{k1, k2, k3});
+            return new F2mFieldElement(m, k1, k2, k3, squared);
+        }
+
+        public override ECFieldElement Invert()
+        {
+            // Inversion in F2m using the extended Euclidean algorithm
+            // Input: A nonzero polynomial a(z) of degree at most m-1
+            // Output: a(z)^(-1) mod f(z)
+
+            // u(z) := a(z)
             IntArray uz = (IntArray)this.x.Copy();
 
-			// v(z) := f(z)
-			IntArray vz = new IntArray(t);
-			vz.SetBit(m);
-			vz.SetBit(0);
-			vz.SetBit(this.k1);
-			if (this.representation == Ppb)
-			{
-				vz.SetBit(this.k2);
-				vz.SetBit(this.k3);
-			}
-
-			// g1(z) := 1, g2(z) := 0
-			IntArray g1z = new IntArray(t);
-			g1z.SetBit(0);
-			IntArray g2z = new IntArray(t);
-
-			// while u != 0
-			while (uz.GetUsedLength() > 0)
+            // v(z) := f(z)
+            IntArray vz = new IntArray(t);
+            vz.SetBit(m);
+            vz.SetBit(0);
+            vz.SetBit(this.k1);
+            if (this.representation == Ppb)
+            {
+                vz.SetBit(this.k2);
+                vz.SetBit(this.k3);
+            }
+
+            // g1(z) := 1, g2(z) := 0
+            IntArray g1z = new IntArray(t);
+            g1z.SetBit(0);
+            IntArray g2z = new IntArray(t);
+
+            // while u != 0
+            while (uz.GetUsedLength() > 0)
 //            while (uz.bitLength() > 1)
-			{
-				// j := deg(u(z)) - deg(v(z))
-				int j = uz.BitLength - vz.BitLength;
+            {
+                // j := deg(u(z)) - deg(v(z))
+                int j = uz.BitLength - vz.BitLength;
 
-				// If j < 0 then: u(z) <-> v(z), g1(z) <-> g2(z), j := -j
-				if (j < 0)
-				{
+                // If j < 0 then: u(z) <-> v(z), g1(z) <-> g2(z), j := -j
+                if (j < 0)
+                {
                     IntArray uzCopy = uz;
-					uz = vz;
-					vz = uzCopy;
+                    uz = vz;
+                    vz = uzCopy;
 
                     IntArray g1zCopy = g1z;
-					g1z = g2z;
-					g2z = g1zCopy;
-
-					j = -j;
-				}
-
-				// u(z) := u(z) + z^j * v(z)
-				// Note, that no reduction modulo f(z) is required, because
-				// deg(u(z) + z^j * v(z)) <= max(deg(u(z)), j + deg(v(z)))
-				// = max(deg(u(z)), deg(u(z)) - deg(v(z)) + deg(v(z))
-				// = deg(u(z))
-				// uz = uz.xor(vz.ShiftLeft(j));
-				// jInt = n / 32
-				int jInt = j >> 5;
-				// jInt = n % 32
-				int jBit = j & 0x1F;
-				IntArray vzShift = vz.ShiftLeft(jBit);
-				uz.AddShifted(vzShift, jInt);
-
-				// g1(z) := g1(z) + z^j * g2(z)
+                    g1z = g2z;
+                    g2z = g1zCopy;
+
+                    j = -j;
+                }
+
+                // u(z) := u(z) + z^j * v(z)
+                // Note, that no reduction modulo f(z) is required, because
+                // deg(u(z) + z^j * v(z)) <= max(deg(u(z)), j + deg(v(z)))
+                // = max(deg(u(z)), deg(u(z)) - deg(v(z)) + deg(v(z))
+                // = deg(u(z))
+                // uz = uz.xor(vz.ShiftLeft(j));
+                // jInt = n / 32
+                int jInt = j >> 5;
+                // jInt = n % 32
+                int jBit = j & 0x1F;
+                IntArray vzShift = vz.ShiftLeft(jBit);
+                uz.AddShifted(vzShift, jInt);
+
+                // g1(z) := g1(z) + z^j * g2(z)
 //                g1z = g1z.xor(g2z.ShiftLeft(j));
-				IntArray g2zShift = g2z.ShiftLeft(jBit);
-				g1z.AddShifted(g2zShift, jInt);
-			}
-			return new F2mFieldElement(this.m, this.k1, this.k2, this.k3, g2z);
-		}
-
-		public override ECFieldElement Sqrt()
-		{
-			throw new ArithmeticException("Not implemented");
-		}
-
-		/**
-			* @return the representation of the field
-			* <code>F<sub>2<sup>m</sup></sub></code>, either of
-			* {@link F2mFieldElement.Tpb} (trinomial
-			* basis representation) or
-			* {@link F2mFieldElement.Ppb} (pentanomial
-			* basis representation).
-			*/
-		public int Representation
-		{
-			get { return this.representation; }
-		}
-
-		/**
-			* @return the degree <code>m</code> of the reduction polynomial
-			* <code>f(z)</code>.
-			*/
-		public int M
-		{
-			get { return this.m; }
-		}
-
-		/**
-			* @return Tpb: The integer <code>k</code> where <code>x<sup>m</sup> +
-			* x<sup>k</sup> + 1</code> represents the reduction polynomial
-			* <code>f(z)</code>.<br/>
-			* Ppb: The integer <code>k1</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.<br/>
-			*/
-		public int K1
-		{
-			get { return this.k1; }
-		}
-
-		/**
-			* @return Tpb: Always returns <code>0</code><br/>
-			* Ppb: The integer <code>k2</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.<br/>
-			*/
-		public int K2
-		{
-			get { return this.k2; }
-		}
-
-		/**
-			* @return Tpb: Always set to <code>0</code><br/>
-			* Ppb: The integer <code>k3</code> where <code>x<sup>m</sup> +
-			* x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
-			* represents the reduction polynomial <code>f(z)</code>.<br/>
-			*/
-		public int K3
-		{
-			get { return this.k3; }
-		}
-
-		public override bool Equals(
-			object obj)
-		{
-			if (obj == this)
-				return true;
-
-			F2mFieldElement other = obj as F2mFieldElement;
-
-			if (other == null)
-				return false;
-
-			return Equals(other);
-		}
-
-		protected bool Equals(
-			F2mFieldElement other)
-		{
-			return m == other.m
-				&& k1 == other.k1
-				&& k2 == other.k2
-				&& k3 == other.k3
-				&& representation == other.representation
-				&& base.Equals(other);
-		}
-
-		public override int GetHashCode()
-		{
-			return m.GetHashCode()
-				^	k1.GetHashCode()
-				^	k2.GetHashCode()
-				^	k3.GetHashCode()
-				^	representation.GetHashCode()
-				^	base.GetHashCode();
-		}
-	}
+                IntArray g2zShift = g2z.ShiftLeft(jBit);
+                g1z.AddShifted(g2zShift, jInt);
+            }
+            return new F2mFieldElement(this.m, this.k1, this.k2, this.k3, g2z);
+        }
+
+        public override ECFieldElement Sqrt()
+        {
+            throw new ArithmeticException("Not implemented");
+        }
+
+        /**
+            * @return the representation of the field
+            * <code>F<sub>2<sup>m</sup></sub></code>, either of
+            * {@link F2mFieldElement.Tpb} (trinomial
+            * basis representation) or
+            * {@link F2mFieldElement.Ppb} (pentanomial
+            * basis representation).
+            */
+        public int Representation
+        {
+            get { return this.representation; }
+        }
+
+        /**
+            * @return the degree <code>m</code> of the reduction polynomial
+            * <code>f(z)</code>.
+            */
+        public int M
+        {
+            get { return this.m; }
+        }
+
+        /**
+            * @return Tpb: The integer <code>k</code> where <code>x<sup>m</sup> +
+            * x<sup>k</sup> + 1</code> represents the reduction polynomial
+            * <code>f(z)</code>.<br/>
+            * Ppb: The integer <code>k1</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.<br/>
+            */
+        public int K1
+        {
+            get { return this.k1; }
+        }
+
+        /**
+            * @return Tpb: Always returns <code>0</code><br/>
+            * Ppb: The integer <code>k2</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.<br/>
+            */
+        public int K2
+        {
+            get { return this.k2; }
+        }
+
+        /**
+            * @return Tpb: Always set to <code>0</code><br/>
+            * Ppb: The integer <code>k3</code> where <code>x<sup>m</sup> +
+            * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
+            * represents the reduction polynomial <code>f(z)</code>.<br/>
+            */
+        public int K3
+        {
+            get { return this.k3; }
+        }
+
+        public override bool Equals(
+            object obj)
+        {
+            if (obj == this)
+                return true;
+
+            F2mFieldElement other = obj as F2mFieldElement;
+
+            if (other == null)
+                return false;
+
+            return Equals(other);
+        }
+
+        public virtual bool Equals(
+            F2mFieldElement other)
+        {
+            return m == other.m
+                && k1 == other.k1
+                && k2 == other.k2
+                && k3 == other.k3
+                && representation == other.representation
+                && base.Equals(other);
+        }
+
+        public override int GetHashCode()
+        {
+            return m.GetHashCode()
+                ^	k1.GetHashCode()
+                ^	k2.GetHashCode()
+                ^	k3.GetHashCode()
+                ^	representation.GetHashCode()
+                ^	base.GetHashCode();
+        }
+    }
 }
diff --git a/crypto/src/math/field/FiniteFields.cs b/crypto/src/math/field/FiniteFields.cs
new file mode 100644
index 000000000..7b84569fe
--- /dev/null
+++ b/crypto/src/math/field/FiniteFields.cs
@@ -0,0 +1,54 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    public abstract class FiniteFields
+    {
+        internal static readonly IFiniteField GF_2 = new PrimeField(BigInteger.ValueOf(2));
+        internal static readonly IFiniteField GF_3 = new PrimeField(BigInteger.ValueOf(3));
+
+        public static IPolynomialExtensionField GetBinaryExtensionField(int[] exponents)
+        {
+            if (exponents[0] != 0)
+            {
+                throw new ArgumentException("Irreducible polynomials in GF(2) must have constant term", "exponents");
+            }
+            for (int i = 1; i < exponents.Length; ++i)
+            {
+                if (exponents[i] <= exponents[i - 1])
+                {
+                    throw new ArgumentException("Polynomial exponents must be montonically increasing", "exponents");
+                }
+            }
+
+            return new GenericPolynomialExtensionField(GF_2, new GF2Polynomial(exponents));
+        }
+
+    //    public static IPolynomialExtensionField GetTernaryExtensionField(Term[] terms)
+    //    {
+    //        return new GenericPolynomialExtensionField(GF_3, new GF3Polynomial(terms));
+    //    }
+
+        public static IFiniteField GetPrimeField(BigInteger characteristic)
+        {
+            int bitLength = characteristic.BitLength;
+            if (characteristic.SignValue <= 0 || bitLength < 2)
+            {
+                throw new ArgumentException("Must be >= 2", "characteristic");
+            }
+
+            if (bitLength < 3)
+            {
+                switch (characteristic.IntValue)
+                {
+                case 2:
+                    return GF_2;
+                case 3:
+                    return GF_3;
+                }
+            }
+
+            return new PrimeField(characteristic);
+        }
+    }
+}
diff --git a/crypto/src/math/field/GF2Polynomial.cs b/crypto/src/math/field/GF2Polynomial.cs
new file mode 100644
index 000000000..c062d508a
--- /dev/null
+++ b/crypto/src/math/field/GF2Polynomial.cs
@@ -0,0 +1,46 @@
+using System;
+
+using Org.BouncyCastle.Utilities;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    internal class GF2Polynomial
+        : IPolynomial
+    {
+        protected readonly int[] exponents;
+
+        internal GF2Polynomial(int[] exponents)
+        {
+            this.exponents = Arrays.Clone(exponents);
+        }
+
+        public virtual int Degree
+        {
+            get { return exponents[exponents.Length - 1]; }
+        }
+
+        public virtual int[] GetExponentsPresent()
+        {
+            return Arrays.Clone(exponents);
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (this == obj)
+            {
+                return true;
+            }
+            GF2Polynomial other = obj as GF2Polynomial;
+            if (null == other)
+            {
+                return false;
+            }
+            return Arrays.AreEqual(exponents, other.exponents);
+        }
+
+        public override int GetHashCode()
+        {
+            return Arrays.GetHashCode(exponents);
+        }
+    }
+}
diff --git a/crypto/src/math/field/GenericPolynomialExtensionField.cs b/crypto/src/math/field/GenericPolynomialExtensionField.cs
new file mode 100644
index 000000000..13ef57165
--- /dev/null
+++ b/crypto/src/math/field/GenericPolynomialExtensionField.cs
@@ -0,0 +1,63 @@
+using System;
+
+using Org.BouncyCastle.Utilities;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    internal class GenericPolynomialExtensionField
+        : IPolynomialExtensionField
+    {
+        protected readonly IFiniteField subfield;
+        protected readonly IPolynomial minimalPolynomial;
+
+        internal GenericPolynomialExtensionField(IFiniteField subfield, IPolynomial polynomial)
+        {
+            this.subfield = subfield;
+            this.minimalPolynomial = polynomial;
+        }
+
+        public virtual BigInteger Characteristic
+        {
+            get { return subfield.Characteristic; }
+        }
+
+        public virtual int Dimension
+        {
+            get { return subfield.Dimension * minimalPolynomial.Degree; }
+        }
+
+        public virtual IFiniteField Subfield
+        {
+            get { return subfield; }
+        }
+
+        public virtual int Degree
+        {
+            get { return minimalPolynomial.Degree; }
+        }
+
+        public virtual IPolynomial MinimalPolynomial
+        {
+            get { return minimalPolynomial; }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (this == obj)
+            {
+                return true;
+            }
+            GenericPolynomialExtensionField other = obj as GenericPolynomialExtensionField;
+            if (null == other)
+            {
+                return false;
+            }
+            return subfield.Equals(other.subfield) && minimalPolynomial.Equals(other.minimalPolynomial);
+        }
+
+        public override int GetHashCode()
+        {
+            return subfield.GetHashCode() ^ Integers.RotateLeft(minimalPolynomial.GetHashCode(), 16);
+        }
+    }
+}
diff --git a/crypto/src/math/field/IExtensionField.cs b/crypto/src/math/field/IExtensionField.cs
new file mode 100644
index 000000000..17f45c153
--- /dev/null
+++ b/crypto/src/math/field/IExtensionField.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    public interface IExtensionField
+        : IFiniteField
+    {
+        IFiniteField Subfield { get; }
+
+        int Degree { get; }
+    }
+}
diff --git a/crypto/src/math/field/IFiniteField.cs b/crypto/src/math/field/IFiniteField.cs
new file mode 100644
index 000000000..b618be74b
--- /dev/null
+++ b/crypto/src/math/field/IFiniteField.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    public interface IFiniteField
+    {
+        BigInteger Characteristic { get; }
+
+        int Dimension { get; }
+    }
+}
diff --git a/crypto/src/math/field/IPolynomial.cs b/crypto/src/math/field/IPolynomial.cs
new file mode 100644
index 000000000..ad6dfb662
--- /dev/null
+++ b/crypto/src/math/field/IPolynomial.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    public interface IPolynomial
+    {
+        int Degree { get; }
+
+        //BigInteger[] GetCoefficients();
+
+        int[] GetExponentsPresent();
+
+        //Term[] GetNonZeroTerms();
+    }
+}
diff --git a/crypto/src/math/field/IPolynomialExtensionField.cs b/crypto/src/math/field/IPolynomialExtensionField.cs
new file mode 100644
index 000000000..3818c1855
--- /dev/null
+++ b/crypto/src/math/field/IPolynomialExtensionField.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    public interface IPolynomialExtensionField
+        : IExtensionField
+    {
+        IPolynomial MinimalPolynomial { get; }
+    }
+}
diff --git a/crypto/src/math/field/PrimeField.cs b/crypto/src/math/field/PrimeField.cs
new file mode 100644
index 000000000..f6ba629d5
--- /dev/null
+++ b/crypto/src/math/field/PrimeField.cs
@@ -0,0 +1,44 @@
+using System;
+
+namespace Org.BouncyCastle.Math.Field
+{
+    internal class PrimeField
+        : IFiniteField
+    {
+        protected readonly BigInteger characteristic;
+
+        internal PrimeField(BigInteger characteristic)
+        {
+            this.characteristic = characteristic;
+        }
+
+        public virtual BigInteger Characteristic
+        {
+            get { return characteristic; }
+        }
+
+        public virtual int Dimension
+        {
+            get { return 1; }
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (this == obj)
+            {
+                return true;
+            }
+            PrimeField other = obj as PrimeField;
+            if (null == other)
+            {
+                return false;
+            }
+            return characteristic.Equals(other.characteristic);
+        }
+
+        public override int GetHashCode()
+        {
+            return characteristic.GetHashCode();
+        }
+    }
+}
diff --git a/crypto/src/openpgp/PgpUtilities.cs b/crypto/src/openpgp/PgpUtilities.cs
index 7cd3dfc4f..32e37b819 100644
--- a/crypto/src/openpgp/PgpUtilities.cs
+++ b/crypto/src/openpgp/PgpUtilities.cs
@@ -97,7 +97,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 			return GetDigestName(hashAlgorithm) + "with" + encAlg;
         }
 
-		public static string GetSymmetricCipherName(
+	public static string GetSymmetricCipherName(
             SymmetricKeyAlgorithmTag algorithm)
         {
             switch (algorithm)
@@ -124,12 +124,18 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 					return "AES";
 				case SymmetricKeyAlgorithmTag.Twofish:
 					return "Twofish";
+				case SymmetricKeyAlgorithmTag.Camellia128:
+					return "Camellia";
+				case SymmetricKeyAlgorithmTag.Camellia192:
+					return "Camellia";
+				case SymmetricKeyAlgorithmTag.Camellia256:
+					return "Camellia";
 				default:
 					throw new PgpException("unknown symmetric algorithm: " + algorithm);
             }
         }
 
-		public static int GetKeySize(SymmetricKeyAlgorithmTag algorithm)
+	public static int GetKeySize(SymmetricKeyAlgorithmTag algorithm)
         {
             int keySize;
             switch (algorithm)
@@ -142,14 +148,17 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
                 case SymmetricKeyAlgorithmTag.Blowfish:
                 case SymmetricKeyAlgorithmTag.Safer:
                 case SymmetricKeyAlgorithmTag.Aes128:
+                case SymmetricKeyAlgorithmTag.Camellia128:
                     keySize = 128;
                     break;
                 case SymmetricKeyAlgorithmTag.TripleDes:
                 case SymmetricKeyAlgorithmTag.Aes192:
+                case SymmetricKeyAlgorithmTag.Camellia192:
                     keySize = 192;
                     break;
                 case SymmetricKeyAlgorithmTag.Aes256:
                 case SymmetricKeyAlgorithmTag.Twofish:
+                case SymmetricKeyAlgorithmTag.Camellia256:
                     keySize = 256;
                     break;
                 default:
diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs
index 6718aea10..55f20206a 100644
--- a/crypto/src/pkcs/Pkcs12Store.cs
+++ b/crypto/src/pkcs/Pkcs12Store.cs
@@ -1132,8 +1132,7 @@ namespace Org.BouncyCastle.Pkcs
 
             IMac mac = (IMac) PbeUtilities.CreateEngine(oid);
             mac.Init(cipherParams);
-            mac.BlockUpdate(data, 0, data.Length);
-            return MacUtilities.DoFinal(mac);
+            return MacUtilities.DoFinal(mac, data);
         }
 
         private static byte[] CryptPbeData(
diff --git a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
index 305b2de35..acea77856 100644
--- a/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
+++ b/crypto/src/pkix/PkixCertPathValidatorUtilities.cs
@@ -528,7 +528,7 @@ namespace Org.BouncyCastle.Pkix
 					}
 					catch (Exception e)
 					{
-						new Exception(
+						throw new Exception(
 							"Reason code CRL entry extension could not be decoded.",
 							e);
 					}
@@ -683,8 +683,8 @@ namespace Org.BouncyCastle.Pkix
 		/// the certificates</param>
 		/// <param name="certStores">a List containing only X509Store objects. These
 		/// are used to search for certificates.</param>
-		/// <returns>a Collection of all found <see cref="X509Certificate "/> or
-		/// org.bouncycastle.x509.X509AttributeCertificate objects.
+		/// <returns>a Collection of all found <see cref="X509Certificate"/> or
+		/// <see cref="Org.BouncyCastle.X509.IX509AttributeCertificate"/> objects.
 		/// May be empty but never <code>null</code>.</returns>
 		/// <exception cref="Exception"></exception>
 		internal static ICollection FindCertificates(
@@ -864,7 +864,7 @@ namespace Org.BouncyCastle.Pkix
 			}
 			catch (Exception e)
 			{
-				new Exception("Could not get issuer information from distribution point.", e);
+				throw new Exception("Could not get issuer information from distribution point.", e);
 			}
 
 			if (cert is X509Certificate)
@@ -924,7 +924,7 @@ namespace Org.BouncyCastle.Pkix
 			}
 			catch (IOException e)
 			{
-				new Exception("Cannot extract issuer from CRL.", e);
+				throw new Exception("Cannot extract issuer from CRL.", e);
 			}
 
 			BigInteger completeCRLNumber = null;
diff --git a/crypto/src/pkix/Rfc3280CertPathUtilities.cs b/crypto/src/pkix/Rfc3280CertPathUtilities.cs
index bae657d90..c6f3fbff9 100644
--- a/crypto/src/pkix/Rfc3280CertPathUtilities.cs
+++ b/crypto/src/pkix/Rfc3280CertPathUtilities.cs
@@ -1197,10 +1197,10 @@ namespace Org.BouncyCastle.Pkix
 			}
 			if (certStatus.Status != CertStatus.Unrevoked)
 			{
-				// TODO This format is forced by the NistCertPath tests
-				string formattedDate = certStatus.RevocationDate.Value.ToString(
-					"G", new CultureInfo("en-us"));
-				string message = "Certificate revocation after " + formattedDate;
+				// This format is enforced by the NistCertPath tests
+                string formattedDate = certStatus.RevocationDate.Value.ToString(
+                    "ddd MMM dd HH:mm:ss K yyyy");
+                string message = "Certificate revocation after " + formattedDate;
 				message += ", reason: " + CrlReasons[certStatus.Status];
 				throw new Exception(message);
 			}
diff --git a/crypto/src/pkix/Rfc3281CertPathUtilities.cs b/crypto/src/pkix/Rfc3281CertPathUtilities.cs
index bda2aa737..101ef5e11 100644
--- a/crypto/src/pkix/Rfc3281CertPathUtilities.cs
+++ b/crypto/src/pkix/Rfc3281CertPathUtilities.cs
@@ -195,10 +195,10 @@ namespace Org.BouncyCastle.Pkix
 					}
 					if (certStatus.Status != CertStatus.Unrevoked)
 					{
-						// TODO This format is forced by the NistCertPath tests
-						string formattedDate = certStatus.RevocationDate.Value.ToString(
-                            "G", new CultureInfo("en-us"));
-						string message = "Attribute certificate revocation after "
+                        // This format is enforced by the NistCertPath tests
+                        string formattedDate = certStatus.RevocationDate.Value.ToString(
+                            "ddd MMM dd HH:mm:ss K yyyy");
+                        string message = "Attribute certificate revocation after "
 							+ formattedDate;
 						message += ", reason: "
 							+ Rfc3280CertPathUtilities.CrlReasons[certStatus.Status];
diff --git a/crypto/src/security/CipherUtilities.cs b/crypto/src/security/CipherUtilities.cs
index cda769535..cdb711f69 100644
--- a/crypto/src/security/CipherUtilities.cs
+++ b/crypto/src/security/CipherUtilities.cs
@@ -389,11 +389,9 @@ namespace Org.BouncyCastle.Security
                 case CipherAlgorithm.HC256:
                     streamCipher = new HC256Engine();
                     break;
-#if INCLUDE_IDEA
                 case CipherAlgorithm.IDEA:
                     blockCipher = new IdeaEngine();
                     break;
-#endif
                 case CipherAlgorithm.NOEKEON:
                     blockCipher = new NoekeonEngine();
                     break;
@@ -716,9 +714,7 @@ namespace Org.BouncyCastle.Security
                 case CipherAlgorithm.DES: return new DesEngine();
                 case CipherAlgorithm.DESEDE: return new DesEdeEngine();
                 case CipherAlgorithm.GOST28147: return new Gost28147Engine();
-#if INCLUDE_IDEA
                 case CipherAlgorithm.IDEA: return new IdeaEngine();
-#endif
                 case CipherAlgorithm.NOEKEON: return new NoekeonEngine();
                 case CipherAlgorithm.RC2: return new RC2Engine();
                 case CipherAlgorithm.RC5: return new RC532Engine();
diff --git a/crypto/src/security/DotNetUtilities.cs b/crypto/src/security/DotNetUtilities.cs
index 036c0d519..d50e17d39 100644
--- a/crypto/src/security/DotNetUtilities.cs
+++ b/crypto/src/security/DotNetUtilities.cs
@@ -4,6 +4,7 @@ using System;
 using System.Security.Cryptography;
 using SystemX509 = System.Security.Cryptography.X509Certificates;
 
+using Org.BouncyCastle.Asn1.Pkcs;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Parameters;
@@ -161,22 +162,21 @@ namespace Org.BouncyCastle.Security
 
 		public static RSA ToRSA(RsaKeyParameters rsaKey)
 		{
-			RSAParameters rp = ToRSAParameters(rsaKey);
-			RSACryptoServiceProvider rsaCsp = new RSACryptoServiceProvider();
-			// TODO This call appears to not work for private keys (when no CRT info)
-			rsaCsp.ImportParameters(rp);
-			return rsaCsp;
-		}
+            // TODO This appears to not work for private keys (when no CRT info)
+            return CreateRSAProvider(ToRSAParameters(rsaKey));
+        }
 
 		public static RSA ToRSA(RsaPrivateCrtKeyParameters privKey)
 		{
-			RSAParameters rp = ToRSAParameters(privKey);
-			RSACryptoServiceProvider rsaCsp = new RSACryptoServiceProvider();
-			rsaCsp.ImportParameters(rp);
-			return rsaCsp;
-		}
+            return CreateRSAProvider(ToRSAParameters(privKey));
+        }
 
-		public static RSAParameters ToRSAParameters(RsaKeyParameters rsaKey)
+        public static RSA ToRSA(RsaPrivateKeyStructure privKey)
+        {
+            return CreateRSAProvider(ToRSAParameters(privKey));
+        }
+
+        public static RSAParameters ToRSAParameters(RsaKeyParameters rsaKey)
 		{
 			RSAParameters rp = new RSAParameters();
 			rp.Modulus = rsaKey.Modulus.ToByteArrayUnsigned();
@@ -201,7 +201,21 @@ namespace Org.BouncyCastle.Security
 			return rp;
 		}
 
-		// TODO Move functionality to more general class
+        public static RSAParameters ToRSAParameters(RsaPrivateKeyStructure privKey)
+        {
+            RSAParameters rp = new RSAParameters();
+            rp.Modulus = privKey.Modulus.ToByteArrayUnsigned();
+            rp.Exponent = privKey.PublicExponent.ToByteArrayUnsigned();
+            rp.P = privKey.Prime1.ToByteArrayUnsigned();
+            rp.Q = privKey.Prime2.ToByteArrayUnsigned();
+            rp.D = ConvertRSAParametersField(privKey.PrivateExponent, rp.Modulus.Length);
+            rp.DP = ConvertRSAParametersField(privKey.Exponent1, rp.P.Length);
+            rp.DQ = ConvertRSAParametersField(privKey.Exponent2, rp.Q.Length);
+            rp.InverseQ = ConvertRSAParametersField(privKey.Coefficient, rp.Q.Length);
+            return rp;
+        }
+
+        // TODO Move functionality to more general class
 		private static byte[] ConvertRSAParametersField(BigInteger n, int size)
 		{
 			byte[] bs = n.ToByteArrayUnsigned();
@@ -216,6 +230,13 @@ namespace Org.BouncyCastle.Security
 			Array.Copy(bs, 0, padded, size - bs.Length, bs.Length);
 			return padded;
 		}
+
+        private static RSA CreateRSAProvider(RSAParameters rp)
+        {
+            RSACryptoServiceProvider rsaCsp = new RSACryptoServiceProvider();
+            rsaCsp.ImportParameters(rp);
+            return rsaCsp;
+        }
 	}
 }
 
diff --git a/crypto/src/security/MacUtilities.cs b/crypto/src/security/MacUtilities.cs
index 49162fb57..d1f8c89b4 100644
--- a/crypto/src/security/MacUtilities.cs
+++ b/crypto/src/security/MacUtilities.cs
@@ -185,7 +185,6 @@ namespace Org.BouncyCastle.Security
             {
                 return new CfbBlockCipherMac(new SkipjackEngine());
             }
-#if INCLUDE_IDEA
             if (mechanism == "IDEAMAC")
             {
                 return new CbcBlockCipherMac(new IdeaEngine());
@@ -194,7 +193,6 @@ namespace Org.BouncyCastle.Security
             {
                 return new CfbBlockCipherMac(new IdeaEngine());
             }
-#endif
             if (mechanism == "RC2MAC")
             {
                 return new CbcBlockCipherMac(new RC2Engine());
@@ -232,12 +230,17 @@ namespace Org.BouncyCastle.Security
             return (string) algorithms[oid.Id];
         }
 
-        public static byte[] DoFinal(
-            IMac mac)
+        public static byte[] DoFinal(IMac mac)
         {
             byte[] b = new byte[mac.GetMacSize()];
             mac.DoFinal(b, 0);
             return b;
         }
+
+        public static byte[] DoFinal(IMac mac, byte[] input)
+        {
+            mac.BlockUpdate(input, 0, input.Length);
+            return DoFinal(mac);
+        }
     }
 }
diff --git a/crypto/src/security/ParameterUtilities.cs b/crypto/src/security/ParameterUtilities.cs
index bf448edff..b2d7c0dff 100644
--- a/crypto/src/security/ParameterUtilities.cs
+++ b/crypto/src/security/ParameterUtilities.cs
@@ -83,10 +83,8 @@ namespace Org.BouncyCastle.Security
                 CryptoProObjectIdentifiers.GostR28147Cbc);
             AddAlgorithm("HC128");
             AddAlgorithm("HC256");
-#if INCLUDE_IDEA
             AddAlgorithm("IDEA",
                 "1.3.6.1.4.1.188.7.1.1.2");
-#endif
             AddAlgorithm("NOEKEON");
             AddAlgorithm("RC2",
                 PkcsObjectIdentifiers.RC2Cbc,
@@ -234,12 +232,10 @@ namespace Org.BouncyCastle.Security
                 {
                     iv = Cast5CbcParameters.GetInstance(asn1Params).GetIV();
                 }
-#if INCLUDE_IDEA
                 else if (canonical == "IDEA")
                 {
                     iv = IdeaCbcPar.GetInstance(asn1Params).GetIV();
                 }
-#endif
                 else if (canonical == "RC2")
                 {
                     iv = RC2CbcParameter.GetInstance(asn1Params).GetIV();
@@ -288,10 +284,8 @@ namespace Org.BouncyCastle.Security
             if (canonical == "CAST5")
                 return new Cast5CbcParameters(CreateIV(random, 8), 128);
 
-#if INCLUDE_IDEA
             if (canonical == "IDEA")
                 return new IdeaCbcPar(CreateIV(random, 8));
-#endif
 
             if (canonical == "RC2")
                 return new RC2CbcParameter(CreateIV(random, 8));
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs
index 7d211e5dc..d90bbdd90 100644
--- a/crypto/src/util/Arrays.cs
+++ b/crypto/src/util/Arrays.cs
@@ -3,26 +3,21 @@ using System.Text;
 
 namespace Org.BouncyCastle.Utilities
 {
-
     /// <summary> General array utilities.</summary>
-    public sealed class Arrays
+    public abstract class Arrays
     {
-        private Arrays()
+        public static bool AreEqual(
+            bool[]  a,
+            bool[]  b)
         {
-        }
-
-		public static bool AreEqual(
-			bool[]  a,
-			bool[]  b)
-		{
-			if (a == b)
-				return true;
+            if (a == b)
+                return true;
 
-			if (a == null || b == null)
-				return false;
+            if (a == null || b == null)
+                return false;
 
             return HaveSameContents(a, b);
-		}
+        }
 
         public static bool AreEqual(
             char[] a,
@@ -44,61 +39,61 @@ namespace Org.BouncyCastle.Utilities
         /// <param name="b">Right side.</param>
         /// <returns>True if equal.</returns>
         public static bool AreEqual(
-			byte[]	a,
-			byte[]	b)
+            byte[]	a,
+            byte[]	b)
         {
-			if (a == b)
-				return true;
-
-			if (a == null || b == null)
-				return false;
-
-			return HaveSameContents(a, b);
-		}
-
-		[Obsolete("Use 'AreEqual' method instead")]
-		public static bool AreSame(
-			byte[]	a,
-			byte[]	b)
-		{
-			return AreEqual(a, b);
-		}
-
-		/// <summary>
-		/// A constant time equals comparison - does not terminate early if
-		/// test will fail.
-		/// </summary>
-		/// <param name="a">first array</param>
-		/// <param name="b">second array</param>
-		/// <returns>true if arrays equal, false otherwise.</returns>
-		public static bool ConstantTimeAreEqual(
-			byte[]	a,
-			byte[]	b)
-		{
-			int i = a.Length;
-			if (i != b.Length)
-				return false;
-			int cmp = 0;
-			while (i != 0)
-			{
-				--i;
-				cmp |= (a[i] ^ b[i]);
-			}
-			return cmp == 0;
-		}
-
-		public static bool AreEqual(
-			int[]	a,
-			int[]	b)
-		{
-			if (a == b)
-				return true;
-
-			if (a == null || b == null)
-				return false;
-
-			return HaveSameContents(a, b);
-		}
+            if (a == b)
+                return true;
+
+            if (a == null || b == null)
+                return false;
+
+            return HaveSameContents(a, b);
+        }
+
+        [Obsolete("Use 'AreEqual' method instead")]
+        public static bool AreSame(
+            byte[]	a,
+            byte[]	b)
+        {
+            return AreEqual(a, b);
+        }
+
+        /// <summary>
+        /// A constant time equals comparison - does not terminate early if
+        /// test will fail.
+        /// </summary>
+        /// <param name="a">first array</param>
+        /// <param name="b">second array</param>
+        /// <returns>true if arrays equal, false otherwise.</returns>
+        public static bool ConstantTimeAreEqual(
+            byte[]	a,
+            byte[]	b)
+        {
+            int i = a.Length;
+            if (i != b.Length)
+                return false;
+            int cmp = 0;
+            while (i != 0)
+            {
+                --i;
+                cmp |= (a[i] ^ b[i]);
+            }
+            return cmp == 0;
+        }
+
+        public static bool AreEqual(
+            int[]	a,
+            int[]	b)
+        {
+            if (a == b)
+                return true;
+
+            if (a == null || b == null)
+                return false;
+
+            return HaveSameContents(a, b);
+        }
 
         private static bool HaveSameContents(
             bool[] a,
@@ -133,135 +128,137 @@ namespace Org.BouncyCastle.Utilities
         }
 
         private static bool HaveSameContents(
-			byte[]	a,
-			byte[]	b)
-		{
-			int i = a.Length;
-			if (i != b.Length)
-				return false;
-			while (i != 0)
-			{
-				--i;
-				if (a[i] != b[i])
-					return false;
-			}
-			return true;
-		}
-
-		private static bool HaveSameContents(
-			int[]	a,
-			int[]	b)
-		{
-			int i = a.Length;
-			if (i != b.Length)
-				return false;
-			while (i != 0)
-			{
-				--i;
-				if (a[i] != b[i])
-					return false;
-			}
-			return true;
-		}
+            byte[]	a,
+            byte[]	b)
+        {
+            int i = a.Length;
+            if (i != b.Length)
+                return false;
+            while (i != 0)
+            {
+                --i;
+                if (a[i] != b[i])
+                    return false;
+            }
+            return true;
+        }
+
+        private static bool HaveSameContents(
+            int[]	a,
+            int[]	b)
+        {
+            int i = a.Length;
+            if (i != b.Length)
+                return false;
+            while (i != 0)
+            {
+                --i;
+                if (a[i] != b[i])
+                    return false;
+            }
+            return true;
+        }
 
         public static string ToString(
-			object[] a)
-		{
-			StringBuilder sb = new StringBuilder('[');
-			if (a.Length > 0)
-			{
-				sb.Append(a[0]);
-				for (int index = 1; index < a.Length; ++index)
-				{
-					sb.Append(", ").Append(a[index]);
-				}
-			}
-			sb.Append(']');
-			return sb.ToString();
-		}
-
-		public static int GetHashCode(
-			byte[] data)
-		{
-			if (data == null)
-			{
-				return 0;
-			}
-
-			int i = data.Length;
-			int hc = i + 1;
-
-			while (--i >= 0)
-			{
-				hc *= 257;
-				hc ^= data[i];
-			}
-
-			return hc;
-		}
-
-		public static byte[] Clone(
-			byte[] data)
-		{
-			return data == null ? null : (byte[]) data.Clone();
-		}
-
-		public static byte[] Clone(
-			byte[] data, 
-			byte[] existing)
-		{
-			if (data == null)
-			{
-				return null;
-			}
-			if ((existing == null) || (existing.Length != data.Length))
-			{
-				return Clone(data);
-			}
-			Array.Copy(data, 0, existing, 0, existing.Length);
-			return existing;
-		}
-
-		public static int[] Clone(
-			int[] data)
-		{
-			return data == null ? null : (int[]) data.Clone();
-		}
-
-		[CLSCompliantAttribute(false)]
-		public static ulong[] Clone(
-			ulong[] data)
-		{
-			return data == null ? null : (ulong[]) data.Clone();
-		}
-
-		[CLSCompliantAttribute(false)]
-		public static ulong[] Clone(
-			ulong[] data, 
-			ulong[] existing)
-		{
-			if (data == null)
-			{
-				return null;
-			}
-			if ((existing == null) || (existing.Length != data.Length))
-			{
-				return Clone(data);
-			}
-			Array.Copy(data, 0, existing, 0, existing.Length);
-			return existing;
-		}
-
-		public static void Fill(
-			byte[]	buf,
-			byte	b)
-		{
-			int i = buf.Length;
-			while (i > 0)
-			{
-				buf[--i] = b;
-			}
-		}
+            object[] a)
+        {
+            StringBuilder sb = new StringBuilder('[');
+            if (a.Length > 0)
+            {
+                sb.Append(a[0]);
+                for (int index = 1; index < a.Length; ++index)
+                {
+                    sb.Append(", ").Append(a[index]);
+                }
+            }
+            sb.Append(']');
+            return sb.ToString();
+        }
+
+        public static int GetHashCode(byte[] data)
+        {
+            if (data == null)
+            {
+                return 0;
+            }
+
+            int i = data.Length;
+            int hc = i + 1;
+
+            while (--i >= 0)
+            {
+                hc *= 257;
+                hc ^= data[i];
+            }
+
+            return hc;
+        }
+
+        public static int GetHashCode(int[] data)
+        {
+            if (data == null)
+            {
+                return 0;
+            }
+
+            int i = data.Length;
+            int hc = i + 1;
+
+            while (--i >= 0)
+            {
+                hc *= 257;
+                hc ^= data[i];
+            }
+
+            return hc;
+        }
+
+        public static byte[] Clone(
+            byte[] data)
+        {
+            return data == null ? null : (byte[]) data.Clone();
+        }
+
+        public static int[] Clone(
+            int[] data)
+        {
+            return data == null ? null : (int[]) data.Clone();
+        }
+
+        public static void Fill(
+            byte[]	buf,
+            byte	b)
+        {
+            int i = buf.Length;
+            while (i > 0)
+            {
+                buf[--i] = b;
+            }
+        }
+
+        [CLSCompliantAttribute(false)]
+        public static ulong[] Clone(
+            ulong[] data)
+        {
+            return data == null ? null : (ulong[]) data.Clone();
+        }
+
+        [CLSCompliantAttribute(false)]
+        public static ulong[] Clone(
+            ulong[] data, 
+            ulong[] existing)
+        {
+            if (data == null)
+            {
+                return null;
+            }
+            if ((existing == null) || (existing.Length != data.Length))
+            {
+                return Clone(data);
+            }
+            Array.Copy(data, 0, existing, 0, existing.Length);
+            return existing;
+        }
 
         public static byte[] Copy(byte[] data, int off, int len)
         {
@@ -269,5 +266,5 @@ namespace Org.BouncyCastle.Utilities
             Array.Copy(data, off, result, 0, len);
             return result;
         }
-	}
+    }
 }
diff --git a/crypto/src/util/BigIntegers.cs b/crypto/src/util/BigIntegers.cs
index 9e15d2559..f2d0425cc 100644
--- a/crypto/src/util/BigIntegers.cs
+++ b/crypto/src/util/BigIntegers.cs
@@ -8,14 +8,10 @@ namespace Org.BouncyCastle.Utilities
     /**
      * BigInteger utilities.
      */
-    public sealed class BigIntegers
+    public abstract class BigIntegers
     {
         private const int MaxIterations = 1000;
 
-        private BigIntegers()
-        {
-        }
-
         /**
         * Return the passed in value as an unsigned byte array.
         *
diff --git a/crypto/src/util/Enums.cs b/crypto/src/util/Enums.cs
index eaf49e1b3..8bd9c4053 100644
--- a/crypto/src/util/Enums.cs
+++ b/crypto/src/util/Enums.cs
@@ -10,12 +10,8 @@ using Org.BouncyCastle.Utilities.Date;
 
 namespace Org.BouncyCastle.Utilities
 {
-    internal sealed class Enums
+    internal abstract class Enums
     {
-        private Enums()
-        {
-        }
-
         internal static Enum GetEnumValue(System.Type enumType, string s)
         {
             if (!enumType.IsEnum)
diff --git a/crypto/src/util/Integers.cs b/crypto/src/util/Integers.cs
new file mode 100644
index 000000000..ccbf872c4
--- /dev/null
+++ b/crypto/src/util/Integers.cs
@@ -0,0 +1,17 @@
+using System;
+
+namespace Org.BouncyCastle.Utilities
+{
+    public abstract class Integers
+    {
+        public static int RotateLeft(int i, int distance)
+        {
+            return (i << distance) ^ (int)((uint)i >> -distance);
+        }
+
+        public static int RotateRight(int i, int distance)
+        {
+            return (int)((uint)i >> distance) ^ (i << -distance);
+        }
+    }
+}
diff --git a/crypto/src/util/Platform.cs b/crypto/src/util/Platform.cs
index cdfba789e..99d3982ea 100644
--- a/crypto/src/util/Platform.cs
+++ b/crypto/src/util/Platform.cs
@@ -11,22 +11,18 @@ using System.Collections;
 
 namespace Org.BouncyCastle.Utilities
 {
-	internal sealed class Platform
-	{
-		private Platform()
-		{
-		}
-
+    internal abstract class Platform
+    {
 #if NETCF_1_0 || NETCF_2_0
-		private static string GetNewLine()
-		{
-			MemoryStream buf = new MemoryStream();
-			StreamWriter w = new StreamWriter(buf, Encoding.UTF8);
-			w.WriteLine();
-			w.Close();
-			byte[] bs = buf.ToArray();
+        private static string GetNewLine()
+        {
+            MemoryStream buf = new MemoryStream();
+            StreamWriter w = new StreamWriter(buf, Encoding.UTF8);
+            w.WriteLine();
+            w.Close();
+            byte[] bs = buf.ToArray();
             return Encoding.UTF8.GetString(bs, 0, bs.Length);
-		}
+        }
 #else
         private static string GetNewLine()
         {
@@ -44,47 +40,47 @@ namespace Org.BouncyCastle.Utilities
         }
 
 #if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT
-		internal static string GetEnvironmentVariable(
-			string variable)
-		{
-			return null;
-		}
+        internal static string GetEnvironmentVariable(
+            string variable)
+        {
+            return null;
+        }
 #else
-		internal static string GetEnvironmentVariable(
-			string variable)
-		{
-			try
-			{
-				return Environment.GetEnvironmentVariable(variable);
-			}
-			catch (System.Security.SecurityException)
-			{
-				// We don't have the required permission to read this environment variable,
-				// which is fine, just act as if it's not set
-				return null;
-			}
-		}
+        internal static string GetEnvironmentVariable(
+            string variable)
+        {
+            try
+            {
+                return Environment.GetEnvironmentVariable(variable);
+            }
+            catch (System.Security.SecurityException)
+            {
+                // We don't have the required permission to read this environment variable,
+                // which is fine, just act as if it's not set
+                return null;
+            }
+        }
 #endif
 
 #if NETCF_1_0
-		internal static Exception CreateNotImplementedException(
-			string message)
-		{
-			return new Exception("Not implemented: " + message);
-		}
+        internal static Exception CreateNotImplementedException(
+            string message)
+        {
+            return new Exception("Not implemented: " + message);
+        }
 
-		internal static bool Equals(
-			object	a,
-			object	b)
-		{
-			return a == b || (a != null && b != null && a.Equals(b));
-		}
+        internal static bool Equals(
+            object	a,
+            object	b)
+        {
+            return a == b || (a != null && b != null && a.Equals(b));
+        }
 #else
-		internal static Exception CreateNotImplementedException(
-			string message)
-		{
-			return new NotImplementedException(message);
-		}
+        internal static Exception CreateNotImplementedException(
+            string message)
+        {
+            return new NotImplementedException(message);
+        }
 #endif
 
 #if SILVERLIGHT
@@ -178,5 +174,5 @@ namespace Org.BouncyCastle.Utilities
         }
 
         internal static readonly string NewLine = GetNewLine();
-	}
+    }
 }
diff --git a/crypto/src/util/Strings.cs b/crypto/src/util/Strings.cs
index 96032bdc5..a6080f427 100644
--- a/crypto/src/util/Strings.cs
+++ b/crypto/src/util/Strings.cs
@@ -3,33 +3,29 @@ using System.Text;
 
 namespace Org.BouncyCastle.Utilities
 {
-	/// <summary> General string utilities.</summary>
-	public sealed class Strings
-	{
-		private Strings()
-		{
-		}
-
-		internal static bool IsOneOf(string s, params string[] candidates)
-		{
-			foreach (string candidate in candidates)
-			{
-				if (s == candidate)
-					return true;
-			}
-			return false;
-		}
+    /// <summary> General string utilities.</summary>
+    public abstract class Strings
+    {
+        internal static bool IsOneOf(string s, params string[] candidates)
+        {
+            foreach (string candidate in candidates)
+            {
+                if (s == candidate)
+                    return true;
+            }
+            return false;
+        }
 
-		public static string FromByteArray(
-			byte[] bs)
-		{
-			char[] cs = new char[bs.Length];
-			for (int i = 0; i < cs.Length; ++i)
-			{
-				cs[i] = Convert.ToChar(bs[i]);
-			}
-			return new string(cs);
-		}
+        public static string FromByteArray(
+            byte[] bs)
+        {
+            char[] cs = new char[bs.Length];
+            for (int i = 0; i < cs.Length; ++i)
+            {
+                cs[i] = Convert.ToChar(bs[i]);
+            }
+            return new string(cs);
+        }
 
         public static byte[] ToByteArray(
             char[] cs)
@@ -43,15 +39,15 @@ namespace Org.BouncyCastle.Utilities
         }
 
         public static byte[] ToByteArray(
-			string s)
-		{
-			byte[] bs = new byte[s.Length];
-			for (int i = 0; i < bs.Length; ++i)
-			{
-				bs[i] = Convert.ToByte(s[i]);
-			}
-			return bs;
-		}
+            string s)
+        {
+            byte[] bs = new byte[s.Length];
+            for (int i = 0; i < bs.Length; ++i)
+            {
+                bs[i] = Convert.ToByte(s[i]);
+            }
+            return bs;
+        }
 
         public static string FromAsciiByteArray(
             byte[] bytes)
@@ -87,10 +83,10 @@ namespace Org.BouncyCastle.Utilities
         }
 
         public static string FromUtf8ByteArray(
-			byte[] bytes)
-		{
-			return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
-		}
+            byte[] bytes)
+        {
+            return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
+        }
 
         public static byte[] ToUtf8ByteArray(
             char[] cs)
@@ -98,10 +94,10 @@ namespace Org.BouncyCastle.Utilities
             return Encoding.UTF8.GetBytes(cs);
         }
 
-		public static byte[] ToUtf8ByteArray(
-			string s)
-		{
-			return Encoding.UTF8.GetBytes(s);
-		}
-	}
+        public static byte[] ToUtf8ByteArray(
+            string s)
+        {
+            return Encoding.UTF8.GetBytes(s);
+        }
+    }
 }
diff --git a/crypto/src/util/collections/CollectionUtilities.cs b/crypto/src/util/collections/CollectionUtilities.cs
index fd0bdcc7a..18fcb6774 100644
--- a/crypto/src/util/collections/CollectionUtilities.cs
+++ b/crypto/src/util/collections/CollectionUtilities.cs
@@ -4,13 +4,9 @@ using System.Text;
 
 namespace Org.BouncyCastle.Utilities.Collections
 {
-	public sealed class CollectionUtilities
-	{
-		private CollectionUtilities()
-		{
-		}
-
-        public static void AddRange(IList to, ICollection range)
+    public abstract class CollectionUtilities
+    {
+        public static void AddRange(IList to, IEnumerable range)
         {
             foreach (object o in range)
             {
@@ -18,17 +14,15 @@ namespace Org.BouncyCastle.Utilities.Collections
             }
         }
 
-        public static bool CheckElementsAreOfType(
-			IEnumerable e,
-			Type		t)
-		{
-			foreach (object o in e)
-			{
-				if (!t.IsInstanceOfType(o))
-					return false;
-			}
-			return true;
-		}
+        public static bool CheckElementsAreOfType(IEnumerable e, Type t)
+        {
+            foreach (object o in e)
+            {
+                if (!t.IsInstanceOfType(o))
+                    return false;
+            }
+            return true;
+        }
 
         public static IDictionary ReadOnly(IDictionary d)
         {
@@ -45,27 +39,26 @@ namespace Org.BouncyCastle.Utilities.Collections
             return new UnmodifiableSetProxy(s);
         }
 
-        public static string ToString(
-			IEnumerable c)
-		{
-			StringBuilder sb = new StringBuilder("[");
+        public static string ToString(IEnumerable c)
+        {
+            StringBuilder sb = new StringBuilder("[");
 
-			IEnumerator e = c.GetEnumerator();
+            IEnumerator e = c.GetEnumerator();
 
-			if (e.MoveNext())
-			{
-				sb.Append(e.Current.ToString());
+            if (e.MoveNext())
+            {
+                sb.Append(e.Current.ToString());
 
-				while (e.MoveNext())
-				{
-					sb.Append(", ");
-					sb.Append(e.Current.ToString());
-				}
-			}
+                while (e.MoveNext())
+                {
+                    sb.Append(", ");
+                    sb.Append(e.Current.ToString());
+                }
+            }
 
-			sb.Append(']');
+            sb.Append(']');
 
-			return sb.ToString();
-		}
-	}
+            return sb.ToString();
+        }
+    }
 }
diff --git a/crypto/test/src/asn1/test/EnumeratedTest.cs b/crypto/test/src/asn1/test/EnumeratedTest.cs
new file mode 100644
index 000000000..29e90326b
--- /dev/null
+++ b/crypto/test/src/asn1/test/EnumeratedTest.cs
@@ -0,0 +1,115 @@
+using System;
+
+using NUnit.Framework;
+
+using Org.BouncyCastle.Asn1;
+using Org.BouncyCastle.Utilities.Encoders;
+
+namespace Org.BouncyCastle.Asn1.Tests
+{
+    /// <summary>
+    /// Tests used to verify correct decoding of the ENUMERATED type.
+    /// </summary>
+    [TestFixture]
+    public class EnumeratedTest
+    {
+        /// <summary>
+        /// Test vector used to test decoding of multiple items.
+        /// </summary>
+        /// <remarks>This sample uses an ENUMERATED and a BOOLEAN.</remarks>
+        private static readonly byte[] MultipleSingleByteItems = Hex.Decode("30060a01010101ff");
+
+        /// <summary>
+        /// Test vector used to test decoding of multiple items.
+        /// </summary>
+        /// <remarks>This sample uses two ENUMERATEDs.</remarks>
+        private static readonly byte[] MultipleDoubleByteItems = Hex.Decode("30080a0201010a020202");
+
+        /// <summary>
+        /// Test vector used to test decoding of multiple items.
+        /// </summary>
+        /// <remarks>This sample uses an ENUMERATED and an OBJECT IDENTIFIER.</remarks>
+        private static readonly byte[] MultipleTripleByteItems = Hex.Decode("300a0a0301010106032b0601");
+
+        /// <summary>
+        /// Makes sure multiple identically sized values are parsed correctly.
+        /// </summary>
+        [Test]
+        public void TestReadingMultipleSingleByteItems()
+        {
+            Asn1Object obj = Asn1Object.FromByteArray(MultipleSingleByteItems);
+
+            Assert.IsTrue(obj is DerSequence, "Null ASN.1 SEQUENCE");
+
+            DerSequence sequence = (DerSequence)obj;
+
+            Assert.AreEqual(2, sequence.Count, "2 items expected");
+
+            DerEnumerated enumerated = sequence[0] as DerEnumerated;
+
+            Assert.IsNotNull(enumerated, "ENUMERATED expected");
+
+            Assert.AreEqual(1, enumerated.Value.IntValue, "Unexpected ENUMERATED value");
+
+            DerBoolean boolean = sequence[1] as DerBoolean;
+
+            Assert.IsNotNull(boolean, "BOOLEAN expected");
+
+            Assert.IsTrue(boolean.IsTrue, "Unexpected BOOLEAN value");
+        }
+
+        /// <summary>
+        /// Makes sure multiple identically sized values are parsed correctly.
+        /// </summary>
+        [Test]
+        public void TestReadingMultipleDoubleByteItems()
+        {
+            Asn1Object obj = Asn1Object.FromByteArray(MultipleDoubleByteItems);
+
+            Assert.IsTrue(obj is DerSequence, "Null ASN.1 SEQUENCE");
+
+            DerSequence sequence = (DerSequence)obj;
+
+            Assert.AreEqual(2, sequence.Count, "2 items expected");
+
+            DerEnumerated enumerated1 = sequence[0] as DerEnumerated;
+
+            Assert.IsNotNull(enumerated1, "ENUMERATED expected");
+
+            Assert.AreEqual(257, enumerated1.Value.IntValue, "Unexpected ENUMERATED value");
+
+            DerEnumerated enumerated2 = sequence[1] as DerEnumerated;
+
+            Assert.IsNotNull(enumerated2, "ENUMERATED expected");
+
+            Assert.AreEqual(514, enumerated2.Value.IntValue, "Unexpected ENUMERATED value");
+        }
+
+        /// <summary>
+        /// Makes sure multiple identically sized values are parsed correctly.
+        /// </summary>
+        [Test]
+        public void TestReadingMultipleTripleByteItems()
+        {
+            Asn1Object obj = Asn1Object.FromByteArray(MultipleTripleByteItems);
+
+            Assert.IsTrue(obj is DerSequence, "Null ASN.1 SEQUENCE");
+
+            DerSequence sequence = (DerSequence)obj;
+
+            Assert.AreEqual(2, sequence.Count, "2 items expected");
+
+            DerEnumerated enumerated = sequence[0] as DerEnumerated;
+
+            Assert.IsNotNull(enumerated, "ENUMERATED expected");
+
+            Assert.AreEqual(65793, enumerated.Value.IntValue, "Unexpected ENUMERATED value");
+
+            DerObjectIdentifier objectId = sequence[1] as DerObjectIdentifier;
+
+            Assert.IsNotNull(objectId, "OBJECT IDENTIFIER expected");
+
+            Assert.AreEqual("1.3.6.1", objectId.Id, "Unexpected OBJECT IDENTIFIER value");
+        }
+    }
+}
diff --git a/crypto/test/src/asn1/test/MiscTest.cs b/crypto/test/src/asn1/test/MiscTest.cs
index 44213c71d..42f5dbd01 100644
--- a/crypto/test/src/asn1/test/MiscTest.cs
+++ b/crypto/test/src/asn1/test/MiscTest.cs
@@ -10,91 +10,85 @@ using Org.BouncyCastle.Utilities.Test;
 
 namespace Org.BouncyCastle.Asn1.Tests
 {
-	[TestFixture]
-	public class MiscTest
-		: ITest
-	{
-		public ITestResult Perform()
-		{
-			byte[] testIv = { 1, 2, 3, 4, 5, 6, 7, 8 };
-
-			Asn1Encodable[] values =
-			{
-				new Cast5CbcParameters(testIv, 128),
-				new NetscapeCertType(NetscapeCertType.Smime),
-				new VerisignCzagExtension(new DerIA5String("hello")),
-#if INCLUDE_IDEA
-				new IdeaCbcPar(testIv),
-#endif
-				new NetscapeRevocationUrl(new DerIA5String("http://test"))
-			};
-
-#if INCLUDE_IDEA
-			byte[] data = Base64.Decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvMAoECAECAwQFBgcIFgtodHRwOi8vdGVzdA==");
-#else
-			byte[] data = Base64.Decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvFgtodHRwOi8vdGVzdA==");
-#endif
-
-			try
-			{
-				MemoryStream bOut = new MemoryStream();
-				Asn1OutputStream aOut = new Asn1OutputStream(bOut);
-
-				for (int i = 0; i != values.Length; i++)
-				{
-					aOut.WriteObject(values[i]);
-				}
-
-				if (!Arrays.AreEqual(bOut.ToArray(), data))
-				{
-					return new SimpleTestResult(false, Name + ": Failed data check");
-				}
-
-				Asn1InputStream aIn = new Asn1InputStream(bOut.ToArray());
-
-				for (int i = 0; i != values.Length; i++)
-				{
-					Asn1Object o = aIn.ReadObject();
-
-					if (!values[i].Equals(o))
-					{
-						return new SimpleTestResult(false, Name + ": Failed equality test for " + o);
-					}
-
-					if (o.GetHashCode() != values[i].GetHashCode())
-					{
-						return new SimpleTestResult(false, Name + ": Failed hashCode test for " + o);
-					}
-				}
-
-				return new SimpleTestResult(true, Name + ": Okay");
-			}
-			catch (Exception e)
-			{
-				return new SimpleTestResult(false, Name + ": Failed - exception " + e.ToString(), e);
-			}
-		}
-
-		public string Name
-		{
-			get { return "Misc"; }
-		}
-
-		public static void Main(
-			string[] args)
-		{
-			ITest test = new MiscTest();
-			ITestResult result = test.Perform();
-
-			Console.WriteLine(result);
-		}
-
-		[Test]
-		public void TestFunction()
-		{
-			string resultText = Perform().ToString();
-
-			Assert.AreEqual(Name + ": Okay", resultText);
-		}
-	}
+    [TestFixture]
+    public class MiscTest
+        : ITest
+    {
+        public ITestResult Perform()
+        {
+            byte[] testIv = { 1, 2, 3, 4, 5, 6, 7, 8 };
+
+            Asn1Encodable[] values =
+            {
+                new Cast5CbcParameters(testIv, 128),
+                new NetscapeCertType(NetscapeCertType.Smime),
+                new VerisignCzagExtension(new DerIA5String("hello")),
+                new IdeaCbcPar(testIv),
+                new NetscapeRevocationUrl(new DerIA5String("http://test"))
+            };
+
+            byte[] data = Base64.Decode("MA4ECAECAwQFBgcIAgIAgAMCBSAWBWhlbGxvMAoECAECAwQFBgcIFgtodHRwOi8vdGVzdA==");
+
+            try
+            {
+                MemoryStream bOut = new MemoryStream();
+                Asn1OutputStream aOut = new Asn1OutputStream(bOut);
+
+                for (int i = 0; i != values.Length; i++)
+                {
+                    aOut.WriteObject(values[i]);
+                }
+
+                if (!Arrays.AreEqual(bOut.ToArray(), data))
+                {
+                    return new SimpleTestResult(false, Name + ": Failed data check");
+                }
+
+                Asn1InputStream aIn = new Asn1InputStream(bOut.ToArray());
+
+                for (int i = 0; i != values.Length; i++)
+                {
+                    Asn1Object o = aIn.ReadObject();
+
+                    if (!values[i].Equals(o))
+                    {
+                        return new SimpleTestResult(false, Name + ": Failed equality test for " + o);
+                    }
+
+                    if (o.GetHashCode() != values[i].GetHashCode())
+                    {
+                        return new SimpleTestResult(false, Name + ": Failed hashCode test for " + o);
+                    }
+                }
+
+                return new SimpleTestResult(true, Name + ": Okay");
+            }
+            catch (Exception e)
+            {
+                return new SimpleTestResult(false, Name + ": Failed - exception " + e.ToString(), e);
+            }
+        }
+
+        public string Name
+        {
+            get { return "Misc"; }
+        }
+
+        public static void Main(
+            string[] args)
+        {
+            ITest test = new MiscTest();
+            ITestResult result = test.Perform();
+
+            Console.WriteLine(result);
+        }
+
+        [Test]
+        public void TestFunction()
+        {
+            string resultText = Perform().ToString();
+
+            Assert.AreEqual(Name + ": Okay", resultText);
+        }
+    }
 }
diff --git a/crypto/test/src/cms/test/SignedDataStreamTest.cs b/crypto/test/src/cms/test/SignedDataStreamTest.cs
index 29b0db8f4..96f3f125d 100644
--- a/crypto/test/src/cms/test/SignedDataStreamTest.cs
+++ b/crypto/test/src/cms/test/SignedDataStreamTest.cs
@@ -1211,5 +1211,25 @@ namespace Org.BouncyCastle.Cms.Tests
 			Assert.AreEqual(SignCert, a[0]);
 			Assert.AreEqual(OrigCert, a[1]);
 		}
+
+        [Test]
+        public void TestCertsOnly()
+        {
+            IList certList = new ArrayList();
+            certList.Add(OrigCert);
+            certList.Add(SignCert);
+
+            IX509Store x509Certs = X509StoreFactory.Create(
+                "Certificate/Collection",
+                new X509CollectionStoreParameters(certList));
+
+            MemoryStream bOut = new MemoryStream();
+
+            CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator();
+            gen.AddCertificates(x509Certs);
+            gen.Open(bOut).Close();
+
+            CheckSigParseable(bOut.ToArray());
+        }
 	}
 }
diff --git a/crypto/test/src/crypto/test/ChaChaTest.cs b/crypto/test/src/crypto/test/ChaChaTest.cs
new file mode 100644
index 000000000..0b394c91e
--- /dev/null
+++ b/crypto/test/src/crypto/test/ChaChaTest.cs
@@ -0,0 +1,319 @@
+using System;
+
+using NUnit.Framework;
+
+using Org.BouncyCastle.Crypto.Engines;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Utilities.Encoders;
+using Org.BouncyCastle.Utilities.Test;
+
+namespace Org.BouncyCastle.Crypto.Tests
+{
+    /**
+     * ChaCha Test
+     * <p>
+     * Test cases generated using ref version of ChaCha20 in estreambench-20080905.
+     * </p>
+     */
+    [TestFixture]
+    public class ChaChaTest
+        : SimpleTest
+    {
+        private static readonly byte[] zeroes = Hex.Decode(
+            "00000000000000000000000000000000"
+            + "00000000000000000000000000000000"
+            + "00000000000000000000000000000000"
+            + "00000000000000000000000000000000");
+
+        private static readonly string set1v0_0 =
+            "FBB87FBB8395E05DAA3B1D683C422046"
+            + "F913985C2AD9B23CFC06C1D8D04FF213"
+            + "D44A7A7CDB84929F915420A8A3DC58BF"
+            + "0F7ECB4B1F167BB1A5E6153FDAF4493D";
+
+        private static readonly string set1v0_192 =
+            "D9485D55B8B82D792ED1EEA8E93E9BC1"
+            + "E2834AD0D9B11F3477F6E106A2F6A5F2"
+            + "EA8244D5B925B8050EAB038F58D4DF57"
+            + "7FAFD1B89359DAE508B2B10CBD6B488E";
+
+        private static readonly string set1v0_256 =
+            "08661A35D6F02D3D9ACA8087F421F7C8"
+            + "A42579047D6955D937925BA21396DDD4"
+            + "74B1FC4ACCDCAA33025B4BCE817A4FBF"
+            + "3E5D07D151D7E6FE04934ED466BA4779";
+
+        private static readonly string set1v0_448 =
+            "A7E16DD38BA48CCB130E5BE9740CE359"
+            + "D631E91600F85C8A5D0785A612D1D987"
+            + "90780ACDDC26B69AB106CCF6D866411D"
+            + "10637483DBF08CC5591FD8B3C87A3AE0";
+
+        private static readonly string set1v9_0 =
+            "A276339F99316A913885A0A4BE870F06"
+            + "91E72B00F1B3F2239F714FE81E88E00C"
+            + "BBE52B4EBBE1EA15894E29658C4CB145"
+            + "E6F89EE4ABB045A78514482CE75AFB7C";
+
+        private static readonly string set1v9_192 =
+            "0DFB9BD4F87F68DE54FBC1C6428FDEB0"
+            + "63E997BE8490C9B7A4694025D6EBA2B1"
+            + "5FE429DB82A7CAE6AAB22918E8D00449"
+            + "6FB6291467B5AE81D4E85E81D8795EBB";
+
+        private static readonly string set1v9_256 =
+            "546F5BB315E7F71A46E56D4580F90889"
+            + "639A2BA528F757CF3B048738BA141AF3"
+            + "B31607CB21561BAD94721048930364F4"
+            + "B1227CFEB7CDECBA881FB44903550E68";
+
+        private static readonly string set1v9_448 =
+            "6F813586E76691305A0CF048C0D8586D"
+            + "C89460207D8B230CD172398AA33D19E9"
+            + "2D24883C3A9B0BB7CD8C6B2668DB142E"
+            + "37A97948A7A01498A21110297984CD20";
+
+        private static readonly string set6v0_0 =
+            "57459975BC46799394788DE80B928387"
+            + "862985A269B9E8E77801DE9D874B3F51"
+            + "AC4610B9F9BEE8CF8CACD8B5AD0BF17D"
+            + "3DDF23FD7424887EB3F81405BD498CC3";
+
+        private static readonly string set6v0_65472 =
+            "EF9AEC58ACE7DB427DF012B2B91A0C1E"
+            + "8E4759DCE9CDB00A2BD59207357BA06C"
+            + "E02D327C7719E83D6348A6104B081DB0"
+            + "3908E5186986AE41E3AE95298BB7B713";
+
+        private static readonly string set6v0_65536 =
+            "17EF5FF454D85ABBBA280F3A94F1D26E"
+            + "950C7D5B05C4BB3A78326E0DC5731F83"
+            + "84205C32DB867D1B476CE121A0D7074B"
+            + "AA7EE90525D15300F48EC0A6624BD0AF";
+
+        private static readonly string set6v1_0 =
+            "92A2508E2C4084567195F2A1005E552B"
+            + "4874EC0504A9CD5E4DAF739AB553D2E7"
+            + "83D79C5BA11E0653BEBB5C116651302E"
+            + "8D381CB728CA627B0B246E83942A2B99";
+
+        private static readonly string set6v1_65472 =
+            "E1974EC3063F7BD0CBA58B1CE34BC874"
+            + "67AAF5759B05EA46682A5D4306E5A76B"
+            + "D99A448DB8DE73AF97A73F5FBAE2C776"
+            + "35040464524CF14D7F08D4CE1220FD84";
+
+        private static readonly string set6v1_65536 =
+            "BE3436141CFD62D12FF7D852F80C1344"
+            + "81F152AD0235ECF8CA172C55CA8C031B"
+            + "2E785D773A988CA8D4BDA6FAE0E493AA"
+            + "71DCCC4C894D1F106CAC62A9FC0A9607";
+
+        // ChaCha12
+        private static readonly string chacha12_set1v0_0 =
+            "36CF0D56E9F7FBF287BC5460D95FBA94"
+            + "AA6CBF17D74E7C784DDCF7E0E882DDAE"
+            + "3B5A58243EF32B79A04575A8E2C2B73D"
+            + "C64A52AA15B9F88305A8F0CA0B5A1A25";
+
+        private static readonly string chacha12_set1v0_192 =
+            "83496792AB68FEC75ADB16D3044420A4"
+            + "A00A6E9ADC41C3A63DBBF317A8258C85"
+            + "A9BC08B4F76B413A4837324AEDF8BC2A"
+            + "67D53C9AB9E1C5BC5F379D48DF9AF730";
+
+        private static readonly string chacha12_set1v0_256 = 
+            "BAA28ED593690FD760ADA07C95E3B888"
+            + "4B4B64E488CA7A2D9BDC262243AB9251"
+            + "394C5037E255F8BCCDCD31306C508FFB"
+            + "C9E0161380F7911FCB137D46D9269250";
+
+        private static readonly string chacha12_set1v0_448 =
+            "B7ECFB6AE0B51915762FE1FD03A14D0C"
+            + "9E54DA5DC76EB16EBA5313BC535DE63D"
+            + "C72D7F9F1874E301E99C8531819F4E37"
+            + "75793F6A5D19C717FA5C78A39EB804A6";
+
+        // ChaCha8
+        private static readonly string chacha8_set1v0_0 =
+            "BEB1E81E0F747E43EE51922B3E87FB38"
+            + "D0163907B4ED49336032AB78B67C2457"
+            + "9FE28F751BD3703E51D876C017FAA435"
+            + "89E63593E03355A7D57B2366F30047C5";
+
+        private static readonly string chacha8_set1v0_192 =
+            "33B8B7CA8F8E89F0095ACE75A379C651"
+            + "FD6BDD55703C90672E44C6BAB6AACDD8"
+            + "7C976A87FD264B906E749429284134C2"
+            + "38E3B88CF74A68245B860D119A8BDF43";
+
+        private static readonly string chacha8_set1v0_256 =
+            "F7CA95BF08688BD3BE8A27724210F9DC"
+            + "16F32AF974FBFB09E9F757C577A245AB"
+            + "F35F824B70A4C02CB4A8D7191FA8A5AD"
+            + "6A84568743844703D353B7F00A8601F4";
+
+        private static readonly string chacha8_set1v0_448 =
+            "7B4117E8BFFD595CD8482270B08920FB"
+            + "C9B97794E1809E07BB271BF07C861003"
+            + "4C38DBA6ECA04E5474F399A284CBF6E2"
+            + "7F70142E604D0977797DE5B58B6B25E0";
+
+        public override string Name
+        {
+            get { return "ChaCha"; }
+        }
+
+        public override void PerformTest()
+        {
+            chachaTest1(20, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+                    set1v0_0, set1v0_192,  set1v0_256,  set1v0_448);
+            chachaTest1(20, new ParametersWithIV(new KeyParameter(Hex.Decode("00400000000000000000000000000000")), Hex.Decode("0000000000000000")),
+                    set1v9_0, set1v9_192,  set1v9_256,  set1v9_448);
+            chachaTest1(12, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+                    chacha12_set1v0_0, chacha12_set1v0_192,  chacha12_set1v0_256,  chacha12_set1v0_448);
+            chachaTest1(8, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+                    chacha8_set1v0_0, chacha8_set1v0_192,  chacha8_set1v0_256,  chacha8_set1v0_448);
+            chachaTest2(new ParametersWithIV(new KeyParameter(Hex.Decode("0053A6F94C9FF24598EB3E91E4378ADD3083D6297CCF2275C81B6EC11467BA0D")), Hex.Decode("0D74DB42A91077DE")),
+                    set6v0_0, set6v0_65472, set6v0_65536);
+            chachaTest2(new ParametersWithIV(new KeyParameter(Hex.Decode("0558ABFE51A4F74A9DF04396E93C8FE23588DB2E81D4277ACD2073C6196CBF12")), Hex.Decode("167DE44BB21980E7")),
+                    set6v1_0, set6v1_65472, set6v1_65536);
+            reinitBug();
+        }
+
+        private void chachaTest1(
+            int rounds,
+            ICipherParameters	parameters,
+            string				v0,
+            string				v192,
+            string				v256,
+            string				v448)
+        {
+            IStreamCipher salsa = new ChaChaEngine(rounds);
+            byte[]       buf = new byte[64];
+
+            salsa.Init(true, parameters);
+
+            for (int i = 0; i != 7; i++)
+            {
+                salsa.ProcessBytes(zeroes, 0, 64, buf, 0);
+                switch (i)
+                {
+                case 0:
+                    if (!AreEqual(buf, Hex.Decode(v0)))
+                    {
+                        mismatch("v0/" + rounds, v0, buf);
+                    }
+                    break;
+                case 3:
+                    if (!AreEqual(buf, Hex.Decode(v192)))
+                    {
+                        mismatch("v192/" + rounds, v192, buf);
+                    }
+                    break;
+                case 4:
+                    if (!AreEqual(buf, Hex.Decode(v256)))
+                    {
+                        mismatch("v256/" + rounds, v256, buf);
+                    }
+                    break;
+                default:
+                    // ignore
+                    break;
+                }
+            }
+
+            for (int i = 0; i != 64; i++)
+            {
+                buf[i] = salsa.ReturnByte(zeroes[i]);
+            }
+
+            if (!AreEqual(buf, Hex.Decode(v448)))
+            {
+                mismatch("v448", v448, buf);
+            }       
+        }
+
+        private void chachaTest2(
+            ICipherParameters	parameters,
+            string				v0,
+            string				v65472,
+            string				v65536)
+        {
+            IStreamCipher salsa = new ChaChaEngine();
+            byte[]       buf = new byte[64];
+
+            salsa.Init(true, parameters);
+
+            for (int i = 0; i != 1025; i++)
+            {
+                salsa.ProcessBytes(zeroes, 0, 64, buf, 0);
+                switch (i)
+                {
+                case 0:
+                    if (!AreEqual(buf, Hex.Decode(v0)))
+                    {
+                        mismatch("v0", v0, buf);
+                    }
+                    break;
+                case 1023:
+                    if (!AreEqual(buf, Hex.Decode(v65472)))
+                    {
+                        mismatch("v65472", v65472, buf);
+                    }
+                    break;
+                case 1024:
+                    if (!AreEqual(buf, Hex.Decode(v65536)))
+                    {
+                        mismatch("v65536", v65536, buf);
+                    }
+                    break;
+                default:
+                    // ignore
+                    break;
+                }
+            }
+        }
+
+        private void mismatch(
+            string	name,
+            string	expected,
+            byte[]	found)
+        {
+            Fail("mismatch on " + name, expected, Hex.ToHexString(found));
+        }
+
+        private void reinitBug()
+        {
+            KeyParameter key = new KeyParameter(Hex.Decode("80000000000000000000000000000000"));
+            ParametersWithIV parameters = new ParametersWithIV(key, Hex.Decode("0000000000000000"));
+
+            IStreamCipher chacha = new ChaChaEngine();
+
+            chacha.Init(true, parameters);
+
+            try
+            {
+                chacha.Init(true, key);
+                Fail("ChaCha should throw exception if no IV in Init");
+            }
+            catch (ArgumentException)
+            {
+            }
+        }
+
+        public static void Main(
+            string[] args)
+        {
+            RunTest(new ChaChaTest());
+        }
+
+        [Test]
+        public void TestFunction()
+        {
+            string resultText = Perform().ToString();
+
+            Assert.AreEqual(Name + ": Okay", resultText);
+        }
+    }
+}
diff --git a/crypto/test/src/crypto/test/GMacTest.cs b/crypto/test/src/crypto/test/GMacTest.cs
new file mode 100644
index 000000000..0f0e84e2a
--- /dev/null
+++ b/crypto/test/src/crypto/test/GMacTest.cs
@@ -0,0 +1,184 @@
+using System;
+
+using NUnit.Framework;
+
+using Org.BouncyCastle.Crypto.Engines;
+using Org.BouncyCastle.Crypto.Macs;
+using Org.BouncyCastle.Crypto.Modes;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Utilities.Encoders;
+using Org.BouncyCastle.Utilities.Test;
+
+namespace Org.BouncyCastle.Crypto.Tests
+{
+	/**
+	 * Test vectors for AES-GMAC, extracted from <a
+	 * href="http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip">NIST CAVP GCM test
+	 * vectors</a>.
+	 * 
+	 */
+	[TestFixture]
+	public class GMacTest 
+		: SimpleTest
+	{
+		private class TestCase
+		{
+			private byte[] key;
+			private byte[] iv;
+			private byte[] ad;
+			private byte[] tag;
+			private string name;
+
+			internal TestCase(string name, string key, string iv, string ad, string tag)
+			{
+				this.name = name;
+				this.key = Hex.Decode(key);
+				this.iv = Hex.Decode(iv);
+				this.ad = Hex.Decode(ad);
+				this.tag = Hex.Decode(tag);
+			}
+
+			public string getName()
+			{
+				return name;
+			}
+
+			public byte[] getKey()
+			{
+				return key;
+			}
+
+			public byte[] getIv()
+			{
+				return iv;
+			}
+
+			public byte[] getAd()
+			{
+				return ad;
+			}
+
+			public byte[] getTag()
+			{
+				return tag;
+			}
+		}
+
+		private TestCase[] TEST_VECTORS = new TestCase[] {
+			// Count = 0, from each of the PTlen = 0 test vector sequences
+			new TestCase("128/96/0/128", "11754cd72aec309bf52f7687212e8957", "3c819d9a9bed087615030b65", "",
+			             "250327c674aaf477aef2675748cf6971"),
+			new TestCase("128/96/0/120", "272f16edb81a7abbea887357a58c1917", "794ec588176c703d3d2a7a07", "",
+			             "b6e6f197168f5049aeda32dafbdaeb"),
+			new TestCase("128/96/0/112", "81b6844aab6a568c4556a2eb7eae752f", "ce600f59618315a6829bef4d", "",
+			             "89b43e9dbc1b4f597dbbc7655bb5"),
+			new TestCase("128/96/0/104", "cde2f9a9b1a004165ef9dc981f18651b", "29512c29566c7322e1e33e8e", "",
+			             "2e58ce7dabd107c82759c66a75"),
+			new TestCase("128/96/0/96", "b01e45cc3088aaba9fa43d81d481823f", "5a2c4a66468713456a4bd5e1", "",
+			             "014280f944f53c681164b2ff"),
+
+			new TestCase("128/96/128/128", "77be63708971c4e240d1cb79e8d77feb", "e0e00f19fed7ba0136a797f3",
+			             "7a43ec1d9c0a5a78a0b16533a6213cab", "209fcc8d3675ed938e9c7166709dd946"),
+			new TestCase("128/96/128/96", "bea48ae4980d27f357611014d4486625", "32bddb5c3aa998a08556454c",
+			             "8a50b0b8c7654bced884f7f3afda2ead", "8e0f6d8bf05ffebe6f500eb1"),
+
+			new TestCase("128/96/384/128", "99e3e8793e686e571d8285c564f75e2b", "c2dd0ab868da6aa8ad9c0d23",
+			             "b668e42d4e444ca8b23cfdd95a9fedd5178aa521144890b093733cf5cf22526c5917ee476541809ac6867a8c399309fc",
+			             "3f4fba100eaf1f34b0baadaae9995d85"),
+			new TestCase("128/96/384/96", "c77acd1b0918e87053cb3e51651e7013", "39ff857a81745d10f718ac00",
+			             "407992f82ea23b56875d9a3cb843ceb83fd27cb954f7c5534d58539fe96fb534502a1b38ea4fac134db0a42de4be1137",
+			             "2a5dc173285375dc82835876"),
+
+			new TestCase(
+				"128/1024/0/128",
+				"d0f1f4defa1e8c08b4b26d576392027c",
+				"42b4f01eb9f5a1ea5b1eb73b0fb0baed54f387ecaa0393c7d7dffc6af50146ecc021abf7eb9038d4303d91f8d741a11743166c0860208bcc02c6258fd9511a2fa626f96d60b72fcff773af4e88e7a923506e4916ecbd814651e9f445adef4ad6a6b6c7290cc13b956130eef5b837c939fcac0cbbcc9656cd75b13823ee5acdac",
+				"", "7ab49b57ddf5f62c427950111c5c4f0d"),
+			new TestCase(
+				"128/1024/384/96",
+				"3cce72d37933394a8cac8a82deada8f0",
+				"aa2f0d676d705d9733c434e481972d4888129cf7ea55c66511b9c0d25a92a174b1e28aa072f27d4de82302828955aadcb817c4907361869bd657b45ff4a6f323871987fcf9413b0702d46667380cd493ed24331a28b9ce5bbfa82d3a6e7679fcce81254ba64abcad14fd18b22c560a9d2c1cd1d3c42dac44c683edf92aced894",
+				"5686b458e9c176f4de8428d9ebd8e12f569d1c7595cf49a4b0654ab194409f86c0dd3fdb8eb18033bb4338c70f0b97d1",
+				"a3a9444b21f330c3df64c8b6"), };
+
+		public override void PerformTest()
+		{
+			for (int i = 0; i < TEST_VECTORS.Length; i++)
+			{
+				TestCase testCase = TEST_VECTORS[i];
+
+				IMac mac = new GMac(new GcmBlockCipher(new AesFastEngine()), testCase.getTag().Length * 8);
+				ICipherParameters key = new KeyParameter(testCase.getKey());
+				mac.Init(new ParametersWithIV(key, testCase.getIv()));
+
+				testSingleByte(mac, testCase);
+				testMultibyte(mac, testCase);
+			}
+
+			// Invalid mac size
+			testInvalidMacSize(97);
+			testInvalidMacSize(136);
+			testInvalidMacSize(88);
+			testInvalidMacSize(64);
+		}
+
+		private void testInvalidMacSize(int size)
+		{
+			try
+			{
+				GMac mac = new GMac(new GcmBlockCipher(new AesFastEngine()), size);
+				mac.Init(new ParametersWithIV(null, new byte[16]));
+				Fail("Expected failure for illegal mac size " + size);
+			}
+			catch (ArgumentException)
+			{
+			}
+		}
+
+		private void testMultibyte(IMac mac, TestCase testCase)
+		{
+			mac.BlockUpdate(testCase.getAd(), 0, testCase.getAd().Length);
+			checkMac(mac, testCase);
+		}
+
+		private void testSingleByte(IMac mac, TestCase testCase)
+		{
+			byte[] ad = testCase.getAd();
+			for (int i = 0; i < ad.Length; i++)
+			{
+				mac.Update(ad[i]);
+			}
+			checkMac(mac, testCase);
+		}
+
+		private void checkMac(IMac mac, TestCase testCase)
+		{
+			byte[] generatedMac = new byte[mac.GetMacSize()];
+			mac.DoFinal(generatedMac, 0);
+			if (!AreEqual(testCase.getTag(), generatedMac))
+			{
+				Fail("Failed " + testCase.getName() + " - expected " + Hex.ToHexString(testCase.getTag()) + " got "
+				     + Hex.ToHexString(generatedMac));
+			}
+		}
+
+		public override string Name
+		{
+			get { return "GMac"; }
+		}
+
+		public static void Main(
+			string[] args)
+		{
+			RunTest(new GMacTest());
+		}
+
+		[Test]
+		public void TestFunction()
+		{
+			string resultText = Perform().ToString();
+
+			Assert.AreEqual(Name + ": Okay", resultText);
+		}
+	}
+}
diff --git a/crypto/test/src/crypto/test/IDEATest.cs b/crypto/test/src/crypto/test/IDEATest.cs
index 6ae822271..fbbd1ae17 100644
--- a/crypto/test/src/crypto/test/IDEATest.cs
+++ b/crypto/test/src/crypto/test/IDEATest.cs
@@ -1,5 +1,3 @@
-#if INCLUDE_IDEA
-
 using System;
 
 using NUnit.Framework;
@@ -13,31 +11,31 @@ namespace Org.BouncyCastle.Crypto.Tests
 {
     [TestFixture]
     public class IdeaTest
-		: CipherTest
+        : CipherTest
     {
         public override string Name
         {
-			get { return "IDEA"; }
+            get { return "IDEA"; }
         }
 
-		internal static SimpleTest[] tests = new SimpleTest[]
-		{
-			new BlockCipherVectorTest(0, new IdeaEngine(),
-				new KeyParameter(Hex.Decode("00112233445566778899AABBCCDDEEFF")),
-				"000102030405060708090a0b0c0d0e0f",
-				"ed732271a7b39f475b4b2b6719f194bf"),
-			new BlockCipherVectorTest(0, new IdeaEngine(),
-				new KeyParameter(Hex.Decode("00112233445566778899AABBCCDDEEFF")),
-				"f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff",
-				"b8bc6ed5c899265d2bcfad1fc6d4287d")
-		};
-
-		public IdeaTest()
-			: base(tests, new IdeaEngine(), new KeyParameter(new byte[32]))
+        internal static SimpleTest[] tests = new SimpleTest[]
+        {
+            new BlockCipherVectorTest(0, new IdeaEngine(),
+                new KeyParameter(Hex.Decode("00112233445566778899AABBCCDDEEFF")),
+                "000102030405060708090a0b0c0d0e0f",
+                "ed732271a7b39f475b4b2b6719f194bf"),
+            new BlockCipherVectorTest(0, new IdeaEngine(),
+                new KeyParameter(Hex.Decode("00112233445566778899AABBCCDDEEFF")),
+                "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff",
+                "b8bc6ed5c899265d2bcfad1fc6d4287d")
+        };
+
+        public IdeaTest()
+            : base(tests, new IdeaEngine(), new KeyParameter(new byte[32]))
         {
         }
 
-		public static void Main(
+        public static void Main(
             string[] args)
         {
             ITest test = new IdeaTest();
@@ -45,7 +43,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             Console.WriteLine(result);
         }
 
-		[Test]
+        [Test]
         public void TestFunction()
         {
             string resultText = Perform().ToString();
@@ -53,5 +51,3 @@ namespace Org.BouncyCastle.Crypto.Tests
         }
     }
 }
-
-#endif
diff --git a/crypto/test/src/crypto/test/Poly1305Test.cs b/crypto/test/src/crypto/test/Poly1305Test.cs
new file mode 100644
index 000000000..a1513165b
--- /dev/null
+++ b/crypto/test/src/crypto/test/Poly1305Test.cs
@@ -0,0 +1,395 @@
+using System;
+
+using NUnit.Framework;
+
+using Org.BouncyCastle.Crypto.Engines;
+using Org.BouncyCastle.Crypto.Generators;
+using Org.BouncyCastle.Crypto.Macs;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Utilities;
+using Org.BouncyCastle.Utilities.Encoders;
+using Org.BouncyCastle.Utilities.Test;
+using Org.BouncyCastle.Security;
+
+namespace Org.BouncyCastle.Crypto.Tests
+{
+	/*
+	 */
+	public class Poly1305Test
+		: SimpleTest
+	{
+		private const int MAXLEN = 1000;
+
+		private class KeyEngine
+			: IBlockCipher
+		{
+
+			private byte[] key;
+			private int blockSize;
+
+			public KeyEngine(int blockSize)
+			{
+				this.blockSize = blockSize;
+			}
+
+			public void Init(bool forEncryption, ICipherParameters parameters)
+			{
+				if (parameters is KeyParameter)
+				{
+					this.key = ((KeyParameter)parameters).GetKey();
+				}
+			}
+
+			public bool IsPartialBlockOkay 
+			{ 
+				get { return false; } 
+			}
+
+			public string AlgorithmName
+			{
+				get { return "Key"; }
+			}
+
+			public int GetBlockSize()
+			{
+				return blockSize;
+			}
+
+			public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
+			{
+				Array.Copy(key, 0, output, outOff, key.Length);
+				return key.Length;
+			}
+
+			public void Reset()
+			{
+			}
+
+		}
+
+		private class TestCase
+		{
+			internal byte[] key;
+			internal byte[] nonce;
+			internal byte[] message;
+			internal byte[] expectedMac;
+
+			public TestCase(string key, string nonce, string message, string expectedMac)
+			{
+				this.key = Hex.Decode(key);
+				// nacl test case keys are not pre-Clamped
+				Poly1305KeyGenerator.Clamp(this.key);
+				this.nonce = (nonce == null) ? null : Hex.Decode(nonce);
+				this.message = Hex.Decode(message);
+				this.expectedMac = Hex.Decode(expectedMac);
+			}
+		}
+
+		private static TestCase[] CASES = {
+			// Raw Poly1305
+			// onetimeauth.c from nacl-20110221
+			new TestCase("2539121d8e234e652d651fa4c8cff880eea6a7251c1e72916d11c2cb214d3c25", null,
+			             "8e993b9f48681273c29650ba32fc76ce48332ea7164d96a4476fb8c531a1186a"
+			             + "c0dfc17c98dce87b4da7f011ec48c97271d2c20f9b928fe2270d6fb863d51738"
+			             + "b48eeee314a7cc8ab932164548e526ae90224368517acfeabd6bb3732bc0e9da"
+			             + "99832b61ca01b6de56244a9e88d5f9b37973f622a43d14a6599b1f654cb45a74e355a5",
+			             "f3ffc7703f9400e52a7dfb4b3d3305d9"),
+
+			// Poly1305-AES
+			// Loop 1 of test-poly1305aes from poly1305aes-20050218
+			new TestCase("0000000000000000000000000000000000000000000000000000000000000000",
+			             "00000000000000000000000000000000", "", "66e94bd4ef8a2c3b884cfa59ca342b2e"),
+			new TestCase("f795bd4a52e29ed713d313fa20e98dbcf795bd0a50e29e0710d3130a20e98d0c",
+			             "917cf69ebd68b2ec9b9fe9a3eadda692", "66f7", "5ca585c75e8f8f025e710cabc9a1508b"),
+			new TestCase("e69dae0aab9f91c03a325dcc9436fa903ef49901c8e11c000430d90ad45e7603",
+			             "166450152e2394835606a9d1dd2cdc8b", "66f75c0e0c7a406586", "2924f51b9c2eff5df09db61dd03a9ca1"),
+			new TestCase("85a4ea91a7de0b0d96eed0d4bf6ecf1cda4afc035087d90e503f8f0ea08c3e0d",
+			             "0b6ef7a0b8f8c738b0f8d5995415271f",
+			             "66f75c0e0c7a40658629e3392f7f8e3349a02191ffd49f39879a8d9d1d0e23ea",
+			             "3c5a13adb18d31c64cc29972030c917d"),
+			new TestCase(
+				"25eb69bac5cdf7d6bfcee4d9d5507b82ca3c6a0da0a864024ca3090628c28e0d",
+				"046772a4f0a8de92e4f0d628cdb04484",
+				"66f75c0e0c7a40658629e3392f7f8e3349a02191ffd49f39879a8d9d1d0e23ea3caa4d240bd2ab8a8c4a6bb8d3288d9de4b793f05e97646dd4d98055de",
+				"fc5fb58dc65daf19b14d1d05da1064e8"),
+
+			// Specific test cases generated from test-poly1305aes from poly1305aes-20050218 that
+			// expose Java unsigned integer problems
+			new TestCase(
+				"95cc0e44d0b79a8856afcae1bec4fe3c" + "01bcb20bfc8b6e03609ddd09f44b060f",
+				null,
+				"66f75c0e0c7a40658629e3392f7f8e3349a02191ffd49f39879a8d9d1d0e23ea3caa4d240bd2ab8a8c4a6bb8d3288d9de4b793f05e97646dd4d98055de"
+				+ "fc3e0677d956b4c62664bac15962ab15d93ccbbc03aafdbde779162ed93b55361f0f8acaa41d50ef5175927fe79ea316186516eef15001cd04d3524a55"
+				+ "e4fa3c5ca479d3aaa8a897c21807f721b6270ffc68b6889d81a116799f6aaa35d8e04c7a7dd5e6da2519e8759f54e906696f5772fee093283bcef7b930"
+				+ "aed50323bcbc8c820c67422c1e16bdc022a9c0277c9d95fef0ea4ee11e2b27276da811523c5acb80154989f8a67ee9e3fa30b73b0c1c34bf46e3464d97"
+				+ "7cd7fcd0ac3b82721080bb0d9b982ee2c77feee983d7ba35da88ce86955002940652ab63bc56fb16f994da2b01d74356509d7d1b6d7956b0e5a557757b"
+				+ "d1ced2eef8650bc5b6d426108c1518abcbd0befb6a0d5fd57a3e2dbf31458eab63df66613653d4beae73f5c40eb438fbcfdcf4a4ba46320184b9ca0da4"
+				+ "dfae77de7ccc910356caea3243f33a3c81b064b3b7cedc7435c223f664227215715980e6e0bb570d459ba80d7512dbe458c8f0f3f52d659b6e8eef19ee"
+				+ "71aea2ced85c7a42ffca6522a62db49a2a46eff72bd7f7e0883acd087183f0627f3537a4d558754ed63358e8182bee196735b361dc9bd64d5e34e1074a"
+				+ "855655d2974cc6fa1653754cf40f561d8c7dc526aab2908ec2d2b977cde1a1fb1071e32f40e049ea20f30368ba1592b4fe57fb51595d23acbdace324cd"
+				+ "d78060a17187c662368854e915402d9b52fb21e984663e41c26a109437e162cfaf071b53f77e50000a5388ff183b82ce7a1af476c416d7d204157b3633"
+				+ "b2f4ec077b699b032816997e37bceded8d4a04976fd7d0c0b029f290794c3be504c5242287ea2f831f11ed5690d92775cd6e863d7731fd4da687ebfb13"
+				+ "df4c41dc0fb8", "ae345d555eb04d6947bb95c0965237e2"),
+			new TestCase(
+				"76fb3635a2dc92a1f768163ab12f2187" + "cd07fd0ef8c0be0afcbdb30af4af0009",
+				null,
+				"f05204a74f0f88a7fa1a95b84ec3d8ffb36fcdc7723ea65dfe7cd464e86e0abf6b9d51db3220cfd8496ad6e6d36ebee8d990f9ce0d3bb7f72b7ab5b3ab0a73240d11efe772c857021ae859db4933cdde4387b471d2ce700fef4b81087f8f47c307881fd83017afcd15b8d21edf9b704677f46df97b07e5b83f87c8abd90af9b1d0f9e2710e8ebd0d4d1c6a055abea861f42368bed94d9373e909c1d3715b221c16bc524c55c31ec3eab204850bb2474a84f9917038eff9d921130951391b5c54f09b5e1de833ea2cd7d3b306740abb7096d1e173da83427da2adddd3631eda30b54dbf487f2b082e8646f07d6e0a87e97522ca38d4ace4954bf3db6dd3a93b06fa18eb56856627ed6cffcd7ae26374554ca18ab8905f26331d323fe10e6e70624c7bc07a70f06ecd804b48f8f7e75e910165e1beb554f1f0ec7949c9c8d429a206b4d5c0653102249b6098e6b45fac2a07ff0220b0b8ae8f4c6bcc0c813a7cd141fa8b398b42575fc395747c5a0257ac41d6c1f434cfbf5dfe8349f5347ef6b60e611f5d6c3cbc20ca2555274d1934325824cef4809da293ea13f181929e2af025bbd1c9abdc3af93afd4c50a2854ade3887f4d2c8c225168052c16e74d76d2dd3e9467a2c5b8e15c06ffbffa42b8536384139f07e195a8c9f70f514f31dca4eb2cf262c0dcbde53654b6250a29efe21d54e83c80e005a1cad36d5934ff01c32e4bc5fe06d03064ff4a268517df4a94c759289f323734318cfa5d859d4ce9c16e63d02dff0896976f521607638535d2ee8dd3312e1ddc80a55d34fe829ab954c1ebd54d929954770f1be9d32b4c05003c5c9e97943b6431e2afe820b1e967b19843e5985a131b1100517cdc363799104af91e2cf3f53cb8fd003653a6dd8a31a3f9d566a7124b0ffe9695bcb87c482eb60106f88198f766a40bc0f4873c23653c5f9e7a8e446f770beb8034cf01d21028ba15ccee21a8db918c4829d61c88bfa927bc5def831501796c5b401a60a6b1b433c9fb905c8cd40412fffee81ab",
+				"045be28cc52009f506bdbfabedacf0b4"),
+
+		};
+
+		public override string Name
+		{
+			get { return "Poly1305"; }
+		}
+
+		public override void PerformTest()
+		{
+			testKeyGenerator();
+			testInit();
+			for (int i = 0; i < CASES.Length; i++)
+			{
+				testCase(i);
+			}
+			testSequential();
+			testReset();
+		}
+
+		private void testCase(int i)
+		{
+			byte[] output = new byte[16];
+			TestCase tc = CASES[i];
+
+			IMac mac;
+			if (tc.nonce == null)
+			{
+				// Raw Poly1305 test - don't do any transform on AES key part
+				mac = new Poly1305(new KeyEngine(16));
+				mac.Init(new ParametersWithIV(new KeyParameter(tc.key), new byte[16]));
+			}
+			else
+			{
+				mac = new Poly1305(new AesFastEngine());
+				mac.Init(new ParametersWithIV(new KeyParameter(tc.key), tc.nonce));
+			}
+			mac.BlockUpdate(tc.message, 0, tc.message.Length);
+			mac.DoFinal(output, 0);
+
+			if (!Arrays.AreEqual(output, tc.expectedMac))
+			{
+				Fail("Mismatched output " + i, Hex.ToHexString(tc.expectedMac), Hex.ToHexString(output));
+			}
+		}
+
+		private void testSequential()
+		{
+			// Sequential test, adapted from test-poly1305aes
+			int len;
+			byte[] kr = new byte[32];
+			byte[] m = new byte[MAXLEN];
+			byte[] n = new byte[16];
+			byte[] output = new byte[16];
+
+			int c = 0;
+			IMac mac = new Poly1305(new AesFastEngine());
+			for (int loop = 0; loop < 13; loop++)
+			{
+				len = 0;
+				for (;;)
+				{
+					c++;
+					mac.Init(new ParametersWithIV(new KeyParameter(kr), n));
+					mac.BlockUpdate(m, 0, len);
+					mac.DoFinal(output, 0);
+
+					// if (c == 678)
+					// {
+					// TestCase tc = CASES[0];
+					//
+					// if (!Arrays.AreEqual(tc.key, kr))
+					// {
+					// System.err.println("Key bad");
+					// System.err.println(Hex.ToHexString(tc.key)));
+					// System.err.println(Hex.ToHexString(kr)));
+					// System.exit(1);
+					// }
+					// if (!Arrays.AreEqual(tc.nonce, n))
+					// {
+					// System.err.println("Nonce bad");
+					// System.exit(1);
+					// }
+					// System.out.printf("[%d] m: %s\n", c, Hex.ToHexString(m, 0, len)));
+					// System.out.printf("[%d] K: %s\n", c, new string(Hex.encodje(kr)));
+					// System.out.printf("[%d] N: %s\n", c, Hex.ToHexString(n)));
+					// System.out.printf("[%d] M: ", c);
+					// }
+					// System.out.printf("%d/%s\n", c, Hex.ToHexString(out)));
+
+					if (len >= MAXLEN)
+						break;
+					n[0] = (byte)(n[0] ^ loop);
+					for (int i = 0; i < 16; ++i)
+						n[i] ^= output[i];
+					if (len % 2 != 0)
+						for (int i = 0; i < 16; ++i)
+							kr[i] ^= output[i];
+					if (len % 3 != 0)
+						for (int i = 0; i < 16; ++i)
+							kr[i + 16] ^= output[i];
+					Poly1305KeyGenerator.Clamp(kr);
+					m[len++] ^= output[0];
+				}
+			}
+			// Output after 13 loops as generated by poly1305 ref
+			if (c != 13013 || !Arrays.AreEqual(output, Hex.Decode("c96f60a23701a5b0fd2016f58cbe4f7e")))
+			{
+				Fail("Sequential Poly1305 " + c, "c96f60a23701a5b0fd2016f58cbe4f7e", Hex.ToHexString(output));
+			}
+		}
+
+		private void testReset()
+		{
+			CipherKeyGenerator gen = new Poly1305KeyGenerator();
+			gen.Init(new KeyGenerationParameters(new SecureRandom(), 256));
+			byte[] k = gen.GenerateKey();
+
+			byte[] m = new byte[10000];
+			byte[] check = new byte[16];
+			byte[] output = new byte[16];
+
+			// Generate baseline
+			IMac poly = new Poly1305(new AesFastEngine());
+			poly.Init(new ParametersWithIV(new KeyParameter(k), new byte[16]));
+
+			poly.BlockUpdate(m, 0, m.Length);
+			poly.DoFinal(check, 0);
+
+			// Check reset after doFinal
+			poly.BlockUpdate(m, 0, m.Length);
+			poly.DoFinal(output, 0);
+
+			if (!Arrays.AreEqual(check, output))
+			{
+				Fail("Mac not reset after doFinal");
+			}
+
+			// Check reset
+			poly.Update((byte)1);
+			poly.Update((byte)2);
+			poly.Reset();
+			poly.BlockUpdate(m, 0, m.Length);
+			poly.DoFinal(output, 0);
+
+			if (!Arrays.AreEqual(check, output))
+			{
+				Fail("Mac not reset after doFinal");
+			}
+
+			// Check init resets
+			poly.Update((byte)1);
+			poly.Update((byte)2);
+			poly.Init(new ParametersWithIV(new KeyParameter(k), new byte[16]));
+			poly.BlockUpdate(m, 0, m.Length);
+			poly.DoFinal(output, 0);
+
+			if (!Arrays.AreEqual(check, output))
+			{
+				Fail("Mac not reset after doFinal");
+			}
+		}
+
+		private void testInit()
+		{
+			CipherKeyGenerator gen = new Poly1305KeyGenerator();
+			gen.Init(new KeyGenerationParameters(new SecureRandom(), 256));
+			byte[] k = gen.GenerateKey();
+
+			IMac poly = new Poly1305(new AesFastEngine());
+			poly.Init(new ParametersWithIV(new KeyParameter(k), new byte[16]));
+
+			try
+			{
+				poly.Init(new ParametersWithIV(new KeyParameter(k), new byte[15]));
+				Fail("16 byte nonce required");
+			} catch (ArgumentException)
+			{
+				// Expected
+			}
+
+			try
+			{
+				byte[] k2 = new byte[k.Length - 1];
+				Array.Copy(k, 0, k2, 0, k2.Length);
+				poly.Init(new ParametersWithIV(new KeyParameter(k2), new byte[16]));
+				Fail("32 byte key required");
+			} catch (ArgumentException)
+			{
+				// Expected
+			}
+
+			try
+			{
+				k[19] = (byte)0xFF;
+				poly.Init(new ParametersWithIV(new KeyParameter(k), new byte[16]));
+				Fail("UnClamped key should not be accepted.");
+			} catch (ArgumentException)
+			{
+				// Expected
+			}
+
+		}
+
+		private void testKeyGenerator()
+		{
+			CipherKeyGenerator gen = new Poly1305KeyGenerator();
+			gen.Init(new KeyGenerationParameters(new SecureRandom(), 256));
+			byte[] k = gen.GenerateKey();
+
+			if (k.Length != 32)
+			{
+				Fail("Poly1305 key should be 256 bits.");
+			}
+
+			try
+			{
+				Poly1305KeyGenerator.CheckKey(k);
+			} catch (ArgumentException)
+			{
+				Fail("Poly1305 key should be Clamped on generation.");
+			}
+
+			byte[] k2 = new byte[k.Length];
+			Array.Copy(k, 0, k2, 0, k2.Length);
+			Poly1305KeyGenerator.Clamp(k);
+			if (!Arrays.AreEqual(k, k2))
+			{
+				Fail("Poly1305 key should be Clamped on generation.");
+			}
+
+			try
+			{
+				k2[19] = (byte)0xff;
+				Poly1305KeyGenerator.CheckKey(k2);
+				Fail("UnClamped key should fail check.");
+			} catch (ArgumentException)
+			{
+				// Expected
+			}
+		}
+
+		public static void Main(
+			string[] args)
+		{
+			RunTest(new Poly1305Test());
+		}
+
+		[Test]
+		public void TestFunction()
+		{
+			string resultText = Perform().ToString();
+
+			Assert.AreEqual(Name + ": Okay", resultText);
+		}
+
+	}
+}
\ No newline at end of file
diff --git a/crypto/test/src/crypto/test/RegressionTest.cs b/crypto/test/src/crypto/test/RegressionTest.cs
index a86e311ee..4b639005e 100644
--- a/crypto/test/src/crypto/test/RegressionTest.cs
+++ b/crypto/test/src/crypto/test/RegressionTest.cs
@@ -47,9 +47,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             new Cast5Test(),
             new Cast6Test(),
             new Gost28147Test(),
-#if INCLUDE_IDEA
             new IdeaTest(),
-#endif
             new RsaBlindedTest(),
             new RsaTest(),
             new ISO9796Test(),
@@ -99,10 +97,13 @@ namespace Org.BouncyCastle.Crypto.Tests
             new Rfc3211WrapTest(),
             new SeedTest(),
             new NaccacheSternTest(),
-            new Salsa20Test(),
+			new Salsa20Test(),
+			new XSalsa20Test(),
+			new ChaChaTest(),
             new CMacTest(),
             new EaxTest(),
             new GcmTest(),
+            new GMacTest(),
             new HCFamilyTest(),
             new HCFamilyVecTest(),
             new IsaacTest(),
@@ -114,6 +115,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             new SCryptTest(),
             new NullTest(),
             new SipHashTest(),
+            new Poly1305Test(),
             new OcbTest(),
 			new Sm3DigestTest()
         };
diff --git a/crypto/test/src/crypto/test/Salsa20Test.cs b/crypto/test/src/crypto/test/Salsa20Test.cs
index 9e7549ae7..b4dc1ef2b 100644
--- a/crypto/test/src/crypto/test/Salsa20Test.cs
+++ b/crypto/test/src/crypto/test/Salsa20Test.cs
@@ -106,6 +106,58 @@ namespace Org.BouncyCastle.Crypto.Tests
 			+ "C945A6CC69A6A17367BC03431A86B3ED"
 			+ "04B0245B56379BF997E25800AD837D7D";
 
+		// Salsa20/12
+
+		private static readonly string salsa12_set1v0_0 = 
+			"FC207DBFC76C5E1774961E7A5AAD0906"
+			+ "9B2225AC1CE0FE7A0CE77003E7E5BDF8"
+			+ "B31AF821000813E6C56B8C1771D6EE70"
+			+ "39B2FBD0A68E8AD70A3944B677937897";
+
+		private static readonly string salsa12_set1v0_192 = 
+			"4B62A4881FA1AF9560586510D5527ED4"
+			+ "8A51ECAFA4DECEEBBDDC10E9918D44AB"
+			+ "26B10C0A31ED242F146C72940C6E9C37"
+			+ "53F641DA84E9F68B4F9E76B6C48CA5AC";
+
+		private static readonly string salsa12_set1v0_256 = 
+			"F52383D9DEFB20810325F7AEC9EADE34"
+			+ "D9D883FEE37E05F74BF40875B2D0BE79"
+			+ "ED8886E5BFF556CEA8D1D9E86B1F68A9"
+			+ "64598C34F177F8163E271B8D2FEB5996";
+
+		private static readonly string salsa12_set1v0_448 =
+			"A52ED8C37014B10EC0AA8E05B5CEEE12"
+			+ "3A1017557FB3B15C53E6C5EA8300BF74"
+			+ "264A73B5315DC821AD2CAB0F3BB2F152"
+			+ "BDAEA3AEE97BA04B8E72A7B40DCC6BA4";
+
+		// Salsa20/8
+
+		private static readonly string salsa8_set1v0_0 =
+			"A9C9F888AB552A2D1BBFF9F36BEBEB33"
+			+ "7A8B4B107C75B63BAE26CB9A235BBA9D"
+			+ "784F38BEFC3ADF4CD3E266687EA7B9F0"
+			+ "9BA650AE81EAC6063AE31FF12218DDC5";
+
+		private static readonly string salsa8_set1v0_192 =
+			"BB5B6BB2CC8B8A0222DCCC1753ED4AEB"
+			+ "23377ACCBD5D4C0B69A8A03BB115EF71"
+			+ "871BC10559080ACA7C68F0DEF32A80DD"
+			+ "BAF497259BB76A3853A7183B51CC4B9F";
+
+		private static readonly string salsa8_set1v0_256 =
+			"4436CDC0BE39559F5E5A6B79FBDB2CAE"
+			+ "4782910F27FFC2391E05CFC78D601AD8"
+			+ "CD7D87B074169361D997D1BED9729C0D"
+			+ "EB23418E0646B7997C06AA84E7640CE3";
+
+		private static readonly string salsa8_set1v0_448 =
+			"BEE85903BEA506B05FC04795836FAAAC"
+			+ "7F93F785D473EB762576D96B4A65FFE4"
+			+ "63B34AAE696777FC6351B67C3753B89B"
+			+ "A6B197BD655D1D9CA86E067F4D770220";
+
 		public override string Name
 		{
 			get { return "Salsa20"; }
@@ -113,10 +165,14 @@ namespace Org.BouncyCastle.Crypto.Tests
 
 		public override void PerformTest()
 		{
-			salsa20Test1(new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+			salsa20Test1(20, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
 					set1v0_0, set1v0_192,  set1v0_256,  set1v0_448);
-			salsa20Test1(new ParametersWithIV(new KeyParameter(Hex.Decode("00400000000000000000000000000000")), Hex.Decode("0000000000000000")),
+			salsa20Test1(20, new ParametersWithIV(new KeyParameter(Hex.Decode("00400000000000000000000000000000")), Hex.Decode("0000000000000000")),
 					set1v9_0, set1v9_192,  set1v9_256,  set1v9_448);
+			salsa20Test1(12, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+		             salsa12_set1v0_0, salsa12_set1v0_192,  salsa12_set1v0_256,  salsa12_set1v0_448);
+			salsa20Test1(8, new ParametersWithIV(new KeyParameter(Hex.Decode("80000000000000000000000000000000")), Hex.Decode("0000000000000000")),
+		             salsa8_set1v0_0, salsa8_set1v0_192,  salsa8_set1v0_256,  salsa8_set1v0_448);
 			salsa20Test2(new ParametersWithIV(new KeyParameter(Hex.Decode("0053A6F94C9FF24598EB3E91E4378ADD3083D6297CCF2275C81B6EC11467BA0D")), Hex.Decode("0D74DB42A91077DE")),
 					set6v0_0, set6v0_65472, set6v0_65536);
 			salsa20Test2(new ParametersWithIV(new KeyParameter(Hex.Decode("0558ABFE51A4F74A9DF04396E93C8FE23588DB2E81D4277ACD2073C6196CBF12")), Hex.Decode("167DE44BB21980E7")),
@@ -125,13 +181,14 @@ namespace Org.BouncyCastle.Crypto.Tests
 		}
 
 		private void salsa20Test1(
+			int rounds,
 			ICipherParameters	parameters,
 			string				v0,
 			string				v192,
 			string				v256,
 			string				v448)
 		{
-			IStreamCipher salsa = new Salsa20Engine();
+			IStreamCipher salsa = new Salsa20Engine(rounds);
 			byte[]       buf = new byte[64];
 
 			salsa.Init(true, parameters);
@@ -144,19 +201,19 @@ namespace Org.BouncyCastle.Crypto.Tests
 				case 0:
 					if (!AreEqual(buf, Hex.Decode(v0)))
 					{
-						mismatch("v0", v0, buf);
+						mismatch("v0/" + rounds, v0, buf);
 					}
 					break;
 				case 3:
 					if (!AreEqual(buf, Hex.Decode(v192)))
 					{
-						mismatch("v192", v192, buf);
+						mismatch("v192/" + rounds, v192, buf);
 					}
 					break;
 				case 4:
 					if (!AreEqual(buf, Hex.Decode(v256)))
 					{
-						mismatch("v256", v256, buf);
+						mismatch("v256/" + rounds, v256, buf);
 					}
 					break;
 				default:
diff --git a/crypto/test/src/crypto/test/XSalsa20Test.cs b/crypto/test/src/crypto/test/XSalsa20Test.cs
new file mode 100644
index 000000000..74ed04e88
--- /dev/null
+++ b/crypto/test/src/crypto/test/XSalsa20Test.cs
@@ -0,0 +1,183 @@
+using System;
+
+using NUnit.Framework;
+
+using Org.BouncyCastle.Crypto.Engines;
+using Org.BouncyCastle.Crypto.Parameters;
+using Org.BouncyCastle.Utilities;
+using Org.BouncyCastle.Utilities.Encoders;
+using Org.BouncyCastle.Utilities.Test;
+
+namespace Org.BouncyCastle.Crypto.Tests
+{
+	/**
+	* XSalsa20 Test
+	*/
+	[TestFixture]
+	public class XSalsa20Test 
+		: SimpleTest
+	{
+		private class TestCase
+		{
+
+			private byte[] key;
+			private byte[] iv;
+			private byte[] plaintext;
+			private byte[] ciphertext;
+
+			public TestCase(String key, string iv, string plaintext, string ciphertext)
+			{
+				this.key = Hex.Decode(key);
+				this.iv = Hex.Decode(iv);
+				this.plaintext = Hex.Decode(plaintext);
+				this.ciphertext = Hex.Decode(ciphertext);
+			}
+
+			public byte[] Key
+			{
+				get { return key; }
+			}
+
+			public byte[] Iv
+			{
+				get { return iv; }
+			}
+
+			public byte[] Plaintext
+			{
+				get { return plaintext; }
+			}
+
+			public byte[] Ciphertext
+			{
+				get { return ciphertext; }
+			}
+		}
+
+		// Test cases generated by naclcrypto-20090308, as used by cryptopp
+		private static readonly TestCase[] TEST_CASES = new TestCase[] {
+			new TestCase(
+				"a6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff88030",
+				"9e645a74e9e0a60d8243acd9177ab51a1beb8d5a2f5d700c",
+				"093c5e5585579625337bd3ab619d615760d8c5b224a85b1d0efe0eb8a7ee163abb0376529fcc09bab506c618e13ce777d82c3ae9d1a6f972d4160287cbfe60bf2130fc0a6ff6049d0a5c8a82f429231f008082e845d7e189d37f9ed2b464e6b919e6523a8c1210bd52a02a4c3fe406d3085f5068d1909eeeca6369abc981a42e87fe665583f0ab85ae71f6f84f528e6b397af86f6917d9754b7320dbdc2fea81496f2732f532ac78c4e9c6cfb18f8e9bdf74622eb126141416776971a84f94d156beaf67aecbf2ad412e76e66e8fad7633f5b6d7f3d64b5c6c69ce29003c6024465ae3b89be78e915d88b4b5621d",
+				"b2af688e7d8fc4b508c05cc39dd583d6714322c64d7f3e63147aede2d9534934b04ff6f337b031815cd094bdbc6d7a92077dce709412286822ef0737ee47f6b7ffa22f9d53f11dd2b0a3bb9fc01d9a88f9d53c26e9365c2c3c063bc4840bfc812e4b80463e69d179530b25c158f543191cff993106511aa036043bbc75866ab7e34afc57e2cce4934a5faae6eabe4f221770183dd060467827c27a354159a081275a291f69d946d6fe28ed0b9ce08206cf484925a51b9498dbde178ddd3ae91a8581b91682d860f840782f6eea49dbb9bd721501d2c67122dea3b7283848c5f13e0c0de876bd227a856e4de593a3"),
+			new TestCase(
+				"9e1da239d155f52ad37f75c7368a536668b051952923ad44f57e75ab588e475a",
+				"af06f17859dffa799891c4288f6635b5c5a45eee9017fd72",
+				"feac9d54fc8c115ae247d9a7e919dd76cfcbc72d32cae4944860817cbdfb8c04e6b1df76a16517cd33ccf1acda9206389e9e318f5966c093cfb3ec2d9ee2de856437ed581f552f26ac2907609df8c613b9e33d44bfc21ff79153e9ef81a9d66cc317857f752cc175fd8891fefebb7d041e6517c3162d197e2112837d3bc4104312ad35b75ea686e7c70d4ec04746b52ff09c421451459fb59f",
+				"2c261a2f4e61a62e1b27689916bf03453fcbc97bb2af6f329391ef063b5a219bf984d07d70f602d85f6db61474e9d9f5a2deecb4fcd90184d16f3b5b5e168ee03ea8c93f3933a22bc3d1a5ae8c2d8b02757c87c073409052a2a8a41e7f487e041f9a49a0997b540e18621cad3a24f0a56d9b19227929057ab3ba950f6274b121f193e32e06e5388781a1cb57317c0ba6305e910961d01002f0"),
+			new TestCase("d5c7f6797b7e7e9c1d7fd2610b2abf2bc5a7885fb3ff78092fb3abe8986d35e2",
+	             "744e17312b27969d826444640e9c4a378ae334f185369c95",
+	             "7758298c628eb3a4b6963c5445ef66971222be5d1a4ad839715d1188071739b77cc6e05d5410f963a64167629757",
+	             "27b8cfe81416a76301fd1eec6a4d99675069b2da2776c360db1bdfea7c0aa613913e10f7a60fec04d11e65f2d64e"),
+			new TestCase(
+				"737d7811ce96472efed12258b78122f11deaec8759ccbd71eac6bbefa627785c",
+				"6fb2ee3dda6dbd12f1274f126701ec75c35c86607adb3edd",
+				"501325fb2645264864df11faa17bbd58312b77cad3d94ac8fb8542f0eb653ad73d7fce932bb874cb89ac39fc47f8267cf0f0c209f204b2d8578a3bdf461cb6a271a468bebaccd9685014ccbc9a73618c6a5e778a21cc8416c60ad24ddc417a130d53eda6dfbfe47d09170a7be1a708b7b5f3ad464310be36d9a2a95dc39e83d38667e842eb6411e8a23712297b165f690c2d7ca1b1346e3c1fccf5cafd4f8be0",
+				"6724c372d2e9074da5e27a6c54b2d703dc1d4c9b1f8d90f00c122e692ace7700eadca942544507f1375b6581d5a8fb39981c1c0e6e1ff2140b082e9ec016fce141d5199647d43b0b68bfd0fea5e00f468962c7384dd6129aea6a3fdfe75abb210ed5607cef8fa0e152833d5ac37d52e557b91098a322e76a45bbbcf4899e790618aa3f4c2e5e0fc3de93269a577d77a5502e8ea02f717b1dd2df1ec69d8b61ca"),
+			new TestCase(
+				"760158da09f89bbab2c99e6997f9523a95fcef10239bcca2573b7105f6898d34",
+				"43636b2cc346fc8b7c85a19bf507bdc3dafe953b88c69dba",
+				"d30a6d42dff49f0ed039a306bae9dec8d9e88366cc19e8c3642fd58fa0794ebf8029d949730339b0823a51f0f49f0d2c71f1051c1e0e2c86941f172789cdb1b0107413e70f982ff9761877bb526ef1c3eb1106a948d60ef21bd35d32cfd64f89b79ed63ecc5cca56246af736766f285d8e6b0da9cb1cd21020223ffacc5a32",
+				"c815b6b79b64f9369aec8dce8c753df8a50f2bc97c70ce2f014db33a65ac5816bac9e30ac08bdded308c65cb87e28e2e71b677dc25c5a6499c1553555daf1f55270a56959dffa0c66f24e0af00951ec4bb59ccc3a6c5f52e0981647e53e439313a52c40fa7004c855b6e6eb25b212a138e843a9ba46edb2a039ee82a263abe"),
+			new TestCase(
+				"27ba7e81e7edd4e71be53c07ce8e633138f287e155c7fa9e84c4ad804b7fa1b9",
+				"ea05f4ebcd2fb6b000da0612861ba54ff5c176fb601391aa",
+				"e09ff5d2cb050d69b2d42494bde5825238c756d6991d99d7a20d1ef0b83c371c89872690b2fc11d5369f4fc4971b6d3d6c078aef9b0f05c0e61ab89c025168054defeb03fef633858700c58b1262ce011300012673e893e44901dc18eee3105699c44c805897bdaf776af1833162a21a",
+				"a23e7ef93c5d0667c96d9e404dcbe6be62026fa98f7a3ff9ba5d458643a16a1cef7272dc6097a9b52f35983557c77a11b314b4f7d5dc2cca15ee47616f861873cbfed1d32372171a61e38e447f3cf362b3abbb2ed4170d89dcb28187b7bfd206a3e026f084a7e0ed63d319de6bc9afc0"),
+			new TestCase("6799d76e5ffb5b4920bc2768bafd3f8c16554e65efcf9a16f4683a7a06927c11",
+	             "61ab951921e54ff06d9b77f313a4e49df7a057d5fd627989", "472766", "8fd7df"),
+			new TestCase(
+				"f68238c08365bb293d26980a606488d09c2f109edafa0bbae9937b5cc219a49c",
+				"5190b51e9b708624820b5abdf4e40fad1fb950ad1adc2d26",
+				"47ec6b1f73c4b7ff5274a0bfd7f45f864812c85a12fbcb3c2cf8a3e90cf66ccf2eacb521e748363c77f52eb426ae57a0c6c78f75af71284569e79d1a92f949a9d69c4efc0b69902f1e36d7562765543e2d3942d9f6ff5948d8a312cff72c1afd9ea3088aff7640bfd265f7a9946e606abc77bcedae6bddc75a0dba0bd917d73e3bd1268f727e0096345da1ed25cf553ea7a98fea6b6f285732de37431561ee1b3064887fbcbd71935e02",
+				"36160e88d3500529ba4edba17bc24d8cfaca9a0680b3b1fc97cf03f3675b7ac301c883a68c071bc54acdd3b63af4a2d72f985e51f9d60a4c7fd481af10b2fc75e252fdee7ea6b6453190617dcc6e2fe1cd56585fc2f0b0e97c5c3f8ad7eb4f31bc4890c03882aac24cc53acc1982296526690a220271c2f6e326750d3fbda5d5b63512c831f67830f59ac49aae330b3e0e02c9ea0091d19841f1b0e13d69c9fbfe8a12d6f30bb734d9d2"),
+			new TestCase(
+				"45b2bd0de4ed9293ec3e26c4840faaf64b7d619d51e9d7a2c7e36c83d584c3df",
+				"546c8c5d6be8f90952cab3f36d7c1957baaa7a59abe3d7e5",
+				"5007c8cd5b3c40e17d7fe423a87ae0ced86bec1c39dc07a25772f3e96dabd56cd3fd7319f6c9654925f2d87087a700e1b130da796895d1c9b9acd62b266144067d373ed51e787498b03c52faad16bb3826fa511b0ed2a19a8663f5ba2d6ea7c38e7212e9697d91486c49d8a000b9a1935d6a7ff7ef23e720a45855481440463b4ac8c4f6e7062adc1f1e1e25d3d65a31812f58a71160",
+				"8eacfba568898b10c0957a7d44100685e8763a71a69a8d16bc7b3f88085bb9a2f09642e4d09a9f0ad09d0aad66b22610c8bd02ff6679bb92c2c026a216bf425c6be35fb8dae7ff0c72b0efd6a18037c70eed0ca90062a49a3c97fdc90a8f9c2ea536bfdc41918a7582c9927fae47efaa3dc87967b7887dee1bf071734c7665901d9105dae2fdf66b4918e51d8f4a48c60d19fbfbbcba"),
+			new TestCase(
+				"fe559c9a282beb40814d016d6bfcb2c0c0d8bf077b1110b8703a3ce39d70e0e1",
+				"b076200cc7011259805e18b304092754002723ebec5d6200",
+				"6db65b9ec8b114a944137c821fd606be75478d928366d5284096cdef782fcff7e8f59cb8ffcda979757902c5ffa6bc477ceaa4cb5d5ea76f94d91e833f823a6bc78f1055dfa6a97bea8965c1cde67a668e001257334a585727d9e0f7c1a06e88d3d25a4e6d9096c968bf138e116a3ebeffd4bb4808adb1fd698164ba0a35c709a47f16f1f4435a2345a9194a00b95abd51851d505809a6077da9baca5831afff31578c487ee68f2767974a98a7e803aac788da98319c4ea8eaa3d394855651f484cef543f537e35158ee29",
+				"4dce9c8f97a028051b0727f34e1b9ef21f06f0760f36e71713204027902090ba2bb6b13436ee778d9f50530efbd7a32b0d41443f58ccaee781c7b716d3a96fdec0e3764ed7959f34c3941278591ea033b5cbadc0f1916032e9bebbd1a8395b83fb63b1454bd775bd20b3a2a96f951246ac14daf68166ba62f6cbff8bd121ac9498ff8852fd2be975df52b5daef3829d18eda42e715022dcbf930d0a789ee6a146c2c7088c35773c63c06b4af4559856ac199ced86863e4294707825337c5857970eb7fddeb263781309011"),
+			new TestCase(
+				"0ae10012d7e56614b03dcc89b14bae9242ffe630f3d7e35ce8bbb97bbc2c92c3",
+				"f96b025d6cf46a8a12ac2af1e2aef1fb83590adadaa5c5ea",
+				"ea0f354e96f12bc72bbaa3d12b4a8ed879b042f0689878f46b651cc4116d6f78409b11430b3aaa30b2076891e8e1fa528f2fd169ed93dc9f84e24409eec2101daf4d057be2492d11de640cbd7b355ad29fb70400fffd7cd6d425abeeb732a0eaa4330af4c656252c4173deab653eb85c58462d7ab0f35fd12b613d29d473d330310dc323d3c66348bbdbb68a326324657cae7b77a9e34358f2cec50c85609e73056856796e3be8d62b6e2fe9f953",
+				"e8abd48924b54e5b80866be7d4ebe5cf4274cafff08b39cb2d40a8f0b472398aedc776e0793812fbf1f60078635d2ed86b15efcdba60411ee23b07233592a44ec31b1013ce8964236675f8f183aef885e864f2a72edf4215b5338fa2b54653dfa1a8c55ce5d95cc605b9b311527f2e3463ffbec78a9d1d65dabad2f338769c9f43f133a791a11c7eca9af0b771a4ac32963dc8f631a2c11217ac6e1b9430c1aae1ceebe22703f429998a8fb8c641"),
+			new TestCase(
+				"082c539bc5b20f97d767cd3f229eda80b2adc4fe49c86329b5cd6250a9877450",
+				"845543502e8b64912d8f2c8d9fffb3c69365686587c08d0c",
+				"a96bb7e910281a6dfad7c8a9c370674f0ceec1ad8d4f0de32f9ae4a23ed329e3d6bc708f876640a229153ac0e7281a8188dd77695138f01cda5f41d5215fd5c6bdd46d982cb73b1efe2997970a9fdbdb1e768d7e5db712068d8ba1af6067b5753495e23e6e1963af012f9c7ce450bf2de619d3d59542fb55f3",
+				"835da74fc6de08cbda277a7966a07c8dcd627e7b17adde6d930b6581e3124b8baad096f693991fedb1572930601fc7709541839b8e3ffd5f033d2060d999c6c6e3048276613e648000acb5212cc632a916afce290e20ebdf612d08a6aa4c79a74b070d3f872a861f8dc6bb07614db515d363349d3a8e3336a3"),
+			new TestCase("3d02bff3375d403027356b94f514203737ee9a85d2052db3e4e5a217c259d18a",
+	             "74216c95031895f48c1dba651555ebfa3ca326a755237025",
+	             "0d4b0f54fd09ae39baa5fa4baccf2e6682e61b257e01f42b8f",
+	             "16c4006c28365190411eb1593814cf15e74c22238f210afc3d"),
+			new TestCase(
+				"ad1a5c47688874e6663a0f3fa16fa7efb7ecadc175c468e5432914bdb480ffc6",
+				"e489eed440f1aae1fac8fb7a9825635454f8f8f1f52e2fcc",
+				"aa6c1e53580f03a9abb73bfdadedfecada4c6b0ebe020ef10db745e54ba861caf65f0e40dfc520203bb54d29e0a8f78f16b3f1aa525d6bfa33c54726e59988cfbec78056",
+				"02fe84ce81e178e7aabdd3ba925a766c3c24756eefae33942af75e8b464556b5997e616f3f2dfc7fce91848afd79912d9fb55201b5813a5a074d2c0d4292c1fd441807c5"),
+			new TestCase(
+				"053a02bedd6368c1fb8afc7a1b199f7f7ea2220c9a4b642a6850091c9d20ab9c",
+				"c713eea5c26dad75ad3f52451e003a9cb0d649f917c89dde",
+				"8f0a8a164760426567e388840276de3f95cb5e3fadc6ed3f3e4fe8bc169d9388804dcb94b6587dbb66cb0bd5f87b8e98b52af37ba290629b858e0e2aa7378047a26602",
+				"516710e59843e6fbd4f25d0d8ca0ec0d47d39d125e9dad987e0518d49107014cb0ae405e30c2eb3794750bca142ce95e290cf95abe15e822823e2e7d3ab21bc8fbd445"),
+			new TestCase(
+				"5b14ab0fbed4c58952548a6cb1e0000cf4481421f41288ea0aa84add9f7deb96",
+				"54bf52b911231b952ba1a6af8e45b1c5a29d97e2abad7c83",
+				"37fb44a675978b560ff9a4a87011d6f3ad2d37a2c3815b45a3c0e6d1b1d8b1784cd468927c2ee39e1dccd4765e1c3d676a335be1ccd6900a45f5d41a317648315d8a8c24adc64eb285f6aeba05b9029586353d303f17a807658b9ff790474e1737bd5fdc604aeff8dfcaf1427dcc3aacbb0256badcd183ed75a2dc52452f87d3c1ed2aa583472b0ab91cda20614e9b6fdbda3b49b098c95823cc72d8e5b717f2314b0324e9ce",
+				"ae6deb5d6ce43d4b09d0e6b1c0e9f46157bcd8ab50eaa3197ff9fa2bf7af649eb52c68544fd3adfe6b1eb316f1f23538d470c30dbfec7e57b60cbcd096c782e7736b669199c8253e70214cf2a098fda8eac5da79a9496a3aae754d03b17c6d70d1027f42bf7f95ce3d1d9c338854e158fcc803e4d6262fb639521e47116ef78a7a437ca9427ba645cd646832feab822a208278e45e93e118d780b988d65397eddfd7a819526e"),
+			new TestCase(
+				"d74636e3413a88d85f322ca80fb0bd650bd0bf0134e2329160b69609cd58a4b0",
+				"efb606aa1d9d9f0f465eaa7f8165f1ac09f5cb46fecf2a57",
+				"f85471b75f6ec81abac2799ec09e98e280b2ffd64ca285e5a0109cfb31ffab2d617b2c2952a2a8a788fc0da2af7f530758f74f1ab56391ab5ff2adbcc5be2d6c7f49fbe8118104c6ff9a23c6dfe52f57954e6a69dcee5db06f514f4a0a572a9a8525d961dae72269b987189d465df6107119c7fa790853e063cba0fab7800ca932e258880fd74c33c784675bedad0e7c09e9cc4d63dd5e9713d5d4a0196e6b562226ac31b4f57c04f90a181973737ddc7e80f364112a9fbb435ebdbcabf7d490ce52",
+				"b2b795fe6c1d4c83c1327e015a67d4465fd8e32813575cbab263e20ef05864d2dc17e0e4eb81436adfe9f638dcc1c8d78f6b0306baf938e5d2ab0b3e05e735cc6fff2d6e02e3d60484bea7c7a8e13e23197fea7b04d47d48f4a4e5944174539492800d3ef51e2ee5e4c8a0bdf050c2dd3dd74fce5e7e5c37364f7547a11480a3063b9a0a157b15b10a5a954de2731ced055aa2e2767f0891d4329c426f3808ee867bed0dc75b5922b7cfb895700fda016105a4c7b7f0bb90f029f6bbcb04ac36ac16") };
+
+		public override string Name
+		{
+			get { return "XSalsa20"; }
+		}
+
+		public override void PerformTest()
+		{
+			for (int i = 0; i < TEST_CASES.Length; i++)
+			{
+				performTest(i, TEST_CASES[i]);
+			}
+		}
+
+		private void performTest(int number, TestCase testCase)
+		{
+			byte[] plaintext = testCase.Plaintext;
+			byte[] output = new byte[plaintext.Length];
+
+			XSalsa20Engine engine = new XSalsa20Engine();
+			engine.Init(false, new ParametersWithIV(new KeyParameter(testCase.Key), testCase.Iv));
+
+			engine.ProcessBytes(testCase.Plaintext, 0, testCase.Plaintext.Length, output, 0);
+
+			if (!Arrays.AreEqual(testCase.Ciphertext, output))
+			{
+				Fail("mismatch on " + number, Hex.ToHexString(testCase.Ciphertext), Hex.ToHexString(output));
+			}
+		}
+
+		public static void Main(
+			string[] args)
+		{
+			RunTest(new XSalsa20Test());
+		}
+
+		[Test]
+		public void TestFunction()
+		{
+			string resultText = Perform().ToString();
+
+			Assert.AreEqual(Name + ": Okay", resultText);
+		}
+	}
+}
diff --git a/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs b/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
index e71ee653a..380004d96 100644
--- a/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
+++ b/crypto/test/src/math/ec/test/ECPointPerformanceTest.cs
@@ -1,73 +1,129 @@
 using System;
+using System.Collections;
+using System.Text;
 
 using NUnit.Framework;
 
+using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Sec;
 using Org.BouncyCastle.Asn1.X9;
+using Org.BouncyCastle.Crypto.EC;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Math.EC;
 using Org.BouncyCastle.Security;
+using Org.BouncyCastle.Utilities;
+using Org.BouncyCastle.Utilities.Collections;
 using Org.BouncyCastle.Utilities.Date;
 
 namespace Org.BouncyCastle.Math.EC.Tests
 {
-	/**
-	* Compares the performance of the the window NAF point multiplication against
-	* conventional point multiplication.
-	*/
-	[TestFixture, Explicit]
-	public class ECPointPerformanceTest
-	{
-		public const int NUM_ROUNDS = 100;
+    /**
+    * Compares the performance of the the window NAF point multiplication against
+    * conventional point multiplication.
+    */
+    [TestFixture, Explicit]
+    public class ECPointPerformanceTest
+    {
+        public const int PRE_ROUNDS = 10;
+        public const int NUM_ROUNDS = 100;
 
-		private void randMult(string curveName)
-		{
-			X9ECParameters spec = SecNamedCurves.GetByName(curveName);
+        private void RandMult(string curveName)
+        {
+            X9ECParameters spec = ECNamedCurveTable.GetByName(curveName);
+            if (spec != null)
+            {
+                RandMult(curveName, spec);
+            }
 
-			BigInteger n = spec.N;
-			ECPoint g = (ECPoint) spec.G;
-			SecureRandom random = new SecureRandom(); //SecureRandom.getInstance("SHA1PRNG", "SUN");
-			BigInteger k = new BigInteger(n.BitLength - 1, random);
+            spec = CustomNamedCurves.GetByName(curveName);
+            if (spec != null)
+            {
+                RandMult(curveName + " (custom)", spec);
+            }
+        }
 
-			ECPoint qMultiply = null;
-			long startTime = DateTimeUtilities.CurrentUnixMs();
-			for (int i = 0; i < NUM_ROUNDS; i++)
-			{
-				qMultiply = g.Multiply(k);
-			}
-			long endTime = DateTimeUtilities.CurrentUnixMs();
+        private void RandMult(string label, X9ECParameters spec)
+        {
+            ECPoint G = (ECPoint)spec.G;
+            BigInteger n = spec.N;
+            SecureRandom random = new SecureRandom();
+            random.SetSeed(DateTimeUtilities.CurrentUnixMs());
 
-			double avgDuration = (double) (endTime - startTime) / NUM_ROUNDS;
-			Console.WriteLine(curveName);
-			Console.Write("Millis   : ");
-			Console.WriteLine(avgDuration);
-			Console.WriteLine();
-		}
+            Console.WriteLine(label);
 
-		[Test]
-		public void TestMultiply()
-		{
-			randMult("sect163k1");
-			randMult("sect163r2");
-			randMult("sect233k1");
-			randMult("sect233r1");
-			randMult("sect283k1");
-			randMult("sect283r1");
-			randMult("sect409k1");
-			randMult("sect409r1");
-			randMult("sect571k1");
-			randMult("sect571r1");
-			randMult("secp224k1");
-			randMult("secp224r1");
-			randMult("secp256k1");
-			randMult("secp256r1");
-			randMult("secp521r1");
-		}
+            double avgDuration = RandMult(random, G, n);
+            string coordName = "AFFINE";
+            StringBuilder sb = new StringBuilder();
+            sb.Append("  ");
+            sb.Append(coordName);
+            for (int j = coordName.Length; j < 30; ++j)
+            {
+                sb.Append(' ');
+            }
+            sb.Append(": ");
+            sb.Append(avgDuration);
+            sb.Append("ms");
+            Console.WriteLine(sb.ToString());
+        }
 
-		// public static void Main(string argv[])
-		// {
-		// ECMultiplyPerformanceTest test = new ECMultiplyPerformanceTest();
-		// Test.testMultiply();
-		// }
-	}
+        private double RandMult(SecureRandom random, ECPoint g, BigInteger n)
+        {
+            BigInteger[] ks = new BigInteger[128];
+            for (int i = 0; i < ks.Length; ++i)
+            {
+                ks[i] = new BigInteger(n.BitLength - 1, random);
+            }
+
+            int ki = 0;
+            ECPoint p = g;
+            for (int i = 1; i <= PRE_ROUNDS; i++)
+            {
+                BigInteger k = ks[ki];
+                p = g.Multiply(k);
+                if (++ki == ks.Length)
+                {
+                    ki = 0;
+                    g = p;
+                }
+            }
+            long startTime = DateTimeUtilities.CurrentUnixMs();
+            for (int i = 1; i <= NUM_ROUNDS; i++)
+            {
+                BigInteger k = ks[ki];
+                p = g.Multiply(k);
+                if (++ki == ks.Length)
+                {
+                    ki = 0;
+                    g = p;
+                }
+            }
+            long endTime = DateTimeUtilities.CurrentUnixMs();
+
+            return (double)(endTime - startTime) / NUM_ROUNDS;
+        }
+
+        [Test]
+        public void TestMultiply()
+        {
+            ArrayList nameList = new ArrayList();
+            CollectionUtilities.AddRange(nameList, ECNamedCurveTable.Names);
+            string[] names = (string[])nameList.ToArray(typeof(string));
+            Array.Sort(names);
+            ISet oids = new HashSet();
+            foreach (string name in names)
+            {
+                DerObjectIdentifier oid = ECNamedCurveTable.GetOid(name);
+                if (!oids.Contains(oid))
+                {
+                    oids.Add(oid);
+                    RandMult(name);
+                }
+            }
+        }
+
+        public static void Main(string[] args)
+        {
+            new ECPointPerformanceTest().TestMultiply();
+        }
+    }
 }
diff --git a/crypto/test/src/math/ec/test/ECPointTest.cs b/crypto/test/src/math/ec/test/ECPointTest.cs
index 4c8b2d8fc..7d26e6fbb 100644
--- a/crypto/test/src/math/ec/test/ECPointTest.cs
+++ b/crypto/test/src/math/ec/test/ECPointTest.cs
@@ -10,442 +10,440 @@ using Org.BouncyCastle.Security;
 
 namespace Org.BouncyCastle.Math.EC.Tests
 {
-	/**
-	 * Test class for {@link org.bouncycastle.math.ec.ECPoint ECPoint}. All
-	 * literature values are taken from "Guide to elliptic curve cryptography",
-	 * Darrel Hankerson, Alfred J. Menezes, Scott Vanstone, 2004, Springer-Verlag
-	 * New York, Inc.
-	 */
-	[TestFixture]
-	public class ECPointTest
-	{
-		/**
-		 * Random source used to generate random points
-		 */
-		private SecureRandom secRand = new SecureRandom();
+    /**
+     * Test class for {@link org.bouncycastle.math.ec.ECPoint ECPoint}. All
+     * literature values are taken from "Guide to elliptic curve cryptography",
+     * Darrel Hankerson, Alfred J. Menezes, Scott Vanstone, 2004, Springer-Verlag
+     * New York, Inc.
+     */
+    [TestFixture]
+    public class ECPointTest
+    {
+        /**
+         * Random source used to generate random points
+         */
+        private SecureRandom secRand = new SecureRandom();
 
 //		private ECPointTest.Fp fp = null;
 
 //		private ECPointTest.F2m f2m = null;
 
-		/**
-		 * Nested class containing sample literature values for <code>Fp</code>.
-		 */
-		public class Fp
-		{
-			internal static readonly BigInteger q = new BigInteger("29");
-
-			internal static readonly BigInteger a = new BigInteger("4");
-
-			internal static readonly BigInteger b = new BigInteger("20");
-
-			internal static readonly FpCurve curve = new FpCurve(q, a, b);
-
-			internal static readonly FpPoint infinity = (FpPoint) curve.Infinity;
-
-			internal static readonly int[] pointSource = { 5, 22, 16, 27, 13, 6, 14, 6 };
-
-			internal static FpPoint[] p = new FpPoint[pointSource.Length / 2];
-
-			/**
-			 * Creates the points on the curve with literature values.
-			 */
-			internal static void createPoints()
-			{
-				for (int i = 0; i < pointSource.Length / 2; i++)
-				{
-					FpFieldElement x = new FpFieldElement(q, new BigInteger(
-						pointSource[2 * i].ToString()));
-					FpFieldElement y = new FpFieldElement(q, new BigInteger(
-						pointSource[2 * i + 1].ToString()));
-					p[i] = new FpPoint(curve, x, y);
-				}
-			}
-		}
-
-		/**
-		 * Nested class containing sample literature values for <code>F2m</code>.
-		 */
-		public class F2m
-		{
-			// Irreducible polynomial for TPB z^4 + z + 1
-			internal const int m = 4;
-
-			internal const int k1 = 1;
-
-			// a = z^3
-			internal static readonly F2mFieldElement aTpb = new F2mFieldElement(m, k1,
-				new BigInteger("8", 16));
-
-			// b = z^3 + 1
-			internal static readonly F2mFieldElement bTpb = new F2mFieldElement(m, k1,
-				new BigInteger("9", 16));
-
-			internal static readonly F2mCurve curve = new F2mCurve(m, k1, aTpb
-				.ToBigInteger(), bTpb.ToBigInteger());
-
-			internal static readonly F2mPoint infinity = (F2mPoint) curve.Infinity;
-
-			internal static readonly string[] pointSource = { "2", "f", "c", "c", "1", "1", "b", "2" };
-
-			internal static F2mPoint[] p = new F2mPoint[pointSource.Length / 2];
-
-			/**
-			 * Creates the points on the curve with literature values.
-			 */
-			internal static void createPoints()
-			{
-				for (int i = 0; i < pointSource.Length / 2; i++)
-				{
-					F2mFieldElement x = new F2mFieldElement(m, k1,
-						new BigInteger(pointSource[2 * i], 16));
-					F2mFieldElement y = new F2mFieldElement(m, k1,
-						new BigInteger(pointSource[2 * i + 1], 16));
-					p[i] = new F2mPoint(curve, x, y);
-				}
-			}
-		}
-
-		[SetUp]
-		public void setUp()
-		{
+        /**
+         * Nested class containing sample literature values for <code>Fp</code>.
+         */
+        public class Fp
+        {
+            internal static readonly BigInteger q = new BigInteger("29");
+
+            internal static readonly BigInteger a = new BigInteger("4");
+
+            internal static readonly BigInteger b = new BigInteger("20");
+
+            internal static readonly FpCurve curve = new FpCurve(q, a, b);
+
+            internal static readonly FpPoint infinity = (FpPoint) curve.Infinity;
+
+            internal static readonly int[] pointSource = { 5, 22, 16, 27, 13, 6, 14, 6 };
+
+            internal static ECPoint[] p = new ECPoint[pointSource.Length / 2];
+
+            /**
+             * Creates the points on the curve with literature values.
+             */
+            internal static void createPoints()
+            {
+                for (int i = 0; i < pointSource.Length / 2; i++)
+                {
+                    p[i] = curve.CreatePoint(
+                        new BigInteger(pointSource[2 * i].ToString()),
+                        new BigInteger(pointSource[2 * i + 1].ToString()), false);
+                }
+            }
+        }
+
+        /**
+         * Nested class containing sample literature values for <code>F2m</code>.
+         */
+        public class F2m
+        {
+            // Irreducible polynomial for TPB z^4 + z + 1
+            internal const int m = 4;
+
+            internal const int k1 = 1;
+
+            // a = z^3
+            internal static readonly F2mFieldElement aTpb = new F2mFieldElement(m, k1,
+                new BigInteger("8", 16));
+
+            // b = z^3 + 1
+            internal static readonly F2mFieldElement bTpb = new F2mFieldElement(m, k1,
+                new BigInteger("9", 16));
+
+            internal static readonly F2mCurve curve = new F2mCurve(m, k1, aTpb
+                .ToBigInteger(), bTpb.ToBigInteger());
+
+            internal static readonly F2mPoint infinity = (F2mPoint) curve.Infinity;
+
+            internal static readonly string[] pointSource = { "2", "f", "c", "c", "1", "1", "b", "2" };
+
+            internal static F2mPoint[] p = new F2mPoint[pointSource.Length / 2];
+
+            /**
+             * Creates the points on the curve with literature values.
+             */
+            internal static void createPoints()
+            {
+                for (int i = 0; i < pointSource.Length / 2; i++)
+                {
+                    F2mFieldElement x = new F2mFieldElement(m, k1,
+                        new BigInteger(pointSource[2 * i], 16));
+                    F2mFieldElement y = new F2mFieldElement(m, k1,
+                        new BigInteger(pointSource[2 * i + 1], 16));
+                    p[i] = new F2mPoint(curve, x, y);
+                }
+            }
+        }
+
+        [SetUp]
+        public void setUp()
+        {
 //			fp = new ECPointTest.Fp();
-			Fp.createPoints();
+            Fp.createPoints();
 
 //			f2m = new ECPointTest.F2m();
-			F2m.createPoints();
-		}
-
-		/**
-		 * Tests, if inconsistent points can be created, i.e. points with exactly
-		 * one null coordinate (not permitted).
-		 */
-		[Test]
-		public void TestPointCreationConsistency()
-		{
-			try
-			{
-				FpPoint bad = new FpPoint(Fp.curve, new FpFieldElement(
-					Fp.q, new BigInteger("12")), null);
-				Assert.Fail();
-			}
-			catch (ArgumentException)
-			{
-				// Expected
-			}
-
-			try
-			{
-				FpPoint bad = new FpPoint(Fp.curve, null,
-					new FpFieldElement(Fp.q, new BigInteger("12")));
-				Assert.Fail();
-			}
-			catch (ArgumentException)
-			{
-				// Expected
-			}
-
-			try
-			{
-				F2mPoint bad = new F2mPoint(F2m.curve, new F2mFieldElement(
-					F2m.m, F2m.k1, new BigInteger("1011")), null);
-				Assert.Fail();
-			}
-			catch (ArgumentException)
-			{
-				// Expected
-			}
-
-			try
-			{
-				F2mPoint bad = new F2mPoint(F2m.curve, null,
-					new F2mFieldElement(F2m.m, F2m.k1,
-					new BigInteger("1011")));
-				Assert.Fail();
-			}
-			catch (ArgumentException)
-			{
-				// Expected
-			}
-		}
-
-		/**
-		 * Tests <code>ECPoint.add()</code> against literature values.
-		 *
-		 * @param p
-		 *            The array of literature values.
-		 * @param infinity
-		 *            The point at infinity on the respective curve.
-		 */
-		private void implTestAdd(ECPoint[] p, ECPoint infinity)
-		{
-			Assert.AreEqual(p[2], p[0].Add(p[1]), "p0 plus p1 does not equal p2");
-			Assert.AreEqual(p[2], p[1].Add(p[0]), "p1 plus p0 does not equal p2");
-			for (int i = 0; i < p.Length; i++)
-			{
-				Assert.AreEqual(p[i], p[i].Add(infinity), "Adding infinity failed");
-				Assert.AreEqual(p[i], infinity.Add(p[i]), "Adding to infinity failed");
-			}
-		}
-
-		/**
-		 * Calls <code>implTestAdd()</code> for <code>Fp</code> and
-		 * <code>F2m</code>.
-		 */
-		[Test]
-		public void TestAdd()
-		{
-			implTestAdd(Fp.p, Fp.infinity);
-			implTestAdd(F2m.p, F2m.infinity);
-		}
-
-		/**
-		 * Tests <code>ECPoint.twice()</code> against literature values.
-		 *
-		 * @param p
-		 *            The array of literature values.
-		 */
-		private void implTestTwice(ECPoint[] p)
-		{
-			Assert.AreEqual(p[3], p[0].Twice(), "Twice incorrect");
-			Assert.AreEqual(p[3], p[0].Add(p[0]), "Add same point incorrect");
-		}
-
-		/**
-		 * Calls <code>implTestTwice()</code> for <code>Fp</code> and
-		 * <code>F2m</code>.
-		 */
-		[Test]
-		public void TestTwice()
-		{
-			implTestTwice(Fp.p);
-			implTestTwice(F2m.p);
-		}
-
-		/**
-		 * Goes through all points on an elliptic curve and checks, if adding a
-		 * point <code>k</code>-times is the same as multiplying the point by
-		 * <code>k</code>, for all <code>k</code>. Should be called for points
-		 * on very small elliptic curves only.
-		 *
-		 * @param p
-		 *            The base point on the elliptic curve.
-		 * @param infinity
-		 *            The point at infinity on the elliptic curve.
-		 */
-		private void implTestAllPoints(ECPoint p, ECPoint infinity)
-		{
-			ECPoint adder = infinity;
-			ECPoint multiplier = infinity;
-			int i = 1;
-			do
-			{
-				adder = adder.Add(p);
-				multiplier = p.Multiply(new BigInteger(i.ToString()));
-				Assert.AreEqual(adder, multiplier,
-					"Results of add() and multiply() are inconsistent " + i);
-				i++;
-			}
-			while (!(adder.Equals(infinity)));
-		}
-
-		/**
-		 * Calls <code>implTestAllPoints()</code> for the small literature curves,
-		 * both for <code>Fp</code> and <code>F2m</code>.
-		 */
-		[Test]
-		public void TestAllPoints()
-		{
-			for (int i = 0; i < Fp.p.Length; i++)
-			{
-				implTestAllPoints(Fp.p[0], Fp.infinity);
-			}
-
-			for (int i = 0; i < F2m.p.Length; i++)
-			{
-				implTestAllPoints(F2m.p[0], F2m.infinity);
-			}
-		}
-
-		/**
-		 * Simple shift-and-add multiplication. Serves as reference implementation
-		 * to verify (possibly faster) implementations in
-		 * {@link org.bouncycastle.math.ec.ECPoint ECPoint}.
-		 *
-		 * @param p
-		 *            The point to multiply.
-		 * @param k
-		 *            The multiplier.
-		 * @return The result of the point multiplication <code>kP</code>.
-		 */
-		private ECPoint multiply(ECPoint p, BigInteger k)
-		{
-			ECPoint q = p.Curve.Infinity;
-			int t = k.BitLength;
-			for (int i = 0; i < t; i++)
-			{
-				if (k.TestBit(i))
-				{
-					q = q.Add(p);
-				}
-				p = p.Twice();
-			}
-			return q;
-		}
-
-		/**
-		 * Checks, if the point multiplication algorithm of the given point yields
-		 * the same result as point multiplication done by the reference
-		 * implementation given in <code>multiply()</code>. This method chooses a
-		 * random number by which the given point <code>p</code> is multiplied.
-		 *
-		 * @param p
-		 *            The point to be multiplied.
-		 * @param numBits
-		 *            The bitlength of the random number by which <code>p</code>
-		 *            is multiplied.
-		 */
-		private void implTestMultiply(ECPoint p, int numBits)
-		{
-			BigInteger k = new BigInteger(numBits, secRand);
-			ECPoint reff = multiply(p, k);
-			ECPoint q = p.Multiply(k);
-			Assert.AreEqual(reff, q, "ECPoint.multiply is incorrect");
-		}
-
-		/**
-		 * Checks, if the point multiplication algorithm of the given point yields
-		 * the same result as point multiplication done by the reference
-		 * implementation given in <code>multiply()</code>. This method tests
-		 * multiplication of <code>p</code> by every number of bitlength
-		 * <code>numBits</code> or less.
-		 *
-		 * @param p
-		 *            The point to be multiplied.
-		 * @param numBits
-		 *            Try every multiplier up to this bitlength
-		 */
-		private void implTestMultiplyAll(ECPoint p, int numBits)
-		{
-			BigInteger bound = BigInteger.Two.Pow(numBits);
-			BigInteger k = BigInteger.Zero;
-
-			do
-			{
-				ECPoint reff = multiply(p, k);
-				ECPoint q = p.Multiply(k);
-				Assert.AreEqual(reff, q, "ECPoint.multiply is incorrect");
-				k = k.Add(BigInteger.One);
-			}
-			while (k.CompareTo(bound) < 0);
-		}
-
-		/**
-		 * Tests <code>ECPoint.add()</code> and <code>ECPoint.subtract()</code>
-		 * for the given point and the given point at infinity.
-		 *
-		 * @param p
-		 *            The point on which the tests are performed.
-		 * @param infinity
-		 *            The point at infinity on the same curve as <code>p</code>.
-		 */
-		private void implTestAddSubtract(ECPoint p, ECPoint infinity)
-		{
-			Assert.AreEqual(p.Twice(), p.Add(p), "Twice and Add inconsistent");
-			Assert.AreEqual(p, p.Twice().Subtract(p), "Twice p - p is not p");
-			Assert.AreEqual(infinity, p.Subtract(p), "p - p is not infinity");
-			Assert.AreEqual(p, p.Add(infinity), "p plus infinity is not p");
-			Assert.AreEqual(p, infinity.Add(p), "infinity plus p is not p");
-			Assert.AreEqual(infinity, infinity.Add(infinity), "infinity plus infinity is not infinity ");
-		}
-
-		/**
-		 * Calls <code>implTestAddSubtract()</code> for literature values, both
-		 * for <code>Fp</code> and <code>F2m</code>.
-		 */
-		[Test]
-		public void TestAddSubtractMultiplySimple()
-		{
-			for (int iFp = 0; iFp < Fp.pointSource.Length / 2; iFp++)
-			{
-				implTestAddSubtract(Fp.p[iFp], Fp.infinity);
-
-				// Could be any numBits, 6 is chosen at will
-				implTestMultiplyAll(Fp.p[iFp], 6);
-				implTestMultiplyAll(Fp.infinity, 6);
-			}
-
-			for (int iF2m = 0; iF2m < F2m.pointSource.Length / 2; iF2m++)
-			{
-				implTestAddSubtract(F2m.p[iF2m], F2m.infinity);
-
-				// Could be any numBits, 6 is chosen at will
-				implTestMultiplyAll(F2m.p[iF2m], 6);
-				implTestMultiplyAll(F2m.infinity, 6);
-			}
-		}
-
-		/**
-		 * Test encoding with and without point compression.
-		 *
-		 * @param p
-		 *            The point to be encoded and decoded.
-		 */
-		private void implTestEncoding(ECPoint p)
-		{
-			// Not Point Compression
-			ECPoint unCompP;
-
-			// Point compression
-			ECPoint compP;
-
-			if (p is FpPoint)
-			{
-				unCompP = new FpPoint(p.Curve, p.X, p.Y, false);
-				compP = new FpPoint(p.Curve, p.X, p.Y, true);
-			}
-			else
-			{
-				unCompP = new F2mPoint(p.Curve, p.X, p.Y, false);
-				compP = new F2mPoint(p.Curve, p.X, p.Y, true);
-			}
-
-			byte[] unCompBarr = unCompP.GetEncoded();
-			ECPoint decUnComp = p.Curve.DecodePoint(unCompBarr);
-			Assert.AreEqual(p, decUnComp, "Error decoding uncompressed point");
-
-			byte[] compBarr = compP.GetEncoded();
-			ECPoint decComp = p.Curve.DecodePoint(compBarr);
-			Assert.AreEqual(p, decComp, "Error decoding compressed point");
-		}
-
-		/**
-		 * Calls <code>implTestAddSubtract()</code>,
-		 * <code>implTestMultiply</code> and <code>implTestEncoding</code> for
-		 * the standard elliptic curves as given in <code>SecNamedCurves</code>.
-		 */
-		[Test]
-		public void TestAddSubtractMultiplyTwiceEncoding()
-		{
-			foreach (string name in SecNamedCurves.Names)
-			{
-				X9ECParameters x9ECParameters = SecNamedCurves.GetByName(name);
-
-				BigInteger n = x9ECParameters.N;
-
-				// The generator is multiplied by random b to get random q
-				BigInteger b = new BigInteger(n.BitLength, secRand);
-				ECPoint g = x9ECParameters.G;
-				ECPoint q = g.Multiply(b);
-
-				// Get point at infinity on the curve
-				ECPoint infinity = x9ECParameters.Curve.Infinity;
-
-				implTestAddSubtract(q, infinity);
-				implTestMultiply(q, n.BitLength);
-				implTestMultiply(infinity, n.BitLength);
-				implTestEncoding(q);
-			}
-		}
-	}
+            F2m.createPoints();
+        }
+
+        /**
+         * Tests, if inconsistent points can be created, i.e. points with exactly
+         * one null coordinate (not permitted).
+         */
+        [Test]
+        public void TestPointCreationConsistency()
+        {
+            try
+            {
+                FpPoint bad = new FpPoint(Fp.curve, new FpFieldElement(
+                    Fp.q, new BigInteger("12")), null);
+                Assert.Fail();
+            }
+            catch (ArgumentException)
+            {
+                // Expected
+            }
+
+            try
+            {
+                FpPoint bad = new FpPoint(Fp.curve, null,
+                    new FpFieldElement(Fp.q, new BigInteger("12")));
+                Assert.Fail();
+            }
+            catch (ArgumentException)
+            {
+                // Expected
+            }
+
+            try
+            {
+                F2mPoint bad = new F2mPoint(F2m.curve, new F2mFieldElement(
+                    F2m.m, F2m.k1, new BigInteger("1011")), null);
+                Assert.Fail();
+            }
+            catch (ArgumentException)
+            {
+                // Expected
+            }
+
+            try
+            {
+                F2mPoint bad = new F2mPoint(F2m.curve, null,
+                    new F2mFieldElement(F2m.m, F2m.k1,
+                    new BigInteger("1011")));
+                Assert.Fail();
+            }
+            catch (ArgumentException)
+            {
+                // Expected
+            }
+        }
+
+        /**
+         * Tests <code>ECPoint.add()</code> against literature values.
+         *
+         * @param p
+         *            The array of literature values.
+         * @param infinity
+         *            The point at infinity on the respective curve.
+         */
+        private void implTestAdd(ECPoint[] p, ECPoint infinity)
+        {
+            Assert.AreEqual(p[2], p[0].Add(p[1]), "p0 plus p1 does not equal p2");
+            Assert.AreEqual(p[2], p[1].Add(p[0]), "p1 plus p0 does not equal p2");
+            for (int i = 0; i < p.Length; i++)
+            {
+                Assert.AreEqual(p[i], p[i].Add(infinity), "Adding infinity failed");
+                Assert.AreEqual(p[i], infinity.Add(p[i]), "Adding to infinity failed");
+            }
+        }
+
+        /**
+         * Calls <code>implTestAdd()</code> for <code>Fp</code> and
+         * <code>F2m</code>.
+         */
+        [Test]
+        public void TestAdd()
+        {
+            implTestAdd(Fp.p, Fp.infinity);
+            implTestAdd(F2m.p, F2m.infinity);
+        }
+
+        /**
+         * Tests <code>ECPoint.twice()</code> against literature values.
+         *
+         * @param p
+         *            The array of literature values.
+         */
+        private void implTestTwice(ECPoint[] p)
+        {
+            Assert.AreEqual(p[3], p[0].Twice(), "Twice incorrect");
+            Assert.AreEqual(p[3], p[0].Add(p[0]), "Add same point incorrect");
+        }
+
+        /**
+         * Calls <code>implTestTwice()</code> for <code>Fp</code> and
+         * <code>F2m</code>.
+         */
+        [Test]
+        public void TestTwice()
+        {
+            implTestTwice(Fp.p);
+            implTestTwice(F2m.p);
+        }
+
+        /**
+         * Goes through all points on an elliptic curve and checks, if adding a
+         * point <code>k</code>-times is the same as multiplying the point by
+         * <code>k</code>, for all <code>k</code>. Should be called for points
+         * on very small elliptic curves only.
+         *
+         * @param p
+         *            The base point on the elliptic curve.
+         * @param infinity
+         *            The point at infinity on the elliptic curve.
+         */
+        private void implTestAllPoints(ECPoint p, ECPoint infinity)
+        {
+            ECPoint adder = infinity;
+            ECPoint multiplier = infinity;
+            int i = 1;
+            do
+            {
+                adder = adder.Add(p);
+                multiplier = p.Multiply(new BigInteger(i.ToString()));
+                Assert.AreEqual(adder, multiplier,
+                    "Results of add() and multiply() are inconsistent " + i);
+                i++;
+            }
+            while (!(adder.Equals(infinity)));
+        }
+
+        /**
+         * Calls <code>implTestAllPoints()</code> for the small literature curves,
+         * both for <code>Fp</code> and <code>F2m</code>.
+         */
+        [Test]
+        public void TestAllPoints()
+        {
+            for (int i = 0; i < Fp.p.Length; i++)
+            {
+                implTestAllPoints(Fp.p[0], Fp.infinity);
+            }
+
+            for (int i = 0; i < F2m.p.Length; i++)
+            {
+                implTestAllPoints(F2m.p[0], F2m.infinity);
+            }
+        }
+
+        /**
+         * Simple shift-and-add multiplication. Serves as reference implementation
+         * to verify (possibly faster) implementations in
+         * {@link org.bouncycastle.math.ec.ECPoint ECPoint}.
+         *
+         * @param p
+         *            The point to multiply.
+         * @param k
+         *            The multiplier.
+         * @return The result of the point multiplication <code>kP</code>.
+         */
+        private ECPoint multiply(ECPoint p, BigInteger k)
+        {
+            ECPoint q = p.Curve.Infinity;
+            int t = k.BitLength;
+            for (int i = 0; i < t; i++)
+            {
+                if (k.TestBit(i))
+                {
+                    q = q.Add(p);
+                }
+                p = p.Twice();
+            }
+            return q;
+        }
+
+        /**
+         * Checks, if the point multiplication algorithm of the given point yields
+         * the same result as point multiplication done by the reference
+         * implementation given in <code>multiply()</code>. This method chooses a
+         * random number by which the given point <code>p</code> is multiplied.
+         *
+         * @param p
+         *            The point to be multiplied.
+         * @param numBits
+         *            The bitlength of the random number by which <code>p</code>
+         *            is multiplied.
+         */
+        private void implTestMultiply(ECPoint p, int numBits)
+        {
+            BigInteger k = new BigInteger(numBits, secRand);
+            ECPoint reff = multiply(p, k);
+            ECPoint q = p.Multiply(k);
+            Assert.AreEqual(reff, q, "ECPoint.multiply is incorrect");
+        }
+
+        /**
+         * Checks, if the point multiplication algorithm of the given point yields
+         * the same result as point multiplication done by the reference
+         * implementation given in <code>multiply()</code>. This method tests
+         * multiplication of <code>p</code> by every number of bitlength
+         * <code>numBits</code> or less.
+         *
+         * @param p
+         *            The point to be multiplied.
+         * @param numBits
+         *            Try every multiplier up to this bitlength
+         */
+        private void implTestMultiplyAll(ECPoint p, int numBits)
+        {
+            BigInteger bound = BigInteger.Two.Pow(numBits);
+            BigInteger k = BigInteger.Zero;
+
+            do
+            {
+                ECPoint reff = multiply(p, k);
+                ECPoint q = p.Multiply(k);
+                Assert.AreEqual(reff, q, "ECPoint.multiply is incorrect");
+                k = k.Add(BigInteger.One);
+            }
+            while (k.CompareTo(bound) < 0);
+        }
+
+        /**
+         * Tests <code>ECPoint.add()</code> and <code>ECPoint.subtract()</code>
+         * for the given point and the given point at infinity.
+         *
+         * @param p
+         *            The point on which the tests are performed.
+         * @param infinity
+         *            The point at infinity on the same curve as <code>p</code>.
+         */
+        private void implTestAddSubtract(ECPoint p, ECPoint infinity)
+        {
+            Assert.AreEqual(p.Twice(), p.Add(p), "Twice and Add inconsistent");
+            Assert.AreEqual(p, p.Twice().Subtract(p), "Twice p - p is not p");
+            Assert.AreEqual(infinity, p.Subtract(p), "p - p is not infinity");
+            Assert.AreEqual(p, p.Add(infinity), "p plus infinity is not p");
+            Assert.AreEqual(p, infinity.Add(p), "infinity plus p is not p");
+            Assert.AreEqual(infinity, infinity.Add(infinity), "infinity plus infinity is not infinity ");
+        }
+
+        /**
+         * Calls <code>implTestAddSubtract()</code> for literature values, both
+         * for <code>Fp</code> and <code>F2m</code>.
+         */
+        [Test]
+        public void TestAddSubtractMultiplySimple()
+        {
+            for (int iFp = 0; iFp < Fp.pointSource.Length / 2; iFp++)
+            {
+                implTestAddSubtract(Fp.p[iFp], Fp.infinity);
+
+                // Could be any numBits, 6 is chosen at will
+                implTestMultiplyAll(Fp.p[iFp], 6);
+                implTestMultiplyAll(Fp.infinity, 6);
+            }
+
+            for (int iF2m = 0; iF2m < F2m.pointSource.Length / 2; iF2m++)
+            {
+                implTestAddSubtract(F2m.p[iF2m], F2m.infinity);
+
+                // Could be any numBits, 6 is chosen at will
+                implTestMultiplyAll(F2m.p[iF2m], 6);
+                implTestMultiplyAll(F2m.infinity, 6);
+            }
+        }
+
+        /**
+         * Test encoding with and without point compression.
+         *
+         * @param p
+         *            The point to be encoded and decoded.
+         */
+        private void implTestEncoding(ECPoint p)
+        {
+            // Not Point Compression
+            ECPoint unCompP;
+
+            // Point compression
+            ECPoint compP;
+
+            if (p is FpPoint)
+            {
+                unCompP = new FpPoint(p.Curve, p.X, p.Y, false);
+                compP = new FpPoint(p.Curve, p.X, p.Y, true);
+            }
+            else
+            {
+                unCompP = new F2mPoint(p.Curve, p.X, p.Y, false);
+                compP = new F2mPoint(p.Curve, p.X, p.Y, true);
+            }
+
+            byte[] unCompBarr = unCompP.GetEncoded();
+            ECPoint decUnComp = p.Curve.DecodePoint(unCompBarr);
+            Assert.AreEqual(p, decUnComp, "Error decoding uncompressed point");
+
+            byte[] compBarr = compP.GetEncoded();
+            ECPoint decComp = p.Curve.DecodePoint(compBarr);
+            Assert.AreEqual(p, decComp, "Error decoding compressed point");
+        }
+
+        /**
+         * Calls <code>implTestAddSubtract()</code>,
+         * <code>implTestMultiply</code> and <code>implTestEncoding</code> for
+         * the standard elliptic curves as given in <code>SecNamedCurves</code>.
+         */
+        [Test]
+        public void TestAddSubtractMultiplyTwiceEncoding()
+        {
+            foreach (string name in SecNamedCurves.Names)
+            {
+                X9ECParameters x9ECParameters = SecNamedCurves.GetByName(name);
+
+                BigInteger n = x9ECParameters.N;
+
+                // The generator is multiplied by random b to get random q
+                BigInteger b = new BigInteger(n.BitLength, secRand);
+                ECPoint g = x9ECParameters.G;
+                ECPoint q = g.Multiply(b);
+
+                // Get point at infinity on the curve
+                ECPoint infinity = x9ECParameters.Curve.Infinity;
+
+                implTestAddSubtract(q, infinity);
+                implTestMultiply(q, n.BitLength);
+                implTestMultiply(infinity, n.BitLength);
+                implTestEncoding(q);
+            }
+        }
+    }
 }
\ No newline at end of file
diff --git a/crypto/test/src/openpgp/test/PGPRSATest.cs b/crypto/test/src/openpgp/test/PGPRSATest.cs
index f38aa002f..35f844483 100644
--- a/crypto/test/src/openpgp/test/PGPRSATest.cs
+++ b/crypto/test/src/openpgp/test/PGPRSATest.cs
@@ -22,121 +22,121 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
     public class PgpRsaTest
         : SimpleTest
     {
-		private static readonly byte[] testPubKey = Base64.Decode(
-			  "mIsEPz2nJAEEAOTVqWMvqYE693qTgzKv/TJpIj3hI8LlYPC6m1dk0z3bDLwVVk9F"
-			+ "FAB+CWS8RdFOWt/FG3tEv2nzcoNdRvjv9WALyIGNawtae4Ml6oAT06/511yUzXHO"
-			+ "k+9xK3wkXN5jdzUhf4cA2oGpLSV/pZlocsIDL+jCUQtumUPwFodmSHhzAAYptC9F"
-			+ "cmljIEVjaGlkbmEgKHRlc3Qga2V5KSA8ZXJpY0Bib3VuY3ljYXN0bGUub3JnPoi4"
-			+ "BBMBAgAiBQI/PackAhsDBQkAg9YABAsHAwIDFQIDAxYCAQIeAQIXgAAKCRA1WGFG"
-			+ "/fPzc8WMA/9BbjuB8E48QAlxoiVf9U8SfNelrz/ONJA/bMvWr/JnOGA9PPmFD5Uc"
-			+ "+kV/q+i94dEMjsC5CQ1moUHWSP2xlQhbOzBP2+oPXw3z2fBs9XJgnTH6QWMAAvLs"
-			+ "3ug9po0loNHLobT/D/XdXvcrb3wvwvPT2FptZqrtonH/OdzT9JdfrA==");
-
-		private static readonly byte[] testPrivKey = Base64.Decode(
-			  "lQH8BD89pyQBBADk1aljL6mBOvd6k4Myr/0yaSI94SPC5WDwuptXZNM92wy8FVZP"
-			+ "RRQAfglkvEXRTlrfxRt7RL9p83KDXUb47/VgC8iBjWsLWnuDJeqAE9Ov+ddclM1x"
-			+ "zpPvcSt8JFzeY3c1IX+HANqBqS0lf6WZaHLCAy/owlELbplD8BaHZkh4cwAGKf4D"
-			+ "AwKbLeIOVYTEdWD5v/YgW8ERs0pDsSIfBTvsJp2qA798KeFuED6jGsHUzdi1M990"
-			+ "6PRtplQgnoYmYQrzEc6DXAiAtBR4Kuxi4XHx0ZR2wpVlVxm2Ypgz7pbBNWcWqzvw"
-			+ "33inl7tR4IDsRdJOY8cFlN+1tSCf16sDidtKXUVjRjZNYJytH18VfSPlGXMeYgtw"
-			+ "3cSGNTERwKaq5E/SozT2MKTiORO0g0Mtyz+9MEB6XVXFavMun/mXURqbZN/k9BFb"
-			+ "z+TadpkihrLD1xw3Hp+tpe4CwPQ2GdWKI9KNo5gEnbkJgLrSMGgWalPhknlNHRyY"
-			+ "bSq6lbIMJEE3LoOwvYWwweR1+GrV9farJESdunl1mDr5/d6rKru+FFDwZM3na1IF"
-			+ "4Ei4FpqhivZ4zG6pN5XqLy+AK85EiW4XH0yAKX1O4YlbmDU4BjxhiwTdwuVMCjLO"
-			+ "5++jkz5BBQWdFX8CCMA4FJl36G70IbGzuFfOj07ly7QvRXJpYyBFY2hpZG5hICh0"
-			+ "ZXN0IGtleSkgPGVyaWNAYm91bmN5Y2FzdGxlLm9yZz6IuAQTAQIAIgUCPz2nJAIb"
-			+ "AwUJAIPWAAQLBwMCAxUCAwMWAgECHgECF4AACgkQNVhhRv3z83PFjAP/QW47gfBO"
-			+ "PEAJcaIlX/VPEnzXpa8/zjSQP2zL1q/yZzhgPTz5hQ+VHPpFf6voveHRDI7AuQkN"
-			+ "ZqFB1kj9sZUIWzswT9vqD18N89nwbPVyYJ0x+kFjAALy7N7oPaaNJaDRy6G0/w/1"
-			+ "3V73K298L8Lz09habWaq7aJx/znc0/SXX6w=");
-
-		private static readonly byte[] testPubKeyV3 = Base64.Decode(
-			  "mQCNAz+zvlEAAAEEAMS22jgXbOZ/D3xWgM2kauSdzrwlU7Ms5hDW05ObqQyO"
-			+ "FfQoKKMhfupyoa7J3x04VVBKu6Eomvr1es+VImH0esoeWFFahNOYq/I+jRRB"
-			+ "woOhAGZ5UB2/hRd7rFmxqp6sCXi8wmLO2tAorlTzAiNNvl7xF4cQZpc0z56F"
-			+ "wdi2fBUJAAURtApGSVhDSVRZX1FBiQCVAwUQP7O+UZ6Fwdi2fBUJAQFMwwQA"
-			+ "qRnFsdg4xQnB8Y5d4cOpXkIn9AZgYS3cxtuSJB84vG2CgC39nfv4c+nlLkWP"
-			+ "4puG+mZuJNgVoE84cuAF4I//1anKjlU7q1M6rFQnt5S4uxPyG3dFXmgyU1b4"
-			+ "PBOnA0tIxjPzlIhJAMsPCGGA5+5M2JP0ad6RnzqzE3EENMX+GqY=");
-
-		private static readonly byte[] testPrivKeyV3 = Base64.Decode(
-			  "lQHfAz+zvlEAAAEEAMS22jgXbOZ/D3xWgM2kauSdzrwlU7Ms5hDW05ObqQyO"
-			+ "FfQoKKMhfupyoa7J3x04VVBKu6Eomvr1es+VImH0esoeWFFahNOYq/I+jRRB"
-			+ "woOhAGZ5UB2/hRd7rFmxqp6sCXi8wmLO2tAorlTzAiNNvl7xF4cQZpc0z56F"
-			+ "wdi2fBUJAAURAXWwRBZQHNikA/f0ScLLjrXi4s0hgQecg+dkpDow94eu5+AR"
-			+ "0DzZnfurpgfUJCNiDi5W/5c3Zj/xyrfMAgkbCgJ1m6FZqAQh7Mq73l7Kfu4/"
-			+ "XIkyDF3tDgRuZNezB+JuElX10tV03xumHepp6M6CfhXqNJ15F33F99TA5hXY"
-			+ "CPYD7SiSOpIhQkCOAgDAA63imxbpuKE2W7Y4I1BUHB7WQi8ZdkZd04njNTv+"
-			+ "rFUuOPapQVfbWG0Vq8ld3YmJB4QWsa2mmqn+qToXbwufAgBpXkjvqK5yPiHF"
-			+ "Px2QbFc1VqoCJB6PO5JRIqEiUZBFGdDlLxt3VSyqz7IZ/zEnxZq+tPCGGGSm"
-			+ "/sAGiMvENcHVAfy0kTXU42TxEAYJyyNyqjXOobDJpEV1mKhFskRXt7tbMfOS"
-			+ "Yf91oX8f6xw6O2Nal+hU8dS0Bmfmk5/enHmvRLHQocO0CkZJWENJVFlfUUE=");
-
-		private static readonly byte[] sig1 = Base64.Decode(
-			  "owGbwMvMwMRoGpHo9vfz52LGNTJJnBmpOTn5eiUVJfb23JvAHIXy/KKcFEWuToap"
-			+ "zKwMIGG4Bqav0SwMy3yParsEKi2LMGI9xhh65sBxb05n5++ZLcWNJ/eLFKdWbm95"
-			+ "tHbDV7GMwj/tUctUpFUXWPYFCLdNsDiVNuXbQvZtdXV/5xzY+9w1nCnijH9JoNiJ"
-			+ "22n2jo0zo30/TZLo+jDl2vTzIvPeLEsPM3ZUE/1Ytqs4SG2TxIQbH7xf3uzcYXq2"
-			+ "5Fw9AA==");
+        private static readonly byte[] testPubKey = Base64.Decode(
+              "mIsEPz2nJAEEAOTVqWMvqYE693qTgzKv/TJpIj3hI8LlYPC6m1dk0z3bDLwVVk9F"
+            + "FAB+CWS8RdFOWt/FG3tEv2nzcoNdRvjv9WALyIGNawtae4Ml6oAT06/511yUzXHO"
+            + "k+9xK3wkXN5jdzUhf4cA2oGpLSV/pZlocsIDL+jCUQtumUPwFodmSHhzAAYptC9F"
+            + "cmljIEVjaGlkbmEgKHRlc3Qga2V5KSA8ZXJpY0Bib3VuY3ljYXN0bGUub3JnPoi4"
+            + "BBMBAgAiBQI/PackAhsDBQkAg9YABAsHAwIDFQIDAxYCAQIeAQIXgAAKCRA1WGFG"
+            + "/fPzc8WMA/9BbjuB8E48QAlxoiVf9U8SfNelrz/ONJA/bMvWr/JnOGA9PPmFD5Uc"
+            + "+kV/q+i94dEMjsC5CQ1moUHWSP2xlQhbOzBP2+oPXw3z2fBs9XJgnTH6QWMAAvLs"
+            + "3ug9po0loNHLobT/D/XdXvcrb3wvwvPT2FptZqrtonH/OdzT9JdfrA==");
+
+        private static readonly byte[] testPrivKey = Base64.Decode(
+              "lQH8BD89pyQBBADk1aljL6mBOvd6k4Myr/0yaSI94SPC5WDwuptXZNM92wy8FVZP"
+            + "RRQAfglkvEXRTlrfxRt7RL9p83KDXUb47/VgC8iBjWsLWnuDJeqAE9Ov+ddclM1x"
+            + "zpPvcSt8JFzeY3c1IX+HANqBqS0lf6WZaHLCAy/owlELbplD8BaHZkh4cwAGKf4D"
+            + "AwKbLeIOVYTEdWD5v/YgW8ERs0pDsSIfBTvsJp2qA798KeFuED6jGsHUzdi1M990"
+            + "6PRtplQgnoYmYQrzEc6DXAiAtBR4Kuxi4XHx0ZR2wpVlVxm2Ypgz7pbBNWcWqzvw"
+            + "33inl7tR4IDsRdJOY8cFlN+1tSCf16sDidtKXUVjRjZNYJytH18VfSPlGXMeYgtw"
+            + "3cSGNTERwKaq5E/SozT2MKTiORO0g0Mtyz+9MEB6XVXFavMun/mXURqbZN/k9BFb"
+            + "z+TadpkihrLD1xw3Hp+tpe4CwPQ2GdWKI9KNo5gEnbkJgLrSMGgWalPhknlNHRyY"
+            + "bSq6lbIMJEE3LoOwvYWwweR1+GrV9farJESdunl1mDr5/d6rKru+FFDwZM3na1IF"
+            + "4Ei4FpqhivZ4zG6pN5XqLy+AK85EiW4XH0yAKX1O4YlbmDU4BjxhiwTdwuVMCjLO"
+            + "5++jkz5BBQWdFX8CCMA4FJl36G70IbGzuFfOj07ly7QvRXJpYyBFY2hpZG5hICh0"
+            + "ZXN0IGtleSkgPGVyaWNAYm91bmN5Y2FzdGxlLm9yZz6IuAQTAQIAIgUCPz2nJAIb"
+            + "AwUJAIPWAAQLBwMCAxUCAwMWAgECHgECF4AACgkQNVhhRv3z83PFjAP/QW47gfBO"
+            + "PEAJcaIlX/VPEnzXpa8/zjSQP2zL1q/yZzhgPTz5hQ+VHPpFf6voveHRDI7AuQkN"
+            + "ZqFB1kj9sZUIWzswT9vqD18N89nwbPVyYJ0x+kFjAALy7N7oPaaNJaDRy6G0/w/1"
+            + "3V73K298L8Lz09habWaq7aJx/znc0/SXX6w=");
+
+        private static readonly byte[] testPubKeyV3 = Base64.Decode(
+              "mQCNAz+zvlEAAAEEAMS22jgXbOZ/D3xWgM2kauSdzrwlU7Ms5hDW05ObqQyO"
+            + "FfQoKKMhfupyoa7J3x04VVBKu6Eomvr1es+VImH0esoeWFFahNOYq/I+jRRB"
+            + "woOhAGZ5UB2/hRd7rFmxqp6sCXi8wmLO2tAorlTzAiNNvl7xF4cQZpc0z56F"
+            + "wdi2fBUJAAURtApGSVhDSVRZX1FBiQCVAwUQP7O+UZ6Fwdi2fBUJAQFMwwQA"
+            + "qRnFsdg4xQnB8Y5d4cOpXkIn9AZgYS3cxtuSJB84vG2CgC39nfv4c+nlLkWP"
+            + "4puG+mZuJNgVoE84cuAF4I//1anKjlU7q1M6rFQnt5S4uxPyG3dFXmgyU1b4"
+            + "PBOnA0tIxjPzlIhJAMsPCGGA5+5M2JP0ad6RnzqzE3EENMX+GqY=");
+
+        private static readonly byte[] testPrivKeyV3 = Base64.Decode(
+              "lQHfAz+zvlEAAAEEAMS22jgXbOZ/D3xWgM2kauSdzrwlU7Ms5hDW05ObqQyO"
+            + "FfQoKKMhfupyoa7J3x04VVBKu6Eomvr1es+VImH0esoeWFFahNOYq/I+jRRB"
+            + "woOhAGZ5UB2/hRd7rFmxqp6sCXi8wmLO2tAorlTzAiNNvl7xF4cQZpc0z56F"
+            + "wdi2fBUJAAURAXWwRBZQHNikA/f0ScLLjrXi4s0hgQecg+dkpDow94eu5+AR"
+            + "0DzZnfurpgfUJCNiDi5W/5c3Zj/xyrfMAgkbCgJ1m6FZqAQh7Mq73l7Kfu4/"
+            + "XIkyDF3tDgRuZNezB+JuElX10tV03xumHepp6M6CfhXqNJ15F33F99TA5hXY"
+            + "CPYD7SiSOpIhQkCOAgDAA63imxbpuKE2W7Y4I1BUHB7WQi8ZdkZd04njNTv+"
+            + "rFUuOPapQVfbWG0Vq8ld3YmJB4QWsa2mmqn+qToXbwufAgBpXkjvqK5yPiHF"
+            + "Px2QbFc1VqoCJB6PO5JRIqEiUZBFGdDlLxt3VSyqz7IZ/zEnxZq+tPCGGGSm"
+            + "/sAGiMvENcHVAfy0kTXU42TxEAYJyyNyqjXOobDJpEV1mKhFskRXt7tbMfOS"
+            + "Yf91oX8f6xw6O2Nal+hU8dS0Bmfmk5/enHmvRLHQocO0CkZJWENJVFlfUUE=");
+
+        private static readonly byte[] sig1 = Base64.Decode(
+              "owGbwMvMwMRoGpHo9vfz52LGNTJJnBmpOTn5eiUVJfb23JvAHIXy/KKcFEWuToap"
+            + "zKwMIGG4Bqav0SwMy3yParsEKi2LMGI9xhh65sBxb05n5++ZLcWNJ/eLFKdWbm95"
+            + "tHbDV7GMwj/tUctUpFUXWPYFCLdNsDiVNuXbQvZtdXV/5xzY+9w1nCnijH9JoNiJ"
+            + "22n2jo0zo30/TZLo+jDl2vTzIvPeLEsPM3ZUE/1Ytqs4SG2TxIQbH7xf3uzcYXq2"
+            + "5Fw9AA==");
 
 //		private static readonly byte[] sig1crc = Base64.Decode("+3i0");
 
-		private static readonly byte[] subKey = Base64.Decode(
-			  "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"
-			+ "CphiUYWnsC0mQ+J15B4=");
-
-		private static readonly byte[] enc1 = Base64.Decode(
-			  "hIwDKwfQexPJboABA/4/7prhYYMORTiQ5avQKx0XYpCLujzGefYjnyuWZnx3Iev8"
-			+ "Pmsguumm+OLLvtXhhkXQmkJRXbIg6Otj2ubPYWflRPgpJSgOrNOreOl5jeABOrtw"
-			+ "bV6TJb9OTtZuB7cTQSCq2gmYiSZkluIiDjNs3R3mEanILbYzOQ3zKSggKpzlv9JQ"
-			+ "AZUqTyDyJ6/OUbJF5fI5uiv76DCsw1zyMWotUIu5/X01q+AVP5Ly3STzI7xkWg/J"
-			+ "APz4zUHism7kSYz2viAQaJx9/bNnH3AM6qm1Fuyikl4=");
+        private static readonly byte[] subKey = Base64.Decode(
+              "lQH8BD89pyQBBADk1aljL6mBOvd6k4Myr/0yaSI94SPC5WDwuptXZNM92wy8FVZP"
+            + "RRQAfglkvEXRTlrfxRt7RL9p83KDXUb47/VgC8iBjWsLWnuDJeqAE9Ov+ddclM1x"
+            + "zpPvcSt8JFzeY3c1IX+HANqBqS0lf6WZaHLCAy/owlELbplD8BaHZkh4cwAGKf4D"
+            + "AwKt6ZC7iqsQHGDNn2ZAuhS+ZwiFC+BToW9Vq6rwggWjgM/SThv55rfDk7keiXUT"
+            + "MyUcZVeYBe4Jttb4fAAm83hNztFu6Jvm9ITcm7YvnasBtVQjppaB+oYZgsTtwK99"
+            + "LGC3mdexnriCLxPN6tDFkGhzdOcYZfK6py4Ska8Dmq9nOZU9Qtv7Pm3qa5tuBvYw"
+            + "myTxeaJYifZTu/sky3Gj+REb8WonbgAJX/sLNBPUt+vYko+lxU8uqZpVEMU//hGG"
+            + "Rns2gIHdbSbIe1vGgIRUEd7Z0b7jfVQLUwqHDyfh5DGvAUhvtJogjUyFIXZzpU+E"
+            + "9ES9t7LZKdwNZSIdNUjM2eaf4g8BpuQobBVkj/GUcotKyeBjwvKxHlRefL4CCw28"
+            + "DO3SnLRKxd7uBSqeOGUKxqasgdekM/xIFOrJ85k7p89n6ncLQLHCPGVkzmVeRZro"
+            + "/T7zE91J57qBGZOUAP1vllcYLty1cs9PCc5oWnj3XbQvRXJpYyBFY2hpZG5hICh0"
+            + "ZXN0IGtleSkgPGVyaWNAYm91bmN5Y2FzdGxlLm9yZz6IuAQTAQIAIgUCPz2nJAIb"
+            + "AwUJAIPWAAQLBwMCAxUCAwMWAgECHgECF4AACgkQNVhhRv3z83PFjAP/QW47gfBO"
+            + "PEAJcaIlX/VPEnzXpa8/zjSQP2zL1q/yZzhgPTz5hQ+VHPpFf6voveHRDI7AuQkN"
+            + "ZqFB1kj9sZUIWzswT9vqD18N89nwbPVyYJ0x+kFjAALy7N7oPaaNJaDRy6G0/w/1"
+            + "3V73K298L8Lz09habWaq7aJx/znc0/SXX6y0JEVyaWMgRWNoaWRuYSA8ZXJpY0Bi"
+            + "b3VuY3ljYXN0bGUub3JnPoi4BBMBAgAiBQI/RxQNAhsDBQkAg9YABAsHAwIDFQID"
+            + "AxYCAQIeAQIXgAAKCRA1WGFG/fPzc3O6A/49tXFCiiP8vg77OXvnmbnzPBA1G6jC"
+            + "RZNP1yIXusOjpHqyLN5K9hw6lq/o4pNiCuiq32osqGRX3lv/nDduJU1kn2Ow+I2V"
+            + "ci+ojMXdCGdEqPwZfv47jHLwRrIUJ22OOoWsORtgvSeRUd4Izg8jruaFM7ufr5hr"
+            + "jEl1cuLW1Hr8Lp0B/AQ/RxxQAQQA0J2BIdqb8JtDGKjvYxrju0urJVVzyI1CnCjA"
+            + "p7CtLoHQJUQU7PajnV4Jd12ukfcoK7MRraYydQEjxh2MqPpuQgJS3dgQVrxOParD"
+            + "QYBFrZNd2tZxOjYakhErvUmRo6yWFaxChwqMgl8XWugBNg1Dva+/YcoGQ+ly+Jg4"
+            + "RWZoH88ABin+AwMCldD/2v8TyT1ghK70IuFs4MZBhdm6VgyGR8DQ/Ago6IAjA4BY"
+            + "Sol3lJb7+IIGsZaXwEuMRUvn6dWfa3r2I0p1t75vZb1Ng1YK32RZ5DNzl4Xb3L8V"
+            + "D+1Fiz9mHO8wiplAwDudB+RmQMlth3DNi/UsjeCTdEJAT+TTC7D40DiHDb1bR86Y"
+            + "2O5Y7MQ3SZs3/x0D/Ob6PStjfQ1kiqbruAMROKoavG0zVgxvspkoKN7h7BapnwJM"
+            + "6yf4qN/aByhAx9sFvADxu6z3SVcxiFw3IgAmabyWYb85LP8AsTYAG/HBoC6yob47"
+            + "Mt+GEDeyPifzzGXBWYIH4heZbSQivvA0eRwY5VZsMsBkbY5VR0FLVWgplbuO21bS"
+            + "rPS1T0crC+Zfj7FQBAkTfsg8RZQ8MPaHng01+gnFd243DDFvTAHygvm6a2X2fiRw"
+            + "5epAST4wWfY/BZNOxmfSKH6QS0oQMRscw79He6vGTB7vunLrKQYD4veInwQYAQIA"
+            + "CQUCP0ccUAIbDAAKCRA1WGFG/fPzczmFA/wMg5HhN5NkqmjnHUFfeXNXdHzmekyw"
+            + "38RnuCMKmfc43AiDs+FtJ62gpQ6PEsZF4o9S5fxcjVk3VSg00XMDtQ/0BsKBc5Gx"
+            + "hJTq7G+/SoeM433WG19uoS0+5Lf/31wNoTnpv6npOaYpcTQ7L9LCnzwAF4H0hJPE"
+            + "6bhmW2CMcsE/IZUB4QQ/Rwc1EQQAs5MUQlRiYOfi3fQ1OF6Z3eCwioDKu2DmOxot"
+            + "BICvdoG2muvs0KEBas9bbd0FJqc92FZJv8yxEgQbQtQAiFxoIFHRTFK+SPO/tQm+"
+            + "r83nwLRrfDeVVdRfzF79YCc+Abuh8sS/53H3u9Y7DYWr9IuMgI39nrVhY+d8yukf"
+            + "jo4OR+sAoKS/f7V1Xxj/Eqhb8qzf+N+zJRUlBACDd1eo/zFJZcq2YJa7a9vkViME"
+            + "axvwApqxeoU7oDpeHEMWg2DXJ7V24ZU5SbPTMY0x98cc8pcoqwsqux8xicWc0reh"
+            + "U3odQxWM4Se0LmEdca0nQOmNJlL9IsQ+QOJzx47qUOUAqhxnkXxQ/6B8w+M6gZya"
+            + "fwSdy70OumxESZipeQP+Lo9x6FcaW9L78hDX0aijJhgSEsnGODKB+bln29txX37E"
+            + "/a/Si+pyeLMi82kUdIL3G3I5HPWd3qSO4K94062+HfFj8bA20/1tbb/WxvxB2sKJ"
+            + "i3IobblFOvFHo+v8GaLdVyartp0JZLue/jP1dl9ctulSrIqaJT342uLsgTjsr2z+"
+            + "AwMCAyAU8Vo5AhhgFkDto8vQk7yxyRKEzu5qB66dRcTlaUPIiR8kamcy5ZTtujs4"
+            + "KIW4j2M/LvagrpWfV5+0M0VyaWMgRWNoaWRuYSAoRFNBIFRlc3QgS2V5KSA8ZXJp"
+            + "Y0Bib3VuY3ljYXN0bGUub3JnPohZBBMRAgAZBQI/Rwc1BAsHAwIDFQIDAxYCAQIe"
+            + "AQIXgAAKCRDNI/XpxMo0QwJcAJ40447eezSiIMspuzkwsMyFN8YBaQCdFTuZuT30"
+            + "CphiUYWnsC0mQ+J15B4=");
+
+        private static readonly byte[] enc1 = Base64.Decode(
+              "hIwDKwfQexPJboABA/4/7prhYYMORTiQ5avQKx0XYpCLujzGefYjnyuWZnx3Iev8"
+            + "Pmsguumm+OLLvtXhhkXQmkJRXbIg6Otj2ubPYWflRPgpJSgOrNOreOl5jeABOrtw"
+            + "bV6TJb9OTtZuB7cTQSCq2gmYiSZkluIiDjNs3R3mEanILbYzOQ3zKSggKpzlv9JQ"
+            + "AZUqTyDyJ6/OUbJF5fI5uiv76DCsw1zyMWotUIu5/X01q+AVP5Ly3STzI7xkWg/J"
+            + "APz4zUHism7kSYz2viAQaJx9/bNnH3AM6qm1Fuyikl4=");
 
 //		private static readonly byte[] enc1crc = Base64.Decode("lv4o");
 
@@ -147,192 +147,192 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
 //			+ "Aa7xx8rjCqPbiIQW6t5LqCNvPZOiSCmftll6+se1XJhFEuq8WS4nXtPfTiJ3vib4"
 //			+ "3soJdHzGB6AOs+BQ6aKmmNTVAxa5owhtSt1Z/6dfSSk=");
 
-		private static readonly byte[] subPubKey = Base64.Decode(
+        private static readonly byte[] subPubKey = Base64.Decode(
               "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"
-			+ "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");
+            + "FAB+CWS8RdFOWt/FG3tEv2nzcoNdRvjv9WALyIGNawtae4Ml6oAT06/511yUzXHO"
+            + "k+9xK3wkXN5jdzUhf4cA2oGpLSV/pZlocsIDL+jCUQtumUPwFodmSHhzAAYptC9F"
+            + "cmljIEVjaGlkbmEgKHRlc3Qga2V5KSA8ZXJpY0Bib3VuY3ljYXN0bGUub3JnPoi4"
+            + "BBMBAgAiBQI/PackAhsDBQkAg9YABAsHAwIDFQIDAxYCAQIeAQIXgAAKCRA1WGFG"
+            + "/fPzc8WMA/9BbjuB8E48QAlxoiVf9U8SfNelrz/ONJA/bMvWr/JnOGA9PPmFD5Uc"
+            + "+kV/q+i94dEMjsC5CQ1moUHWSP2xlQhbOzBP2+oPXw3z2fBs9XJgnTH6QWMAAvLs"
+            + "3ug9po0loNHLobT/D/XdXvcrb3wvwvPT2FptZqrtonH/OdzT9JdfrIhMBBARAgAM"
+            + "BQI/RxooBYMAemL8AAoJEM0j9enEyjRDiBgAn3RcLK+gq90PvnQFTw2DNqdq7KA0"
+            + "AKCS0EEIXCzbV1tfTdCUJ3hVh3btF7QkRXJpYyBFY2hpZG5hIDxlcmljQGJvdW5j"
+            + "eWNhc3RsZS5vcmc+iLgEEwECACIFAj9HFA0CGwMFCQCD1gAECwcDAgMVAgMDFgIB"
+            + "Ah4BAheAAAoJEDVYYUb98/Nzc7oD/j21cUKKI/y+Dvs5e+eZufM8EDUbqMJFk0/X"
+            + "Ihe6w6OkerIs3kr2HDqWr+jik2IK6KrfaiyoZFfeW/+cN24lTWSfY7D4jZVyL6iM"
+            + "xd0IZ0So/Bl+/juMcvBGshQnbY46haw5G2C9J5FR3gjODyOu5oUzu5+vmGuMSXVy"
+            + "4tbUevwuiEwEEBECAAwFAj9HGigFgwB6YvwACgkQzSP16cTKNEPwBQCdHm0Amwza"
+            + "NmVmDHm3rmqI7rp2oQ0An2YbiP/H/kmBNnmTeH55kd253QOhuIsEP0ccUAEEANCd"
+            + "gSHam/CbQxio72Ma47tLqyVVc8iNQpwowKewrS6B0CVEFOz2o51eCXddrpH3KCuz"
+            + "Ea2mMnUBI8YdjKj6bkICUt3YEFa8Tj2qw0GARa2TXdrWcTo2GpIRK71JkaOslhWs"
+            + "QocKjIJfF1roATYNQ72vv2HKBkPpcviYOEVmaB/PAAYpiJ8EGAECAAkFAj9HHFAC"
+            + "GwwACgkQNVhhRv3z83M5hQP8DIOR4TeTZKpo5x1BX3lzV3R85npMsN/EZ7gjCpn3"
+            + "ONwIg7PhbSetoKUOjxLGReKPUuX8XI1ZN1UoNNFzA7UP9AbCgXORsYSU6uxvv0qH"
+            + "jON91htfbqEtPuS3/99cDaE56b+p6TmmKXE0Oy/Swp88ABeB9ISTxOm4ZltgjHLB"
+            + "PyGZAaIEP0cHNREEALOTFEJUYmDn4t30NThemd3gsIqAyrtg5jsaLQSAr3aBtprr"
+            + "7NChAWrPW23dBSanPdhWSb/MsRIEG0LUAIhcaCBR0UxSvkjzv7UJvq/N58C0a3w3"
+            + "lVXUX8xe/WAnPgG7ofLEv+dx97vWOw2Fq/SLjICN/Z61YWPnfMrpH46ODkfrAKCk"
+            + "v3+1dV8Y/xKoW/Ks3/jfsyUVJQQAg3dXqP8xSWXKtmCWu2vb5FYjBGsb8AKasXqF"
+            + "O6A6XhxDFoNg1ye1duGVOUmz0zGNMffHHPKXKKsLKrsfMYnFnNK3oVN6HUMVjOEn"
+            + "tC5hHXGtJ0DpjSZS/SLEPkDic8eO6lDlAKocZ5F8UP+gfMPjOoGcmn8Encu9Drps"
+            + "REmYqXkD/i6PcehXGlvS+/IQ19GooyYYEhLJxjgygfm5Z9vbcV9+xP2v0ovqcniz"
+            + "IvNpFHSC9xtyORz1nd6kjuCveNOtvh3xY/GwNtP9bW2/1sb8QdrCiYtyKG25RTrx"
+            + "R6Pr/Bmi3Vcmq7adCWS7nv4z9XZfXLbpUqyKmiU9+Nri7IE47K9stDNFcmljIEVj"
+            + "aGlkbmEgKERTQSBUZXN0IEtleSkgPGVyaWNAYm91bmN5Y2FzdGxlLm9yZz6IWQQT"
+            + "EQIAGQUCP0cHNQQLBwMCAxUCAwMWAgECHgECF4AACgkQzSP16cTKNEMCXACfauui"
+            + "bSwyG59Yrm8hHCDuCPmqwsQAni+dPl08FVuWh+wb6kOgJV4lcYae");
 
 //		private static readonly byte[] subPubCrc = Base64.Decode("rikt");
 
-		private static readonly byte[] pgp8Key = Base64.Decode(
+        private static readonly byte[] pgp8Key = Base64.Decode(
               "lQIEBEBXUNMBBADScQczBibewnbCzCswc/9ut8R0fwlltBRxMW0NMdKJY2LF"
-			+ "7k2COeLOCIU95loJGV6ulbpDCXEO2Jyq8/qGw1qD3SCZNXxKs3GS8Iyh9Uwd"
-			+ "VL07nMMYl5NiQRsFB7wOb86+94tYWgvikVA5BRP5y3+O3GItnXnpWSJyREUy"
-			+ "6WI2QQAGKf4JAwIVmnRs4jtTX2DD05zy2mepEQ8bsqVAKIx7lEwvMVNcvg4Y"
-			+ "8vFLh9Mf/uNciwL4Se/ehfKQ/AT0JmBZduYMqRU2zhiBmxj4cXUQ0s36ysj7"
-			+ "fyDngGocDnM3cwPxaTF1ZRBQHSLewP7dqE7M73usFSz8vwD/0xNOHFRLKbsO"
-			+ "RqDlLA1Cg2Yd0wWPS0o7+qqk9ndqrjjSwMM8ftnzFGjShAdg4Ca7fFkcNePP"
-			+ "/rrwIH472FuRb7RbWzwXA4+4ZBdl8D4An0dwtfvAO+jCZSrLjmSpxEOveJxY"
-			+ "GduyR4IA4lemvAG51YHTHd4NXheuEqsIkn1yarwaaj47lFPnxNOElOREMdZb"
-			+ "nkWQb1jfgqO24imEZgrLMkK9bJfoDnlF4k6r6hZOp5FSFvc5kJB4cVo1QJl4"
-			+ "pwCSdoU6luwCggrlZhDnkGCSuQUUW45NE7Br22NGqn4/gHs0KCsWbAezApGj"
-			+ "qYUCfX1bcpPzUMzUlBaD5rz2vPeO58CDtBJ0ZXN0ZXIgPHRlc3RAdGVzdD6I"
-			+ "sgQTAQIAHAUCQFdQ0wIbAwQLBwMCAxUCAwMWAgECHgECF4AACgkQs8JyyQfH"
-			+ "97I1QgP8Cd+35maM2cbWV9iVRO+c5456KDi3oIUSNdPf1NQrCAtJqEUhmMSt"
-			+ "QbdiaFEkPrORISI/2htXruYn0aIpkCfbUheHOu0sef7s6pHmI2kOQPzR+C/j"
-			+ "8D9QvWsPOOso81KU2axUY8zIer64Uzqc4szMIlLw06c8vea27RfgjBpSCryw"
-			+ "AgAA");
-
-		private static readonly char[] pgp8Pass = "2002 Buffalo Sabres".ToCharArray();
-
-		private static readonly char[] pass = "hello world".ToCharArray();
-
-		private static readonly byte[] fingerprintKey = Base64.Decode(
-			  "mQEPA0CiJdUAAAEIAMI+znDlPd2kQoEcnxqxLcRz56Z7ttFKHpnYp0UkljZdquVc"
-			+ "By1jMfXGVV64xN1IvMcyenLXUE0IUeUBCQs6tHunFRAPSeCxJ3FdFe1B5MpqQG8A"
-			+ "BnEpAds/hAUfRDZD5y/lolk1hjvFMrRh6WXckaA/QQ2t00NmTrJ1pYUpkw9tnVQb"
-			+ "LUjWJhfZDBBcN0ADtATzgkugxMtcDxR6I5x8Ndn+IilqIm23kxGIcmMd/BHOec4c"
-			+ "jRwJXXDb7u8tl+2knAf9cwhPHp3+Zy4uGSQPdzQnXOhBlA+4WDa0RROOevWgq8uq"
-			+ "8/9Xp/OlTVL+OoIzjsI6mJP1Joa4qmqAnaHAmXcAEQEAAbQoQk9BM1JTS1kgPEJP"
-			+ "QSBNb25pdG9yaW5nIEAgODg4LTI2OS01MjY2PokBFQMFEECiJdWqaoCdocCZdwEB"
-			+ "0RsH/3HPxoUZ3G3K7T3jgOnJUckTSHWU3XspHzMVgqOxjTrcexi5IsAM5M+BulfW"
-			+ "T2aO+Kqf5w8cKTKgW02DNpHUiPjHx0nzDE+Do95zbIErGeK+Twkc4O/aVsvU9GGO"
-			+ "81VFI6WMvDQ4CUAUnAdk03MRrzI2nAuhn4NJ5LQS+uJrnqUJ4HmFAz6CQZQKd/kS"
-			+ "Xgq+A6i7aI1LG80YxWa9ooQgaCrb9dwY/kPQ+yC22zQ3FExtv+Fv3VtAKTilO3vn"
-			+ "BA4Y9uTHuObHfI+1yxUS2PrlRUX0m48ZjpIX+cEN3QblGBJudI/A1QSd6P0LZeBr"
-			+ "7F1Z1aF7ZDo0KzgiAIBvgXkeTpw=");
+            + "7k2COeLOCIU95loJGV6ulbpDCXEO2Jyq8/qGw1qD3SCZNXxKs3GS8Iyh9Uwd"
+            + "VL07nMMYl5NiQRsFB7wOb86+94tYWgvikVA5BRP5y3+O3GItnXnpWSJyREUy"
+            + "6WI2QQAGKf4JAwIVmnRs4jtTX2DD05zy2mepEQ8bsqVAKIx7lEwvMVNcvg4Y"
+            + "8vFLh9Mf/uNciwL4Se/ehfKQ/AT0JmBZduYMqRU2zhiBmxj4cXUQ0s36ysj7"
+            + "fyDngGocDnM3cwPxaTF1ZRBQHSLewP7dqE7M73usFSz8vwD/0xNOHFRLKbsO"
+            + "RqDlLA1Cg2Yd0wWPS0o7+qqk9ndqrjjSwMM8ftnzFGjShAdg4Ca7fFkcNePP"
+            + "/rrwIH472FuRb7RbWzwXA4+4ZBdl8D4An0dwtfvAO+jCZSrLjmSpxEOveJxY"
+            + "GduyR4IA4lemvAG51YHTHd4NXheuEqsIkn1yarwaaj47lFPnxNOElOREMdZb"
+            + "nkWQb1jfgqO24imEZgrLMkK9bJfoDnlF4k6r6hZOp5FSFvc5kJB4cVo1QJl4"
+            + "pwCSdoU6luwCggrlZhDnkGCSuQUUW45NE7Br22NGqn4/gHs0KCsWbAezApGj"
+            + "qYUCfX1bcpPzUMzUlBaD5rz2vPeO58CDtBJ0ZXN0ZXIgPHRlc3RAdGVzdD6I"
+            + "sgQTAQIAHAUCQFdQ0wIbAwQLBwMCAxUCAwMWAgECHgECF4AACgkQs8JyyQfH"
+            + "97I1QgP8Cd+35maM2cbWV9iVRO+c5456KDi3oIUSNdPf1NQrCAtJqEUhmMSt"
+            + "QbdiaFEkPrORISI/2htXruYn0aIpkCfbUheHOu0sef7s6pHmI2kOQPzR+C/j"
+            + "8D9QvWsPOOso81KU2axUY8zIer64Uzqc4szMIlLw06c8vea27RfgjBpSCryw"
+            + "AgAA");
+
+        private static readonly char[] pgp8Pass = "2002 Buffalo Sabres".ToCharArray();
+
+        private static readonly char[] pass = "hello world".ToCharArray();
+
+        private static readonly byte[] fingerprintKey = Base64.Decode(
+              "mQEPA0CiJdUAAAEIAMI+znDlPd2kQoEcnxqxLcRz56Z7ttFKHpnYp0UkljZdquVc"
+            + "By1jMfXGVV64xN1IvMcyenLXUE0IUeUBCQs6tHunFRAPSeCxJ3FdFe1B5MpqQG8A"
+            + "BnEpAds/hAUfRDZD5y/lolk1hjvFMrRh6WXckaA/QQ2t00NmTrJ1pYUpkw9tnVQb"
+            + "LUjWJhfZDBBcN0ADtATzgkugxMtcDxR6I5x8Ndn+IilqIm23kxGIcmMd/BHOec4c"
+            + "jRwJXXDb7u8tl+2knAf9cwhPHp3+Zy4uGSQPdzQnXOhBlA+4WDa0RROOevWgq8uq"
+            + "8/9Xp/OlTVL+OoIzjsI6mJP1Joa4qmqAnaHAmXcAEQEAAbQoQk9BM1JTS1kgPEJP"
+            + "QSBNb25pdG9yaW5nIEAgODg4LTI2OS01MjY2PokBFQMFEECiJdWqaoCdocCZdwEB"
+            + "0RsH/3HPxoUZ3G3K7T3jgOnJUckTSHWU3XspHzMVgqOxjTrcexi5IsAM5M+BulfW"
+            + "T2aO+Kqf5w8cKTKgW02DNpHUiPjHx0nzDE+Do95zbIErGeK+Twkc4O/aVsvU9GGO"
+            + "81VFI6WMvDQ4CUAUnAdk03MRrzI2nAuhn4NJ5LQS+uJrnqUJ4HmFAz6CQZQKd/kS"
+            + "Xgq+A6i7aI1LG80YxWa9ooQgaCrb9dwY/kPQ+yC22zQ3FExtv+Fv3VtAKTilO3vn"
+            + "BA4Y9uTHuObHfI+1yxUS2PrlRUX0m48ZjpIX+cEN3QblGBJudI/A1QSd6P0LZeBr"
+            + "7F1Z1aF7ZDo0KzgiAIBvgXkeTpw=");
 
 //		private static readonly byte[] fingerprintCheck = Base64.Decode("CTv2");
 
-		private static readonly byte[] jpegImage = Base64.Decode(
-			  "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");
-
-		private static readonly byte[] embeddedJPEGKey = Base64.Decode(
-			  "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"
-			+ "Qvmtc8X7lqK/zLRVkSSBItik2IIhsAIAAw==");
-
-		private void FingerPrintTest()
+        private static readonly byte[] jpegImage = Base64.Decode(
+              "/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD/2wBDAAUDBAQEAwUE"
+            + "BAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/"
+            + "wAALCAA6AFABASIA/8QAHAAAAgMAAwEAAAAAAAAAAAAABQcABAYBAggD/8QAMRAAAgEDBAEDAwME"
+            + "AQUAAAAAAQIDBAURAAYSITEHIkETFFEjYXEVMkKRCCUzQ4Gh/9oACAEBAAA/APX1TdKCmlaOoqoo"
+            + "WXzzbiP9nWaS71lXuA2tqrgopBOxpyGyWLAEEd4GAf3+fOjLPXoVaOcNzYAhl8HskADwAPz37f3z"
+            + "opSvI9Mjypwcr7l/B1XuFwSmoTVooljB9xDYAH51Vor191F9dKGb6Py3yo4huwcHwf8AYP7ZLIyu"
+            + "gZSGBGQQejrnU1NKn1EqVi3sZJOBCwxxIp9xzksfb5PR+Mdga+ljqIKje1TNBBNToYYgU4477HwQ"
+            + "Bn9z8/nW6mqxLR0NzpJkMLx8lJUkOGAIx4I/0f41lJ93UkkrRxVKvNKVjZfpSe6RyqhCp7wCSD89"
+            + "EEDRWppEkgqKdYohGcoZAjAlSMMcZ+PHH/3odsG6VLW2qaoqV+nTyFZpHOFQL0Sc9ADGTnHWtZap"
+            + "EpoamJm/TgYkfgJ5H/zGuKieVJIGkqCgmfCJFFy64s3Z+Oh58fHyNfGavipIJ2BrZcKXA+mzEd9Y"
+            + "OCcHI/gDV62SzvBGKhQHaNWzj8jvP750oN/xM3qkshLPEstOhj7IVyvkY+f7Nd7hf9vbc9QbVb7n"
+            + "dadLldqc00FMCwlmZnCrgL2v/cAySPBPwSD+/wC+3HbWx3rLbaqW81CVHOWnetMZjRm9h7VvClcj"
+            + "oDB7PymPTvem+a6roxvC10sd3ScmlucdEyUtRADxdice9wY3PQGRgj4OnHU3u5RW+op6imo4q+KA"
+            + "1UKGQ/bzrnt0biWxkgFOJK9ZyCCVX6f3T1Rh9RawbltdQNv18CGe2wxBDQyvGrowIJd15HEnHvP+"
+            + "OBjXoGzS0tNTpQipFTIw48Xn5SSBVUMw5e5wMgZ/j86yVNvvZ9TeDR1c9XSV0bl443dmYZXiCSCR"
+            + "jvxkjR1L1b46iWpStpIRLOWkCqyniP8AJjxPIniBjr+etFdu11DVu321WZiFHRjZcA/gsO+seNYf"
+            + "fVpq6n1Eo5KNATIYmb5Bx7csP4z/AKz8aX1N6Q7W3FuWWrS1TRzi+tXSutUESQhCGiVAvJVRgfcc"
+            + "HkeidM6tSmTbps9RHIH4KoqC8j/VC8R0+CSScZLdknPZGgNfYpUUUzfewxxcWpopWbhL715KgBIQ"
+            + "MCQc4A84+dD963X7ywQ0NIVW60qqzkzIfoszAMGUNyUHORkDrHxo3sSaOhtX2hnp3uNRF9b7hqtO"
+            + "DxM3Rcj3dMCPHXLGfOkLuPddp9R/ViOa62KppqK3Vctvsz0UylKtWfgXy3+L8WIZFBGRhs407rTT"
+            + "bcuFDRWmtsNGIZ1MMEU9GPqRorKPcJEzhich8Anz350Wk2zs2OsT7D7RZJpChMEk0MoypJZWVwM9"
+            + "ZzjWw2lbKaioFjQy/U9shLyu7Esi5JLEnsgnQlaSqhqayWSRZ5JaiSSNPoBCiq54jPuJyA2W+QfA"
+            + "+FrSXq4bdulZHRpWRzpArPK0SSNUExh14qB4c5X9ipz41Zud0juVouVooHN6rrZKVaoek/VhYgqE"
+            + "4v7cZPTfPHwT7tZX0e2NVUV5rK2ku9TeY6aFZJ6GuLALKzNnizE4CsqHIyBxJCk4AYFNt2wSUExm"
+            + "pP1lqgq1zkfXUtIgkiOFHQCsCM/kfOtZU7GsNZU1FFc1lrqCSNSlFOQ8SJk8kC4/tJx1rMwbWt0V"
+            + "CW21VW+krVoFTCRrPC0bf+NF8ocqMcT/AIg6EVF5/p9U6zPXLVFGpoKlSpMiEkniSCcqVY+eQIPW"
+            + "NULf/UNxJNS0dhklu8SK9Lco6pUcEr0JOu1HQ7z+R5OndaI5leWV0VQ54kA5KlWIx/Gqd2t6vcqe"
+            + "FIXNJMs71SoCMsQuG5jsN8AAjyTnrGlt6mVlqswtS0SG71NTXpSiCQFpogckll6Y4wvyD/OToVd7"
+            + "3tLedda4Nr3iRK2mqJhW1K0qxSSGJf1OTOAwwVADLkA9fPV2W77msVfPTClNRUyJCla0SqS5dR5J"
+            + "b2kluKlQc5BbHnWu2xTS0G4qmjvSq6RwrPHJUMHkkYDhzJHXIhmBAHnxpaL6j3il3D6g1VLuSz1k"
+            + "1ht//S6SZQ4KoTI6MyMOb9hR85HedM/0wqn3RsC0bhgq/pQV9J9WELEFaNWGARg+04xkd95xjQTe"
+            + "df6c7U+ysl3mtMFJe5JYGkkmAVKgKZCZGzlVbBySemA/OgvpZUQxvaqitgoqSsiX6XKh5RwVCBP0"
+            + "8KCTIoU8VJyDjIA8Bs2e5CprDTR8VXi8pRgyyZMh8qQMDHz850ZOlVv30RsW5blcL5S3a626+1cq"
+            + "TirFQ0qJIgAQCNjgIMeFKn9wQCMA3o2vprca/ctp29Jv6/3aoZ4IRRx08dC5D8nWQv7FJYHByeuv"
+            + "zo5SWn1Z2ttahutFZqbcG6JK5ZLu1TNEzzUq5ASNyVw6pxUMc5Oc5znR6KyXffldUVW4rBcbAqos"
+            + "EUq1qrUzUkwy8bFB+m4ZI2IBbAJAbOdau0+nmybJYqe027atvNHTRlYomhVz+Tln8knyScn50j/+"
+            + "SOyd3VO2oDtmPcNPYqJgDt23xKtOIiTy6gYO/Z5YOcAHGsJ/x39NgbzuDc+0bNt6/wAySmltbXGv"
+            + "flaT8ST07xBjIR30RjsL+dex9uwT/wBKo6i5UtPFdHp4/u/pgECTiOQDYBIByB+w0RVEVmZUUM39"
+            + "xA7P867ampqampqaq09BQwV9RWwUVNFU1AUTTJEoeQLnHJgMnGTjP51a1Nf/2Q==");
+
+        private static readonly byte[] embeddedJPEGKey = Base64.Decode(
+              "mI0ER0JXuwEEAKNqsXwLU6gu6P2Q/HJqEJVt3A7Kp1yucn8HWVeJF9JLAKVjVU8jrvz9Bw4NwaRJ"
+            + "NGYEAgdRq8Hx3WP9FXFCIVfCdi+oQrphcHWzzBFul8sykUGT+LmcBdqQGU9WaWSJyCOmUht4j7t0"
+            + "zk/IXX0YxGmkqR+no5rTj9LMDG8AQQrFABEBAAG0P0VyaWMgSCBFY2hpZG5hIChpbWFnZSB0ZXN0"
+            + "IGtleSkgPGVyaWMuZWNoaWRuYUBib3VuY3ljYXN0bGUub3JnPoi2BBMBAgAgBQJHQle7AhsDBgsJ"
+            + "CAcDAgQVAggDBBYCAwECHgECF4AACgkQ1+RWqFFpjMTKtgP+Okqkn0gVpQyNYXM/hWX6f3UQcyXk"
+            + "2Sd/fWW0XG+LBjhhBo+lXRWK0uYF8OMdZwsSl9HimpgYD5/kNs0Seh417DioP1diOgxkgezyQgMa"
+            + "+ODZfNnIvVaBr1pHLPLeqIBxBVMWBfa4wDXnLLGu8018uvI2yBhz5vByB1ntxwgKMXCwAgAD0cf3"
+            + "x/UBEAABAQAAAAAAAAAAAAAAAP/Y/+AAEEpGSUYAAQEBAEgASAAA/+EAFkV4aWYAAE1NACoAAAAI"
+            + "AAAAAAAA/9sAQwAFAwQEBAMFBAQEBQUFBgcMCAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERgh"
+            + "GBodHR8fHxMXIiQiHiQcHh8e/8AACwgAOgBQAQEiAP/EABwAAAIDAAMBAAAAAAAAAAAAAAUHAAQG"
+            + "AQIIA//EADEQAAIBAwQBAwMDBAEFAAAAAAECAwQFEQAGEiExByJBExRRI2FxFTJCkQglM0OBof/a"
+            + "AAgBAQAAPwD19U3SgppWjqKqKFl8824j/Z1mku9ZV7gNraq4KKQTsachsliwBBHeBgH9/nzoyz16"
+            + "FWjnDc2AIZfB7JAA8AD89+3986KUryPTI8qcHK+5fwdV7hcEpqE1aKJYwfcQ2AB+dVaK9fdRfXSh"
+            + "m+j8t8qOIbsHB8H/AGD+2SyMroGUhgRkEHo651NTSp9RKlYt7GSTgQsMcSKfcc5LH2+T0fjHYGvp"
+            + "Y6iCo3tUzQQTU6GGIFOOO+x8EAZ/c/P51upqsS0dDc6SZDC8fJSVJDhgCMeCP9H+NZSfd1JJK0cV"
+            + "SrzSlY2X6UnukcqoQqe8Akg/PRBA0VqaRJIKinWKIRnKGQIwJUjDHGfjxx/96HbBulS1tqmqKlfp"
+            + "08hWaRzhUC9EnPQAxk5x1rWWqRKaGpiZv04GJH4CeR/8xrionlSSBpKgoJnwiRRcuuLN2fjoefHx"
+            + "8jXxmr4qSCdga2XClwPpsxHfWDgnByP4A1etks7wRioUB2jVs4/I7z++dKDf8TN6pLISzxLLToY+"
+            + "yFcr5GPn+zXe4X/b23PUG1W+53WnS5XanNNBTAsJZmZwq4C9r/3AMkjwT8Eg/v8Avtx21sd6y22q"
+            + "lvNQlRzlp3rTGY0ZvYe1bwpXI6Awez8pj073pvmuq6MbwtdLHd0nJpbnHRMlLUQA8XYnHvcGNz0B"
+            + "kYI+Dpx1N7uUVvqKeopqOKvigNVChkP28657dG4lsZIBTiSvWcgglV+n909UYfUWsG5bXUDb9fAh"
+            + "ntsMQQ0Mrxq6MCCXdeRxJx7z/jgY16Bs0tLTU6UIqRUyMOPF5+UkgVVDMOXucDIGf4/OslTb72fU"
+            + "3g0dXPV0ldG5eON3ZmGV4gkgkY78ZI0dS9W+OolqUraSESzlpAqsp4j/ACY8TyJ4gY6/nrRXbtdQ"
+            + "1bt9tVmYhR0Y2XAP4LDvrHjWH31aaup9RKOSjQEyGJm+Qce3LD+M/wCs/Gl9TekO1txbllq0tU0c"
+            + "4vrV0rrVBEkIQholQLyVUYH3HB5HonTOrUpk26bPURyB+CqKgvI/1QvEdPgkknGS3ZJz2RoDX2KV"
+            + "FFM33sMcXFqaKVm4S+9eSoASEDAkHOAPOPnQ/et1+8sENDSFVutKqs5MyH6LMwDBlDclBzkZA6x8"
+            + "aN7EmjobV9oZ6d7jURfW+4arTg8TN0XI93TAjx1yxnzpC7j3XafUf1Yjmutiqaait1XLb7M9FMpS"
+            + "rVn4F8t/i/FiGRQRkYbONO60023LhQ0VprbDRiGdTDBFPRj6kaKyj3CRM4YnIfAJ89+dFpNs7Njr"
+            + "E+w+0WSaQoTBJNDKMqSWVlcDPWc41sNpWymoqBY0Mv1PbIS8ruxLIuSSxJ7IJ0JWkqoamslkkWeS"
+            + "WokkjT6AQoqueIz7icgNlvkHwPha0l6uG3bpWR0aVkc6QKzytEkjVBMYdeKgeHOV/Yqc+NWbndI7"
+            + "laLlaKBzeq62SlWqHpP1YWIKhOL+3GT03zx8E+7WV9HtjVVFeaytpLvU3mOmhWSehriwCyszZ4sx"
+            + "OArKhyMgcSQpOAGBTbdsElBMZqT9ZaoKtc5H11LSIJIjhR0ArAjP5HzrWVOxrDWVNRRXNZa6gkjU"
+            + "pRTkPEiZPJAuP7ScdazMG1rdFQlttVVvpK1aBUwkazwtG3/jRfKHKjHE/wCIOhFRef6fVOsz1y1R"
+            + "RqaCpUqTIhJJ4kgnKlWPnkCD1jVC3/1DcSTUtHYZJbvEivS3KOqVHBK9CTrtR0O8/keTp3WiOZXl"
+            + "ldFUOeJAOSpViMfxqndrer3KnhSFzSTLO9UqAjLELhuY7DfAAI8k56xpbeplZarMLUtEhu9TU16U"
+            + "ogkBaaIHJJZemOML8g/zk6FXe97S3nXWuDa94kStpqiYVtStKsUkhiX9TkzgMMFQAy5APXz1dlu+"
+            + "5rFXz0wpTUVMiQpWtEqkuXUeSW9pJbipUHOQWx51rtsU0tBuKpo70qukcKzxyVDB5JGA4cyR1yIZ"
+            + "gQB58aWi+o94pdw+oNVS7ks9ZNYbf/0ukmUOCqEyOjMjDm/YUfOR3nTP9MKp90bAtG4YKv6UFfSf"
+            + "VhCxBWjVhgEYPtOMZHfecY0E3nX+nO1PsrJd5rTBSXuSWBpJJgFSoCmQmRs5VWwcknpgPzoL6WVE"
+            + "Mb2qorYKKkrIl+lyoeUcFQgT9PCgkyKFPFScg4yAPAbNnuQqaw00fFV4vKUYMsmTIfKkDAx8/OdG"
+            + "TpVb99EbFuW5XC+Ut2utuvtXKk4qxUNKiSIAEAjY4CDHhSp/cEAjAN6Nr6a3Gv3LadvSb+v92qGe"
+            + "CEUcdPHQuQ/J1kL+xSWBwcnrr86OUlp9WdrbWobrRWam3BuiSuWS7tUzRM81KuQEjclcOqcVDHOT"
+            + "nOc50eisl335XVFVuKwXGwKqLBFKtaq1M1JMMvGxQfpuGSNiAWwCQGznWrtPp5smyWKntNu2rbzR"
+            + "00ZWKJoVc/k5Z/JJ8knJ+dI//kjsnd1TtqA7Zj3DT2KiYA7dt8SrTiIk8uoGDv2eWDnABxrCf8d/"
+            + "TYG87g3PtGzbev8AMkppbW1xr35Wk/Ek9O8QYyEd9EY7C/nXsfbsE/8ASqOouVLTxXR6eP7v6YBA"
+            + "k4jkA2ASAcgfsNEVRFZmVFDN/cQOz/Ou2pqampqamqtPQUMFfUVsFFTRVNQFE0yRKHkC5xyYDJxk"
+            + "4z+dWtTX/9mItgQTAQIAIAUCR0JYkAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJENfkVqhR"
+            + "aYzEAPYD/iHdLOAE8r8HHF3F4z28vtIT8iiRB9aPC/YH0xqV1qeEKG8+VosBaQAOCEquONtRWsww"
+            + "gO3XB0d6VAq2kMOKc2YiB4ZtZcFvvmP9KdmVIZxVjpa9ozjP5j9zFso1HOpFcsn/VDBEqy5TvsNx"
+            + "Qvmtc8X7lqK/zLRVkSSBItik2IIhsAIAAw==");
+
+        private void FingerPrintTest()
         {
             //
             // version 3
             //
             PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(fingerprintKey);
 
-			PgpPublicKey pubKey = pgpPub.GetPublicKey();
+            PgpPublicKey pubKey = pgpPub.GetPublicKey();
 
-			if (!Arrays.AreEqual(pubKey.GetFingerprint(), Hex.Decode("4FFB9F0884266C715D1CEAC804A3BBFA")))
+            if (!Arrays.AreEqual(pubKey.GetFingerprint(), Hex.Decode("4FFB9F0884266C715D1CEAC804A3BBFA")))
             {
                 Fail("version 3 fingerprint test failed");
             }
 
-			//
+            //
             // version 4
             //
             pgpPub = new PgpPublicKeyRing(testPubKey);
@@ -345,202 +345,202 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
             }
         }
 
-		private void MixedTest(
-			PgpPrivateKey	pgpPrivKey,
-			PgpPublicKey	pgpPubKey)
-		{
-			byte[] text = Encoding.ASCII.GetBytes("hello world!\n");
-
-			//
-			// literal data
-			//
-			MemoryStream bOut = new MemoryStream();
-			PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
-			Stream lOut = lGen.Open(
-				bOut,
-				PgpLiteralData.Binary,
-				PgpLiteralData.Console,
-				text.Length,
-				DateTime.UtcNow);
-
-			lOut.Write(text, 0, text.Length);
-
-			lGen.Close();
-
-			byte[] bytes = bOut.ToArray();
+        private void MixedTest(
+            PgpPrivateKey	pgpPrivKey,
+            PgpPublicKey	pgpPubKey)
+        {
+            byte[] text = Encoding.ASCII.GetBytes("hello world!\n");
 
-			PgpObjectFactory f = new PgpObjectFactory(bytes);
-			CheckLiteralData((PgpLiteralData)f.NextPgpObject(), text);
+            //
+            // literal data
+            //
+            MemoryStream bOut = new MemoryStream();
+            PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
+            Stream lOut = lGen.Open(
+                bOut,
+                PgpLiteralData.Binary,
+                PgpLiteralData.Console,
+                text.Length,
+                DateTime.UtcNow);
 
-			MemoryStream bcOut = new MemoryStream();
+            lOut.Write(text, 0, text.Length);
 
-			PgpEncryptedDataGenerator encGen = new PgpEncryptedDataGenerator(
-				SymmetricKeyAlgorithmTag.Aes128,
-				true,
-				new SecureRandom());
+            lGen.Close();
 
-			encGen.AddMethod(pgpPubKey);
+            byte[] bytes = bOut.ToArray();
 
-			encGen.AddMethod("password".ToCharArray());
+            PgpObjectFactory f = new PgpObjectFactory(bytes);
+            CheckLiteralData((PgpLiteralData)f.NextPgpObject(), text);
 
-			Stream cOut = encGen.Open(bcOut, bytes.Length);
+            MemoryStream bcOut = new MemoryStream();
 
-			cOut.Write(bytes, 0, bytes.Length);
+            PgpEncryptedDataGenerator encGen = new PgpEncryptedDataGenerator(
+                SymmetricKeyAlgorithmTag.Aes128,
+                true,
+                new SecureRandom());
 
-			cOut.Close();
+            encGen.AddMethod(pgpPubKey);
 
-			byte[] encData = bcOut.ToArray();
+            encGen.AddMethod("password".ToCharArray());
 
-			//
-			// asymmetric
-			//
-			PgpObjectFactory pgpF = new PgpObjectFactory(encData);
+            Stream cOut = encGen.Open(bcOut, bytes.Length);
 
-			PgpEncryptedDataList encList = (PgpEncryptedDataList) pgpF.NextPgpObject();
+            cOut.Write(bytes, 0, bytes.Length);
 
-			PgpPublicKeyEncryptedData  encP = (PgpPublicKeyEncryptedData)encList[0];
+            cOut.Close();
 
-			Stream clear = encP.GetDataStream(pgpPrivKey);
+            byte[] encData = bcOut.ToArray();
 
-			PgpObjectFactory pgpFact = new PgpObjectFactory(clear);
+            //
+            // asymmetric
+            //
+            PgpObjectFactory pgpF = new PgpObjectFactory(encData);
 
-			CheckLiteralData((PgpLiteralData)pgpFact.NextPgpObject(), text);
+            PgpEncryptedDataList encList = (PgpEncryptedDataList) pgpF.NextPgpObject();
 
-			//
-			// PBE
-			//
-			pgpF = new PgpObjectFactory(encData);
+            PgpPublicKeyEncryptedData  encP = (PgpPublicKeyEncryptedData)encList[0];
 
-			encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
+            Stream clear = encP.GetDataStream(pgpPrivKey);
 
-			PgpPbeEncryptedData encPbe = (PgpPbeEncryptedData) encList[1];
+            PgpObjectFactory pgpFact = new PgpObjectFactory(clear);
 
-			clear = encPbe.GetDataStream("password".ToCharArray());
+            CheckLiteralData((PgpLiteralData)pgpFact.NextPgpObject(), text);
 
-			pgpF = new PgpObjectFactory(clear);
+            //
+            // PBE
+            //
+            pgpF = new PgpObjectFactory(encData);
 
-			CheckLiteralData((PgpLiteralData) pgpF.NextPgpObject(), text);
-		}
+            encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
 
-		private void CheckLiteralData(
-			PgpLiteralData	ld,
-			byte[]			data)
-		{
-			if (!ld.FileName.Equals(PgpLiteralData.Console))
-				throw new Exception("wrong filename in packet");
+            PgpPbeEncryptedData encPbe = (PgpPbeEncryptedData) encList[1];
 
-			Stream inLd = ld.GetDataStream();
-			byte[] bytes = Streams.ReadAll(inLd);
+            clear = encPbe.GetDataStream("password".ToCharArray());
 
-			if (!AreEqual(bytes, data))
-			{
-				Fail("wrong plain text in decrypted packet");
-			}
-		}
+            pgpF = new PgpObjectFactory(clear);
 
-		private void ExistingEmbeddedJpegTest()
-		{
-			PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(embeddedJPEGKey);
+            CheckLiteralData((PgpLiteralData) pgpF.NextPgpObject(), text);
+        }
 
-			PgpPublicKey pubKey = pgpPub.GetPublicKey();
+        private void CheckLiteralData(
+            PgpLiteralData	ld,
+            byte[]			data)
+        {
+            if (!ld.FileName.Equals(PgpLiteralData.Console))
+                throw new Exception("wrong filename in packet");
 
-			int count = 0;
-			foreach (PgpUserAttributeSubpacketVector attributes in pubKey.GetUserAttributes())
-			{
-				int sigCount = 0;
-				foreach (PgpSignature sig in pubKey.GetSignaturesForUserAttribute(attributes))
-				{
-					sig.InitVerify(pubKey);
+            Stream inLd = ld.GetDataStream();
+            byte[] bytes = Streams.ReadAll(inLd);
 
-					if (!sig.VerifyCertification(attributes, pubKey))
-					{
-						Fail("signature failed verification");
-					}
+            if (!AreEqual(bytes, data))
+            {
+                Fail("wrong plain text in decrypted packet");
+            }
+        }
 
-					sigCount++;
-				}
+        private void ExistingEmbeddedJpegTest()
+        {
+            PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(embeddedJPEGKey);
 
-				if (sigCount != 1)
-				{
-					Fail("Failed user attributes signature check");
-				}
-				count++;
-			}
+            PgpPublicKey pubKey = pgpPub.GetPublicKey();
 
-			if (count != 1)
-			{
-				Fail("didn't find user attributes");
-			}
-		}
+            int count = 0;
+            foreach (PgpUserAttributeSubpacketVector attributes in pubKey.GetUserAttributes())
+            {
+                int sigCount = 0;
+                foreach (PgpSignature sig in pubKey.GetSignaturesForUserAttribute(attributes))
+                {
+                    sig.InitVerify(pubKey);
+
+                    if (!sig.VerifyCertification(attributes, pubKey))
+                    {
+                        Fail("signature failed verification");
+                    }
+
+                    sigCount++;
+                }
+
+                if (sigCount != 1)
+                {
+                    Fail("Failed user attributes signature check");
+                }
+                count++;
+            }
 
-		private void EmbeddedJpegTest()
-		{
-			PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(testPubKey);
-			PgpSecretKeyRing pgpSec = new PgpSecretKeyRing(testPrivKey);
+            if (count != 1)
+            {
+                Fail("didn't find user attributes");
+            }
+        }
 
-			PgpPublicKey pubKey = pgpPub.GetPublicKey();
+        private void EmbeddedJpegTest()
+        {
+            PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(testPubKey);
+            PgpSecretKeyRing pgpSec = new PgpSecretKeyRing(testPrivKey);
 
-			PgpUserAttributeSubpacketVectorGenerator vGen = new PgpUserAttributeSubpacketVectorGenerator();
+            PgpPublicKey pubKey = pgpPub.GetPublicKey();
 
-			vGen.SetImageAttribute(ImageAttrib.Format.Jpeg, jpegImage);
+            PgpUserAttributeSubpacketVectorGenerator vGen = new PgpUserAttributeSubpacketVectorGenerator();
 
-			PgpUserAttributeSubpacketVector uVec = vGen.Generate();
+            vGen.SetImageAttribute(ImageAttrib.Format.Jpeg, jpegImage);
 
-			PgpSignatureGenerator sGen = new PgpSignatureGenerator(
-				PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
+            PgpUserAttributeSubpacketVector uVec = vGen.Generate();
 
-			sGen.InitSign(PgpSignature.PositiveCertification, pgpSec.GetSecretKey().ExtractPrivateKey(pass));
+            PgpSignatureGenerator sGen = new PgpSignatureGenerator(
+                PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
 
-			PgpSignature sig = sGen.GenerateCertification(uVec, pubKey);
+            sGen.InitSign(PgpSignature.PositiveCertification, pgpSec.GetSecretKey().ExtractPrivateKey(pass));
 
-			PgpPublicKey nKey = PgpPublicKey.AddCertification(pubKey, uVec, sig);
+            PgpSignature sig = sGen.GenerateCertification(uVec, pubKey);
 
-			int count = 0;
-			foreach (PgpUserAttributeSubpacketVector attributes in nKey.GetUserAttributes())
-			{
-				int sigCount = 0;
-				foreach (PgpSignature s in nKey.GetSignaturesForUserAttribute(attributes))
-				{
-					s.InitVerify(pubKey);
+            PgpPublicKey nKey = PgpPublicKey.AddCertification(pubKey, uVec, sig);
 
-					if (!s.VerifyCertification(attributes, pubKey))
-					{
-						Fail("added signature failed verification");
-					}
+            int count = 0;
+            foreach (PgpUserAttributeSubpacketVector attributes in nKey.GetUserAttributes())
+            {
+                int sigCount = 0;
+                foreach (PgpSignature s in nKey.GetSignaturesForUserAttribute(attributes))
+                {
+                    s.InitVerify(pubKey);
+
+                    if (!s.VerifyCertification(attributes, pubKey))
+                    {
+                        Fail("added signature failed verification");
+                    }
+
+                    sigCount++;
+                }
+
+                if (sigCount != 1)
+                {
+                    Fail("Failed added user attributes signature check");
+                }
+                count++;
+            }
 
-					sigCount++;
-				}
+            if (count != 1)
+            {
+                Fail("didn't find added user attributes");
+            }
 
-				if (sigCount != 1)
-				{
-					Fail("Failed added user attributes signature check");
-				}
-				count++;
-			}
+            nKey = PgpPublicKey.RemoveCertification(nKey, uVec);
 
-			if (count != 1)
-			{
-				Fail("didn't find added user attributes");
-			}
-
-			nKey = PgpPublicKey.RemoveCertification(nKey, uVec);
-
-			if (nKey.GetUserAttributes().GetEnumerator().MoveNext())
-			{
-				Fail("found attributes where none expected");
-			}
-		}
+            if (nKey.GetUserAttributes().GetEnumerator().MoveNext())
+            {
+                Fail("found attributes where none expected");
+            }
+        }
 
-		public override void PerformTest()
+        public override void PerformTest()
         {
             //
             // Read the public key
             //
             PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(testPubKey);
 
-			AsymmetricKeyParameter pubKey = pgpPub.GetPublicKey().GetKey();
+            AsymmetricKeyParameter pubKey = pgpPub.GetPublicKey().GetKey();
 
-			IEnumerator enumerator = pgpPub.GetPublicKey().GetUserIds().GetEnumerator();
+            IEnumerator enumerator = pgpPub.GetPublicKey().GetUserIds().GetEnumerator();
             enumerator.MoveNext();
             string uid = (string) enumerator.Current;
 
@@ -549,87 +549,85 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
             enumerator.MoveNext();
             PgpSignature sig = (PgpSignature) enumerator.Current;
 
-			sig.InitVerify(pgpPub.GetPublicKey());
+            sig.InitVerify(pgpPub.GetPublicKey());
 
-			if (!sig.VerifyCertification(uid, pgpPub.GetPublicKey()))
+            if (!sig.VerifyCertification(uid, pgpPub.GetPublicKey()))
             {
                 Fail("failed to verify certification");
             }
 
-			//
+            //
             // write a public key
             //
             MemoryStream bOut = new UncloseableMemoryStream();
             BcpgOutputStream pOut = new BcpgOutputStream(bOut);
 
-			pgpPub.Encode(pOut);
+            pgpPub.Encode(pOut);
 
-			if (!Arrays.AreEqual(bOut.ToArray(), testPubKey))
+            if (!Arrays.AreEqual(bOut.ToArray(), testPubKey))
             {
                 Fail("public key rewrite failed");
             }
 
-			//
+            //
             // Read the public key
             //
             PgpPublicKeyRing pgpPubV3 = new PgpPublicKeyRing(testPubKeyV3);
             AsymmetricKeyParameter pubKeyV3 = pgpPub.GetPublicKey().GetKey();
 
-			//
+            //
             // write a V3 public key
             //
             bOut = new UncloseableMemoryStream();
             pOut = new BcpgOutputStream(bOut);
 
-			pgpPubV3.Encode(pOut);
+            pgpPubV3.Encode(pOut);
 
-			//
+            //
             // Read a v3 private key
             //
             char[] passP = "FIXCITY_QA".ToCharArray();
 
-#if INCLUDE_IDEA
-			{
-				PgpSecretKeyRing pgpPriv2 = new PgpSecretKeyRing(testPrivKeyV3);
-				PgpSecretKey pgpPrivSecretKey = pgpPriv2.GetSecretKey();
-				PgpPrivateKey pgpPrivKey2 = pgpPrivSecretKey.ExtractPrivateKey(passP);
-
-				//
-				// write a v3 private key
-				//
-				bOut = new UncloseableMemoryStream();
-				pOut = new BcpgOutputStream(bOut);
-
-				pgpPriv2.Encode(pOut);
-
-				byte[] result = bOut.ToArray();
-				if (!Arrays.AreEqual(result, testPrivKeyV3))
-				{
-					Fail("private key V3 rewrite failed");
-				}
-			}
-#endif
-
-			//
+            {
+                PgpSecretKeyRing pgpPriv2 = new PgpSecretKeyRing(testPrivKeyV3);
+                PgpSecretKey pgpPrivSecretKey = pgpPriv2.GetSecretKey();
+                PgpPrivateKey pgpPrivKey2 = pgpPrivSecretKey.ExtractPrivateKey(passP);
+
+                //
+                // write a v3 private key
+                //
+                bOut = new UncloseableMemoryStream();
+                pOut = new BcpgOutputStream(bOut);
+
+                pgpPriv2.Encode(pOut);
+
+                byte[] result = bOut.ToArray();
+                if (!Arrays.AreEqual(result, testPrivKeyV3))
+                {
+                    Fail("private key V3 rewrite failed");
+                }
+            }
+
+            //
             // Read the private key
             //
             PgpSecretKeyRing pgpPriv = new PgpSecretKeyRing(testPrivKey);
             PgpPrivateKey pgpPrivKey = pgpPriv.GetSecretKey().ExtractPrivateKey(pass);
 
-			//
+            //
             // write a private key
             //
             bOut = new UncloseableMemoryStream();
             pOut = new BcpgOutputStream(bOut);
 
-			pgpPriv.Encode(pOut);
+            pgpPriv.Encode(pOut);
 
-			if (!Arrays.AreEqual(bOut.ToArray(), testPrivKey))
+            if (!Arrays.AreEqual(bOut.ToArray(), testPrivKey))
             {
                 Fail("private key rewrite failed");
             }
 
-			//
+            //
             // test encryption
             //
             IBufferedCipher c = CipherUtilities.GetCipher("RSA");
@@ -637,186 +635,186 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
 //                c.Init(Cipher.ENCRYPT_MODE, pubKey);
             c.Init(true, pubKey);
 
-			byte[] inBytes = Encoding.ASCII.GetBytes("hello world");
-			byte[] outBytes = c.DoFinal(inBytes);
+            byte[] inBytes = Encoding.ASCII.GetBytes("hello world");
+            byte[] outBytes = c.DoFinal(inBytes);
 
 //                c.Init(Cipher.DECRYPT_MODE, pgpPrivKey.GetKey());
             c.Init(false, pgpPrivKey.Key);
 
             outBytes = c.DoFinal(outBytes);
 
-			if (!Arrays.AreEqual(inBytes, outBytes))
+            if (!Arrays.AreEqual(inBytes, outBytes))
             {
                 Fail("decryption failed.");
             }
 
-			//
+            //
             // test signature message
             //
             PgpObjectFactory pgpFact = new PgpObjectFactory(sig1);
 
-			PgpCompressedData c1 = (PgpCompressedData)pgpFact.NextPgpObject();
+            PgpCompressedData c1 = (PgpCompressedData)pgpFact.NextPgpObject();
 
-			pgpFact = new PgpObjectFactory(c1.GetDataStream());
+            pgpFact = new PgpObjectFactory(c1.GetDataStream());
 
-			PgpOnePassSignatureList p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
+            PgpOnePassSignatureList p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
 
-			PgpOnePassSignature ops = p1[0];
+            PgpOnePassSignature ops = p1[0];
 
-			PgpLiteralData p2 = (PgpLiteralData)pgpFact.NextPgpObject();
+            PgpLiteralData p2 = (PgpLiteralData)pgpFact.NextPgpObject();
 
-			Stream dIn = p2.GetInputStream();
+            Stream dIn = p2.GetInputStream();
 
-			ops.InitVerify(pgpPub.GetPublicKey(ops.KeyId));
+            ops.InitVerify(pgpPub.GetPublicKey(ops.KeyId));
 
-			int ch;
-			while ((ch = dIn.ReadByte()) >= 0)
+            int ch;
+            while ((ch = dIn.ReadByte()) >= 0)
             {
                 ops.Update((byte)ch);
             }
 
-			PgpSignatureList p3 = (PgpSignatureList)pgpFact.NextPgpObject();
+            PgpSignatureList p3 = (PgpSignatureList)pgpFact.NextPgpObject();
 
-			if (!ops.Verify(p3[0]))
+            if (!ops.Verify(p3[0]))
             {
                 Fail("Failed signature check");
             }
 
-			//
+            //
             // encrypted message - read subkey
             //
             pgpPriv = new PgpSecretKeyRing(subKey);
 
-			//
+            //
             // encrypted message
             //
-			byte[] text = Encoding.ASCII.GetBytes("hello world!\n");
+            byte[] text = Encoding.ASCII.GetBytes("hello world!\n");
 
-			PgpObjectFactory pgpF = new PgpObjectFactory(enc1);
+            PgpObjectFactory pgpF = new PgpObjectFactory(enc1);
 
-			PgpEncryptedDataList encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
+            PgpEncryptedDataList encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
 
-			PgpPublicKeyEncryptedData encP = (PgpPublicKeyEncryptedData)encList[0];
+            PgpPublicKeyEncryptedData encP = (PgpPublicKeyEncryptedData)encList[0];
 
-			pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
+            pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
 
-			Stream clear = encP.GetDataStream(pgpPrivKey);
+            Stream clear = encP.GetDataStream(pgpPrivKey);
 
-			pgpFact = new PgpObjectFactory(clear);
+            pgpFact = new PgpObjectFactory(clear);
 
-			c1 = (PgpCompressedData)pgpFact.NextPgpObject();
+            c1 = (PgpCompressedData)pgpFact.NextPgpObject();
 
-			pgpFact = new PgpObjectFactory(c1.GetDataStream());
+            pgpFact = new PgpObjectFactory(c1.GetDataStream());
 
-			PgpLiteralData ld = (PgpLiteralData)pgpFact.NextPgpObject();
+            PgpLiteralData ld = (PgpLiteralData)pgpFact.NextPgpObject();
 
-			if (!ld.FileName.Equals("test.txt"))
+            if (!ld.FileName.Equals("test.txt"))
             {
                 throw new Exception("wrong filename in packet");
             }
 
-			Stream inLd = ld.GetDataStream();
-			byte[] bytes = Streams.ReadAll(inLd);
+            Stream inLd = ld.GetDataStream();
+            byte[] bytes = Streams.ReadAll(inLd);
 
-			if (!Arrays.AreEqual(bytes, text))
+            if (!Arrays.AreEqual(bytes, text))
             {
                 Fail("wrong plain text in decrypted packet");
             }
 
-			//
+            //
             // encrypt - short message
             //
             byte[] shortText = { (byte)'h', (byte)'e', (byte)'l', (byte)'l', (byte)'o' };
 
-			MemoryStream cbOut = new UncloseableMemoryStream();
+            MemoryStream cbOut = new UncloseableMemoryStream();
             PgpEncryptedDataGenerator cPk = new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.Cast5, new SecureRandom());
             PgpPublicKey puK = pgpPriv.GetSecretKey(encP.KeyId).PublicKey;
 
-			cPk.AddMethod(puK);
+            cPk.AddMethod(puK);
 
-			Stream cOut = cPk.Open(new UncloseableStream(cbOut), shortText.Length);
+            Stream cOut = cPk.Open(new UncloseableStream(cbOut), shortText.Length);
 
-			cOut.Write(shortText, 0, shortText.Length);
+            cOut.Write(shortText, 0, shortText.Length);
 
-			cOut.Close();
+            cOut.Close();
 
-			pgpF = new PgpObjectFactory(cbOut.ToArray());
+            pgpF = new PgpObjectFactory(cbOut.ToArray());
 
-			encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
+            encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
 
-			encP = (PgpPublicKeyEncryptedData)encList[0];
+            encP = (PgpPublicKeyEncryptedData)encList[0];
 
-			pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
+            pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
 
-			if (encP.GetSymmetricAlgorithm(pgpPrivKey) != SymmetricKeyAlgorithmTag.Cast5)
-			{
-				Fail("symmetric algorithm mismatch");
-			}
+            if (encP.GetSymmetricAlgorithm(pgpPrivKey) != SymmetricKeyAlgorithmTag.Cast5)
+            {
+                Fail("symmetric algorithm mismatch");
+            }
 
-			clear = encP.GetDataStream(pgpPrivKey);
-			outBytes = Streams.ReadAll(clear);
+            clear = encP.GetDataStream(pgpPrivKey);
+            outBytes = Streams.ReadAll(clear);
 
-			if (!Arrays.AreEqual(outBytes, shortText))
+            if (!Arrays.AreEqual(outBytes, shortText))
             {
                 Fail("wrong plain text in generated short text packet");
             }
 
-			//
+            //
             // encrypt
             //
             cbOut = new UncloseableMemoryStream();
             cPk = new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.Cast5, new SecureRandom());
             puK = pgpPriv.GetSecretKey(encP.KeyId).PublicKey;
 
-			cPk.AddMethod(puK);
+            cPk.AddMethod(puK);
 
-			cOut = cPk.Open(new UncloseableStream(cbOut), text.Length);
+            cOut = cPk.Open(new UncloseableStream(cbOut), text.Length);
 
-			cOut.Write(text, 0, text.Length);
+            cOut.Write(text, 0, text.Length);
 
-			cOut.Close();
+            cOut.Close();
 
-			pgpF = new PgpObjectFactory(cbOut.ToArray());
+            pgpF = new PgpObjectFactory(cbOut.ToArray());
 
-			encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
+            encList = (PgpEncryptedDataList)pgpF.NextPgpObject();
 
-			encP = (PgpPublicKeyEncryptedData)encList[0];
+            encP = (PgpPublicKeyEncryptedData)encList[0];
 
-			pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
+            pgpPrivKey = pgpPriv.GetSecretKey(encP.KeyId).ExtractPrivateKey(pass);
 
-			clear = encP.GetDataStream(pgpPrivKey);
-			outBytes = Streams.ReadAll(clear);
+            clear = encP.GetDataStream(pgpPrivKey);
+            outBytes = Streams.ReadAll(clear);
 
-			if (!Arrays.AreEqual(outBytes, text))
+            if (!Arrays.AreEqual(outBytes, text))
             {
                 Fail("wrong plain text in generated packet");
             }
 
-			//
+            //
             // read public key with sub key.
             //
             pgpF = new PgpObjectFactory(subPubKey);
             object o;
             while ((o = pgpFact.NextPgpObject()) != null)
             {
-				// TODO Should something be tested here?
+                // TODO Should something be tested here?
                 // Console.WriteLine(o);
             }
 
-			//
+            //
             // key pair generation - CAST5 encryption
             //
             char[] passPhrase = "hello".ToCharArray();
             IAsymmetricCipherKeyPairGenerator kpg = GeneratorUtilities.GetKeyPairGenerator("RSA");
             RsaKeyGenerationParameters genParam = new RsaKeyGenerationParameters(
-				BigInteger.ValueOf(0x10001), new SecureRandom(), 1024, 25);
+                BigInteger.ValueOf(0x10001), new SecureRandom(), 1024, 25);
 
-			kpg.Init(genParam);
+            kpg.Init(genParam);
 
 
-			AsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();
+            AsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();
 
-			PgpSecretKey secretKey = new PgpSecretKey(
+            PgpSecretKey secretKey = new PgpSecretKey(
                 PgpSignature.DefaultCertification,
                 PublicKeyAlgorithmTag.RsaGeneral,
                 kp.Public,
@@ -830,10 +828,10 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
                 new SecureRandom()
                 );
 
-			PgpPublicKey key = secretKey.PublicKey;
+            PgpPublicKey key = secretKey.PublicKey;
 
 
-			enumerator = key.GetUserIds().GetEnumerator();
+            enumerator = key.GetUserIds().GetEnumerator();
             enumerator.MoveNext();
             uid = (string) enumerator.Current;
 
@@ -860,212 +858,212 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
 
             byte[] keyEnc = key.GetEncoded();
 
-			key = PgpPublicKey.AddCertification(key, uid, sig);
+            key = PgpPublicKey.AddCertification(key, uid, sig);
 
-			keyEnc = key.GetEncoded();
+            keyEnc = key.GetEncoded();
 
-			PgpSignatureGenerator sGen = new PgpSignatureGenerator(PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
+            PgpSignatureGenerator sGen = new PgpSignatureGenerator(PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
 
-			sGen.InitSign(PgpSignature.KeyRevocation, secretKey.ExtractPrivateKey(passPhrase));
+            sGen.InitSign(PgpSignature.KeyRevocation, secretKey.ExtractPrivateKey(passPhrase));
 
-			sig = sGen.GenerateCertification(key);
+            sig = sGen.GenerateCertification(key);
 
-			key = PgpPublicKey.AddCertification(key, sig);
+            key = PgpPublicKey.AddCertification(key, sig);
 
-			keyEnc = key.GetEncoded();
+            keyEnc = key.GetEncoded();
 
-			PgpPublicKeyRing tmpRing = new PgpPublicKeyRing(keyEnc);
+            PgpPublicKeyRing tmpRing = new PgpPublicKeyRing(keyEnc);
 
-			key = tmpRing.GetPublicKey();
+            key = tmpRing.GetPublicKey();
 
-			IEnumerator sgEnum = key.GetSignaturesOfType(PgpSignature.KeyRevocation).GetEnumerator();
+            IEnumerator sgEnum = key.GetSignaturesOfType(PgpSignature.KeyRevocation).GetEnumerator();
             sgEnum.MoveNext();
             sig = (PgpSignature) sgEnum.Current;
 
-			sig.InitVerify(key);
+            sig.InitVerify(key);
 
-			if (!sig.VerifyCertification(key))
+            if (!sig.VerifyCertification(key))
             {
                 Fail("failed to verify revocation certification");
             }
 
-			//
+            //
             // use of PgpKeyPair
             //
             PgpKeyPair pgpKp = new PgpKeyPair(PublicKeyAlgorithmTag.RsaGeneral,
-				kp.Public, kp.Private, DateTime.UtcNow);
+                kp.Public, kp.Private, DateTime.UtcNow);
 
-			PgpPublicKey k1 = pgpKp.PublicKey;
+            PgpPublicKey k1 = pgpKp.PublicKey;
             PgpPrivateKey k2 = pgpKp.PrivateKey;
 
             k1.GetEncoded();
 
-			MixedTest(k2, k1);
+            MixedTest(k2, k1);
 
-			//
+            //
             // key pair generation - AES_256 encryption.
             //
             kp = kpg.GenerateKeyPair();
 
-			secretKey = new PgpSecretKey(PgpSignature.DefaultCertification, PublicKeyAlgorithmTag.RsaGeneral, kp.Public, kp.Private, DateTime.UtcNow, "fred", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, new SecureRandom());
+            secretKey = new PgpSecretKey(PgpSignature.DefaultCertification, PublicKeyAlgorithmTag.RsaGeneral, kp.Public, kp.Private, DateTime.UtcNow, "fred", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, new SecureRandom());
 
-			secretKey.ExtractPrivateKey(passPhrase);
+            secretKey.ExtractPrivateKey(passPhrase);
 
-			secretKey.Encode(new UncloseableMemoryStream());
+            secretKey.Encode(new UncloseableMemoryStream());
 
-			//
+            //
             // secret key password changing.
             //
             const string newPass = "newPass";
 
-			secretKey = PgpSecretKey.CopyWithNewPassword(secretKey, passPhrase, newPass.ToCharArray(), secretKey.KeyEncryptionAlgorithm, new SecureRandom());
+            secretKey = PgpSecretKey.CopyWithNewPassword(secretKey, passPhrase, newPass.ToCharArray(), secretKey.KeyEncryptionAlgorithm, new SecureRandom());
 
-			secretKey.ExtractPrivateKey(newPass.ToCharArray());
+            secretKey.ExtractPrivateKey(newPass.ToCharArray());
 
-			secretKey.Encode(new UncloseableMemoryStream());
+            secretKey.Encode(new UncloseableMemoryStream());
 
-			key = secretKey.PublicKey;
+            key = secretKey.PublicKey;
 
-			key.Encode(new UncloseableMemoryStream());
+            key.Encode(new UncloseableMemoryStream());
 
 
-			enumerator = key.GetUserIds().GetEnumerator();
+            enumerator = key.GetUserIds().GetEnumerator();
             enumerator.MoveNext();
             uid = (string) enumerator.Current;
 
 
-			enumerator = key.GetSignaturesForId(uid).GetEnumerator();
+            enumerator = key.GetSignaturesForId(uid).GetEnumerator();
             enumerator.MoveNext();
             sig = (PgpSignature) enumerator.Current;
 
-			sig.InitVerify(key);
+            sig.InitVerify(key);
 
-			if (!sig.VerifyCertification(uid, key))
+            if (!sig.VerifyCertification(uid, key))
             {
                 Fail("failed to verify certification");
             }
 
-			pgpPrivKey = secretKey.ExtractPrivateKey(newPass.ToCharArray());
+            pgpPrivKey = secretKey.ExtractPrivateKey(newPass.ToCharArray());
 
-			//
+            //
             // signature generation
             //
             const string data = "hello world!";
             byte[] dataBytes = Encoding.ASCII.GetBytes(data);
 
-			bOut = new UncloseableMemoryStream();
+            bOut = new UncloseableMemoryStream();
 
-			MemoryStream testIn = new MemoryStream(dataBytes, false);
+            MemoryStream testIn = new MemoryStream(dataBytes, false);
 
-			sGen = new PgpSignatureGenerator(
-				PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
+            sGen = new PgpSignatureGenerator(
+                PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
 
-			sGen.InitSign(PgpSignature.BinaryDocument, pgpPrivKey);
+            sGen.InitSign(PgpSignature.BinaryDocument, pgpPrivKey);
 
-			PgpCompressedDataGenerator cGen = new PgpCompressedDataGenerator(
-				CompressionAlgorithmTag.Zip);
+            PgpCompressedDataGenerator cGen = new PgpCompressedDataGenerator(
+                CompressionAlgorithmTag.Zip);
 
-			BcpgOutputStream bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
+            BcpgOutputStream bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
 
-			sGen.GenerateOnePassVersion(false).Encode(bcOut);
+            sGen.GenerateOnePassVersion(false).Encode(bcOut);
 
-			PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
+            PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
 
-			DateTime testDateTime = new DateTime(1973, 7, 27);
-			Stream lOut = lGen.Open(new UncloseableStream(bcOut), PgpLiteralData.Binary, "_CONSOLE",
+            DateTime testDateTime = new DateTime(1973, 7, 27);
+            Stream lOut = lGen.Open(new UncloseableStream(bcOut), PgpLiteralData.Binary, "_CONSOLE",
                 dataBytes.Length, testDateTime);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			while ((ch = testIn.ReadByte()) >= 0)
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            while ((ch = testIn.ReadByte()) >= 0)
             {
                 lOut.WriteByte((byte)ch);
                 sGen.Update((byte)ch);
             }
 
-			lOut.Close();
+            lOut.Close();
 
-			sGen.Generate().Encode(bcOut);
+            sGen.Generate().Encode(bcOut);
 
-			bcOut.Close();
+            bcOut.Close();
 
-			//
+            //
             // verify generated signature
             //
             pgpFact = new PgpObjectFactory(bOut.ToArray());
 
-			c1 = (PgpCompressedData)pgpFact.NextPgpObject();
+            c1 = (PgpCompressedData)pgpFact.NextPgpObject();
 
-			pgpFact = new PgpObjectFactory(c1.GetDataStream());
+            pgpFact = new PgpObjectFactory(c1.GetDataStream());
 
-			p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
+            p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
 
-			ops = p1[0];
+            ops = p1[0];
 
-			p2 = (PgpLiteralData)pgpFact.NextPgpObject();
-			if (!p2.ModificationTime.Equals(testDateTime))
-			{
-				Fail("Modification time not preserved");
-			}
+            p2 = (PgpLiteralData)pgpFact.NextPgpObject();
+            if (!p2.ModificationTime.Equals(testDateTime))
+            {
+                Fail("Modification time not preserved");
+            }
 
-			dIn = p2.GetInputStream();
+            dIn = p2.GetInputStream();
 
-			ops.InitVerify(secretKey.PublicKey);
+            ops.InitVerify(secretKey.PublicKey);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			while ((ch = dIn.ReadByte()) >= 0)
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            while ((ch = dIn.ReadByte()) >= 0)
             {
                 ops.Update((byte)ch);
             }
 
-			p3 = (PgpSignatureList)pgpFact.NextPgpObject();
+            p3 = (PgpSignatureList)pgpFact.NextPgpObject();
 
-			if (!ops.Verify(p3[0]))
+            if (!ops.Verify(p3[0]))
             {
                 Fail("Failed generated signature check");
             }
 
-			//
+            //
             // signature generation - version 3
             //
             bOut = new UncloseableMemoryStream();
 
-			testIn = new MemoryStream(dataBytes);
+            testIn = new MemoryStream(dataBytes);
             PgpV3SignatureGenerator sGenV3 = new PgpV3SignatureGenerator(
                 PublicKeyAlgorithmTag.RsaGeneral, HashAlgorithmTag.Sha1);
 
-			sGen.InitSign(PgpSignature.BinaryDocument, pgpPrivKey);
+            sGen.InitSign(PgpSignature.BinaryDocument, pgpPrivKey);
 
-			cGen = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);
+            cGen = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);
 
-			bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
+            bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
 
-			sGen.GenerateOnePassVersion(false).Encode(bcOut);
+            sGen.GenerateOnePassVersion(false).Encode(bcOut);
 
-			lGen = new PgpLiteralDataGenerator();
-			lOut = lGen.Open(
-				new UncloseableStream(bcOut),
-				PgpLiteralData.Binary,
-				"_CONSOLE",
-				dataBytes.Length,
-				testDateTime);
+            lGen = new PgpLiteralDataGenerator();
+            lOut = lGen.Open(
+                new UncloseableStream(bcOut),
+                PgpLiteralData.Binary,
+                "_CONSOLE",
+                dataBytes.Length,
+                testDateTime);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			while ((ch = testIn.ReadByte()) >= 0)
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            while ((ch = testIn.ReadByte()) >= 0)
             {
                 lOut.WriteByte((byte) ch);
                 sGen.Update((byte)ch);
             }
 
-			lOut.Close();
+            lOut.Close();
 
-			sGen.Generate().Encode(bcOut);
+            sGen.Generate().Encode(bcOut);
 
-			bcOut.Close();
+            bcOut.Close();
 
-			//
+            //
             // verify generated signature
             //
             pgpFact = new PgpObjectFactory(bOut.ToArray());
@@ -1079,18 +1077,18 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
             ops = p1[0];
 
             p2 = (PgpLiteralData)pgpFact.NextPgpObject();
-			if (!p2.ModificationTime.Equals(testDateTime))
-			{
-				Fail("Modification time not preserved");
-			}
+            if (!p2.ModificationTime.Equals(testDateTime))
+            {
+                Fail("Modification time not preserved");
+            }
 
             dIn = p2.GetInputStream();
 
             ops.InitVerify(secretKey.PublicKey);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			while ((ch = dIn.ReadByte()) >= 0)
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            while ((ch = dIn.ReadByte()) >= 0)
             {
                 ops.Update((byte)ch);
             }
@@ -1102,27 +1100,27 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
                 Fail("Failed v3 generated signature check");
             }
 
-			//
+            //
             // extract PGP 8 private key
             //
             pgpPriv = new PgpSecretKeyRing(pgp8Key);
 
-			secretKey = pgpPriv.GetSecretKey();
+            secretKey = pgpPriv.GetSecretKey();
 
-			pgpPrivKey = secretKey.ExtractPrivateKey(pgp8Pass);
+            pgpPrivKey = secretKey.ExtractPrivateKey(pgp8Pass);
 
-			//
+            //
             // other sig tests
             //
             PerformTestSig(HashAlgorithmTag.Sha256, secretKey.PublicKey, pgpPrivKey);
-			PerformTestSig(HashAlgorithmTag.Sha384, secretKey.PublicKey, pgpPrivKey);
-			PerformTestSig(HashAlgorithmTag.Sha512, secretKey.PublicKey, pgpPrivKey);
-			FingerPrintTest();
-			ExistingEmbeddedJpegTest();
-			EmbeddedJpegTest();
-		}
-
-		private void PerformTestSig(
+            PerformTestSig(HashAlgorithmTag.Sha384, secretKey.PublicKey, pgpPrivKey);
+            PerformTestSig(HashAlgorithmTag.Sha512, secretKey.PublicKey, pgpPrivKey);
+            FingerPrintTest();
+            ExistingEmbeddedJpegTest();
+            EmbeddedJpegTest();
+        }
+
+        private void PerformTestSig(
             HashAlgorithmTag	hashAlgorithm,
             PgpPublicKey		pubKey,
             PgpPrivateKey		privKey)
@@ -1130,101 +1128,101 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
             const string data = "hello world!";
             byte[] dataBytes = Encoding.ASCII.GetBytes(data);
 
-			MemoryStream bOut = new UncloseableMemoryStream();
+            MemoryStream bOut = new UncloseableMemoryStream();
             MemoryStream testIn = new MemoryStream(dataBytes, false);
             PgpSignatureGenerator sGen = new PgpSignatureGenerator(PublicKeyAlgorithmTag.RsaGeneral, hashAlgorithm);
 
-			sGen.InitSign(PgpSignature.BinaryDocument, privKey);
+            sGen.InitSign(PgpSignature.BinaryDocument, privKey);
 
-			PgpCompressedDataGenerator cGen = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);
+            PgpCompressedDataGenerator cGen = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);
 
-			BcpgOutputStream bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
+            BcpgOutputStream bcOut = new BcpgOutputStream(cGen.Open(new UncloseableStream(bOut)));
 
-			sGen.GenerateOnePassVersion(false).Encode(bcOut);
+            sGen.GenerateOnePassVersion(false).Encode(bcOut);
 
-			PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
-			DateTime testDateTime = new DateTime(1973, 7, 27);
-			Stream lOut = lGen.Open(
-				new UncloseableStream(bcOut),
-				PgpLiteralData.Binary,
-				"_CONSOLE",
+            PgpLiteralDataGenerator lGen = new PgpLiteralDataGenerator();
+            DateTime testDateTime = new DateTime(1973, 7, 27);
+            Stream lOut = lGen.Open(
+                new UncloseableStream(bcOut),
+                PgpLiteralData.Binary,
+                "_CONSOLE",
                 dataBytes.Length,
-				testDateTime);
+                testDateTime);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			int ch;
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            int ch;
             while ((ch = testIn.ReadByte()) >= 0)
             {
                 lOut.WriteByte((byte)ch);
                 sGen.Update((byte)ch);
             }
 
-			lOut.Close();
+            lOut.Close();
 
-			sGen.Generate().Encode(bcOut);
+            sGen.Generate().Encode(bcOut);
 
-			bcOut.Close();
+            bcOut.Close();
 
-			//
+            //
             // verify generated signature
             //
             PgpObjectFactory pgpFact = new PgpObjectFactory(bOut.ToArray());
 
-			PgpCompressedData c1 = (PgpCompressedData)pgpFact.NextPgpObject();
+            PgpCompressedData c1 = (PgpCompressedData)pgpFact.NextPgpObject();
 
-			pgpFact = new PgpObjectFactory(c1.GetDataStream());
+            pgpFact = new PgpObjectFactory(c1.GetDataStream());
 
-			PgpOnePassSignatureList p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
+            PgpOnePassSignatureList p1 = (PgpOnePassSignatureList)pgpFact.NextPgpObject();
 
-			PgpOnePassSignature ops = p1[0];
+            PgpOnePassSignature ops = p1[0];
 
-			PgpLiteralData p2 = (PgpLiteralData)pgpFact.NextPgpObject();
-			if (!p2.ModificationTime.Equals(testDateTime))
-			{
-				Fail("Modification time not preserved");
-			}
+            PgpLiteralData p2 = (PgpLiteralData)pgpFact.NextPgpObject();
+            if (!p2.ModificationTime.Equals(testDateTime))
+            {
+                Fail("Modification time not preserved");
+            }
 
-			Stream dIn = p2.GetInputStream();
+            Stream dIn = p2.GetInputStream();
 
-			ops.InitVerify(pubKey);
+            ops.InitVerify(pubKey);
 
-			// TODO Need a stream object to automatically call Update?
-			// (via ISigner implementation of PgpSignatureGenerator)
-			while ((ch = dIn.ReadByte()) >= 0)
+            // TODO Need a stream object to automatically call Update?
+            // (via ISigner implementation of PgpSignatureGenerator)
+            while ((ch = dIn.ReadByte()) >= 0)
             {
                 ops.Update((byte)ch);
             }
 
-			PgpSignatureList p3 = (PgpSignatureList)pgpFact.NextPgpObject();
+            PgpSignatureList p3 = (PgpSignatureList)pgpFact.NextPgpObject();
 
-			if (!ops.Verify(p3[0]))
+            if (!ops.Verify(p3[0]))
             {
                 Fail("Failed generated signature check - " + hashAlgorithm);
             }
         }
 
-		private class UncloseableMemoryStream
-			: MemoryStream
-		{
-			public override void Close()
-			{
-				throw new Exception("Close() called on underlying stream");
-			}
-		}
+        private class UncloseableMemoryStream
+            : MemoryStream
+        {
+            public override void Close()
+            {
+                throw new Exception("Close() called on underlying stream");
+            }
+        }
 
-		public override string Name
+        public override string Name
         {
-			get { return "PGPRSATest"; }
+            get { return "PGPRSATest"; }
         }
 
-		public static void Main(
+        public static void Main(
             string[] args)
         {
             RunTest(new PgpRsaTest());
         }
 
-		[Test]
+        [Test]
         public void TestFunction()
         {
             string resultText = Perform().ToString();
diff --git a/crypto/test/src/openpgp/test/PgpKeyRingTest.cs b/crypto/test/src/openpgp/test/PgpKeyRingTest.cs
index b776a0d2a..2ac2f0c97 100644
--- a/crypto/test/src/openpgp/test/PgpKeyRingTest.cs
+++ b/crypto/test/src/openpgp/test/PgpKeyRingTest.cs
@@ -14,2150 +14,2148 @@ using Org.BouncyCastle.Utilities.Test;
 
 namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests
 {
-	[TestFixture]
-	public class PgpKeyRingTest
-		: SimpleTest
-	{
-		private static readonly byte[] pub1 = Base64.Decode(
-			"mQGiBEA83v0RBADzKVLVCnpWQxX0LCsevw/3OLs0H7MOcLBQ4wMO9sYmzGYn"
-			+ "xpVj+4e4PiCP7QBayWyy4lugL6Lnw7tESvq3A4v3fefcxaCTkJrryiKn4+Cg"
-			+ "y5rIBbrSKNtCEhVi7xjtdnDjP5kFKgHYjVOeIKn4Cz/yzPG3qz75kDknldLf"
-			+ "yHxp2wCgwW1vAE5EnZU4/UmY7l8kTNkMltMEAJP4/uY4zcRwLI9Q2raPqAOJ"
-			+ "TYLd7h+3k/BxI0gIw96niQ3KmUZDlobbWBI+VHM6H99vcttKU3BgevNf8M9G"
-			+ "x/AbtW3SS4De64wNSU3189XDG8vXf0vuyW/K6Pcrb8exJWY0E1zZQ1WXT0gZ"
-			+ "W0kH3g5ro//Tusuil9q2lVLF2ovJA/0W+57bPzi318dWeNs0tTq6Njbc/GTG"
-			+ "FUAVJ8Ss5v2u6h7gyJ1DB334ExF/UdqZGldp0ugkEXaSwBa2R7d3HBgaYcoP"
-			+ "Ck1TrovZzEY8gm7JNVy7GW6mdOZuDOHTxyADEEP2JPxh6eRcZbzhGuJuYIif"
-			+ "IIeLOTI5Dc4XKeV32a+bWrQidGVzdCAoVGVzdCBrZXkpIDx0ZXN0QHViaWNh"
-			+ "bGwuY29tPohkBBMRAgAkBQJAPN79AhsDBQkB4TOABgsJCAcDAgMVAgMDFgIB"
-			+ "Ah4BAheAAAoJEJh8Njfhe8KmGDcAoJWr8xgPr75y/Cp1kKn12oCCOb8zAJ4p"
-			+ "xSvk4K6tB2jYbdeSrmoWBZLdMLACAAC5AQ0EQDzfARAEAJeUAPvUzJJbKcc5"
-			+ "5Iyb13+Gfb8xBWE3HinQzhGr1v6A1aIZbRj47UPAD/tQxwz8VAwJySx82ggN"
-			+ "LxCk4jW9YtTL3uZqfczsJngV25GoIN10f4/j2BVqZAaX3q79a3eMiql1T0oE"
-			+ "AGmD7tO1LkTvWfm3VvA0+t8/6ZeRLEiIqAOHAAQNBACD0mVMlAUgd7REYy/1"
-			+ "mL99Zlu9XU0uKyUex99sJNrcx1aj8rIiZtWaHz6CN1XptdwpDeSYEOFZ0PSu"
-			+ "qH9ByM3OfjU/ya0//xdvhwYXupn6P1Kep85efMBA9jUv/DeBOzRWMFG6sC6y"
-			+ "k8NGG7Swea7EHKeQI40G3jgO/+xANtMyTIhPBBgRAgAPBQJAPN8BAhsMBQkB"
-			+ "4TOAAAoJEJh8Njfhe8KmG7kAn00mTPGJCWqmskmzgdzeky5fWd7rAKCNCp3u"
-			+ "ZJhfg0htdgAfIy8ppm05vLACAAA=");
-
-		private static readonly byte[] sec1 = Base64.Decode(
-			"lQHhBEA83v0RBADzKVLVCnpWQxX0LCsevw/3OLs0H7MOcLBQ4wMO9sYmzGYn"
-			+ "xpVj+4e4PiCP7QBayWyy4lugL6Lnw7tESvq3A4v3fefcxaCTkJrryiKn4+Cg"
-			+ "y5rIBbrSKNtCEhVi7xjtdnDjP5kFKgHYjVOeIKn4Cz/yzPG3qz75kDknldLf"
-			+ "yHxp2wCgwW1vAE5EnZU4/UmY7l8kTNkMltMEAJP4/uY4zcRwLI9Q2raPqAOJ"
-			+ "TYLd7h+3k/BxI0gIw96niQ3KmUZDlobbWBI+VHM6H99vcttKU3BgevNf8M9G"
-			+ "x/AbtW3SS4De64wNSU3189XDG8vXf0vuyW/K6Pcrb8exJWY0E1zZQ1WXT0gZ"
-			+ "W0kH3g5ro//Tusuil9q2lVLF2ovJA/0W+57bPzi318dWeNs0tTq6Njbc/GTG"
-			+ "FUAVJ8Ss5v2u6h7gyJ1DB334ExF/UdqZGldp0ugkEXaSwBa2R7d3HBgaYcoP"
-			+ "Ck1TrovZzEY8gm7JNVy7GW6mdOZuDOHTxyADEEP2JPxh6eRcZbzhGuJuYIif"
-			+ "IIeLOTI5Dc4XKeV32a+bWv4CAwJ5KgazImo+sGBfMhDiBcBTqyDGhKHNgHic"
-			+ "0Pky9FeRvfXTc2AO+jGmFPjcs8BnTWuDD0/jkQnRZpp1TrQidGVzdCAoVGVz"
-			+ "dCBrZXkpIDx0ZXN0QHViaWNhbGwuY29tPohkBBMRAgAkBQJAPN79AhsDBQkB"
-			+ "4TOABgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEJh8Njfhe8KmGDcAn3XeXDMg"
-			+ "BZgrZzFWU2IKtA/5LG2TAJ0Vf/jjyq0jZNZfGfoqGTvD2MAl0rACAACdAVgE"
-			+ "QDzfARAEAJeUAPvUzJJbKcc55Iyb13+Gfb8xBWE3HinQzhGr1v6A1aIZbRj4"
-			+ "7UPAD/tQxwz8VAwJySx82ggNLxCk4jW9YtTL3uZqfczsJngV25GoIN10f4/j"
-			+ "2BVqZAaX3q79a3eMiql1T0oEAGmD7tO1LkTvWfm3VvA0+t8/6ZeRLEiIqAOH"
-			+ "AAQNBACD0mVMlAUgd7REYy/1mL99Zlu9XU0uKyUex99sJNrcx1aj8rIiZtWa"
-			+ "Hz6CN1XptdwpDeSYEOFZ0PSuqH9ByM3OfjU/ya0//xdvhwYXupn6P1Kep85e"
-			+ "fMBA9jUv/DeBOzRWMFG6sC6yk8NGG7Swea7EHKeQI40G3jgO/+xANtMyTP4C"
-			+ "AwJ5KgazImo+sGBl2C7CFuI+5KM4ZhbtVie7l+OiTpr5JW2z5VgnV3EX9p04"
-			+ "LcGKfQvD65+ELwli6yh8B2zGcipqTaYk3QoYNIhPBBgRAgAPBQJAPN8BAhsM"
-			+ "BQkB4TOAAAoJEJh8Njfhe8KmG7kAniuRkaFFv1pdCBN8JJXpcorHmyouAJ9L"
-			+ "xxmusffR6OI7WgD3XZ0AL8zUC7ACAAA=");
+    [TestFixture]
+    public class PgpKeyRingTest
+        : SimpleTest
+    {
+        private static readonly byte[] pub1 = Base64.Decode(
+            "mQGiBEA83v0RBADzKVLVCnpWQxX0LCsevw/3OLs0H7MOcLBQ4wMO9sYmzGYn"
+            + "xpVj+4e4PiCP7QBayWyy4lugL6Lnw7tESvq3A4v3fefcxaCTkJrryiKn4+Cg"
+            + "y5rIBbrSKNtCEhVi7xjtdnDjP5kFKgHYjVOeIKn4Cz/yzPG3qz75kDknldLf"
+            + "yHxp2wCgwW1vAE5EnZU4/UmY7l8kTNkMltMEAJP4/uY4zcRwLI9Q2raPqAOJ"
+            + "TYLd7h+3k/BxI0gIw96niQ3KmUZDlobbWBI+VHM6H99vcttKU3BgevNf8M9G"
+            + "x/AbtW3SS4De64wNSU3189XDG8vXf0vuyW/K6Pcrb8exJWY0E1zZQ1WXT0gZ"
+            + "W0kH3g5ro//Tusuil9q2lVLF2ovJA/0W+57bPzi318dWeNs0tTq6Njbc/GTG"
+            + "FUAVJ8Ss5v2u6h7gyJ1DB334ExF/UdqZGldp0ugkEXaSwBa2R7d3HBgaYcoP"
+            + "Ck1TrovZzEY8gm7JNVy7GW6mdOZuDOHTxyADEEP2JPxh6eRcZbzhGuJuYIif"
+            + "IIeLOTI5Dc4XKeV32a+bWrQidGVzdCAoVGVzdCBrZXkpIDx0ZXN0QHViaWNh"
+            + "bGwuY29tPohkBBMRAgAkBQJAPN79AhsDBQkB4TOABgsJCAcDAgMVAgMDFgIB"
+            + "Ah4BAheAAAoJEJh8Njfhe8KmGDcAoJWr8xgPr75y/Cp1kKn12oCCOb8zAJ4p"
+            + "xSvk4K6tB2jYbdeSrmoWBZLdMLACAAC5AQ0EQDzfARAEAJeUAPvUzJJbKcc5"
+            + "5Iyb13+Gfb8xBWE3HinQzhGr1v6A1aIZbRj47UPAD/tQxwz8VAwJySx82ggN"
+            + "LxCk4jW9YtTL3uZqfczsJngV25GoIN10f4/j2BVqZAaX3q79a3eMiql1T0oE"
+            + "AGmD7tO1LkTvWfm3VvA0+t8/6ZeRLEiIqAOHAAQNBACD0mVMlAUgd7REYy/1"
+            + "mL99Zlu9XU0uKyUex99sJNrcx1aj8rIiZtWaHz6CN1XptdwpDeSYEOFZ0PSu"
+            + "qH9ByM3OfjU/ya0//xdvhwYXupn6P1Kep85efMBA9jUv/DeBOzRWMFG6sC6y"
+            + "k8NGG7Swea7EHKeQI40G3jgO/+xANtMyTIhPBBgRAgAPBQJAPN8BAhsMBQkB"
+            + "4TOAAAoJEJh8Njfhe8KmG7kAn00mTPGJCWqmskmzgdzeky5fWd7rAKCNCp3u"
+            + "ZJhfg0htdgAfIy8ppm05vLACAAA=");
+
+        private static readonly byte[] sec1 = Base64.Decode(
+            "lQHhBEA83v0RBADzKVLVCnpWQxX0LCsevw/3OLs0H7MOcLBQ4wMO9sYmzGYn"
+            + "xpVj+4e4PiCP7QBayWyy4lugL6Lnw7tESvq3A4v3fefcxaCTkJrryiKn4+Cg"
+            + "y5rIBbrSKNtCEhVi7xjtdnDjP5kFKgHYjVOeIKn4Cz/yzPG3qz75kDknldLf"
+            + "yHxp2wCgwW1vAE5EnZU4/UmY7l8kTNkMltMEAJP4/uY4zcRwLI9Q2raPqAOJ"
+            + "TYLd7h+3k/BxI0gIw96niQ3KmUZDlobbWBI+VHM6H99vcttKU3BgevNf8M9G"
+            + "x/AbtW3SS4De64wNSU3189XDG8vXf0vuyW/K6Pcrb8exJWY0E1zZQ1WXT0gZ"
+            + "W0kH3g5ro//Tusuil9q2lVLF2ovJA/0W+57bPzi318dWeNs0tTq6Njbc/GTG"
+            + "FUAVJ8Ss5v2u6h7gyJ1DB334ExF/UdqZGldp0ugkEXaSwBa2R7d3HBgaYcoP"
+            + "Ck1TrovZzEY8gm7JNVy7GW6mdOZuDOHTxyADEEP2JPxh6eRcZbzhGuJuYIif"
+            + "IIeLOTI5Dc4XKeV32a+bWv4CAwJ5KgazImo+sGBfMhDiBcBTqyDGhKHNgHic"
+            + "0Pky9FeRvfXTc2AO+jGmFPjcs8BnTWuDD0/jkQnRZpp1TrQidGVzdCAoVGVz"
+            + "dCBrZXkpIDx0ZXN0QHViaWNhbGwuY29tPohkBBMRAgAkBQJAPN79AhsDBQkB"
+            + "4TOABgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEJh8Njfhe8KmGDcAn3XeXDMg"
+            + "BZgrZzFWU2IKtA/5LG2TAJ0Vf/jjyq0jZNZfGfoqGTvD2MAl0rACAACdAVgE"
+            + "QDzfARAEAJeUAPvUzJJbKcc55Iyb13+Gfb8xBWE3HinQzhGr1v6A1aIZbRj4"
+            + "7UPAD/tQxwz8VAwJySx82ggNLxCk4jW9YtTL3uZqfczsJngV25GoIN10f4/j"
+            + "2BVqZAaX3q79a3eMiql1T0oEAGmD7tO1LkTvWfm3VvA0+t8/6ZeRLEiIqAOH"
+            + "AAQNBACD0mVMlAUgd7REYy/1mL99Zlu9XU0uKyUex99sJNrcx1aj8rIiZtWa"
+            + "Hz6CN1XptdwpDeSYEOFZ0PSuqH9ByM3OfjU/ya0//xdvhwYXupn6P1Kep85e"
+            + "fMBA9jUv/DeBOzRWMFG6sC6yk8NGG7Swea7EHKeQI40G3jgO/+xANtMyTP4C"
+            + "AwJ5KgazImo+sGBl2C7CFuI+5KM4ZhbtVie7l+OiTpr5JW2z5VgnV3EX9p04"
+            + "LcGKfQvD65+ELwli6yh8B2zGcipqTaYk3QoYNIhPBBgRAgAPBQJAPN8BAhsM"
+            + "BQkB4TOAAAoJEJh8Njfhe8KmG7kAniuRkaFFv1pdCBN8JJXpcorHmyouAJ9L"
+            + "xxmusffR6OI7WgD3XZ0AL8zUC7ACAAA=");
 
 //		private static readonly char[] pass1 = "qwertzuiop".ToCharArray();
 
-		private static readonly byte[] pub2 = Base64.Decode(
-			"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");
-
-		private static readonly byte[] sec2 = Base64.Decode(
-			"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"
-			+ "Nifs+ljmsAFn");
-
-		private static readonly char[] sec2pass1 = "sandhya".ToCharArray();
-		private static readonly char[] sec2pass2 = "psai".ToCharArray();
-
-		private static readonly byte[] pub3 = Base64.Decode(
-			"mQGiBEB9BH0RBACtYQtE7tna6hgGyGLpq+ds3r2cLC0ISn5dNw7tm9vwiNVF"
-			+ "JA2N37RRrifw4PvgelRSvLaX3M3ZBqC9s1Metg3v4FSlIRtSLWCNpHSvNw7i"
-			+ "X8C2Xy9Hdlbh6Y/50o+iscojLRE14upfR1bIkcCZQGSyvGV52V2wBImUUZjV"
-			+ "s2ZngwCg7mu852vK7+euz4WaL7ERVYtq9CMEAJ5swrljerDpz/RQ4Lhp6KER"
-			+ "KyuI0PUttO57xINGshEINgYlZdGaZHRueHe7uKfI19mb0T4N3NJWaZ0wF+Cn"
-			+ "rixsq0VrTUfiwfZeGluNG73aTCeY45fVXMGTTSYXzS8T0LW100Xn/0g9HRyA"
-			+ "xUpuWo8IazxkMqHJis2uwriYKpAfA/9anvj5BS9p5pfPjp9dGM7GTMIYl5f2"
-			+ "fcP57f+AW1TVR6IZiMJAvAdeWuLtwLnJiFpGlnFz273pfl+sAuqm1yNceImR"
-			+ "2SDDP4+vtyycWy8nZhgEuhZx3W3cWMQz5WyNJSY1JJHh9TCQkCoN8E7XpVP4"
-			+ "zEPboB2GzD93mfD8JLHP+7QtVGVzdCBLZXkgKG5vIGNvbW1lbnQpIDx0ZXN0"
-			+ "QGJvdW5jeWNhc3RsZS5vcmc+iFkEExECABkFAkB9BH0ECwcDAgMVAgMDFgIB"
-			+ "Ah4BAheAAAoJEKnMV8vjZQOpSRQAnidAQswYkrXQAFcLBzhxQTknI9QMAKDR"
-			+ "ryV3l6xuCCgHST8JlxpbjcXhlLACAAPRwXPBcQEQAAEBAAAAAAAAAAAAAAAA"
-			+ "/9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q"
-			+ "/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAi"
-			+ "LCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIy"
-			+ "MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy"
-			+ "MjIy/8AAEQgAFAAUAwEiAAIRAQMRAf/EABoAAQACAwEAAAAAAAAAAAAAAAAE"
-			+ "BQIDBgf/xAAoEAABAgUDBAEFAAAAAAAAAAABAgMABBEhMQUSQQYTIiNhFFGB"
-			+ "kcH/xAAXAQEAAwAAAAAAAAAAAAAAAAAEAgMF/8QAJBEAAQQAAwkAAAAAAAAA"
-			+ "AAAAAQACERIEIfATMTJBUZGx0fH/2gAMAwEAAhEDEQA/APMuotJlJVxstqaP"
-			+ "o22NlAUp+YsNO0qSUtBcMu6n6EtOHcfPAHHFI16++oajQtTA3DapK02HFR8U"
-			+ "pE9pTbQWtKm2WG2rlxVyQTcfGbn7Qm0OIjL77Wrs2NNm9lzTmmSxQ0PX4opS"
-			+ "prk5tmESF6syggzGwOLG6gXgHFbZhBixk8XlIDcOQLRKt+rX+3qC5ZLTQblp"
-			+ "Qlvwvxn9CMpZturVGkJHapQJphRH8hCLXbzrqpYsCx1zC5rtpJNuYQhASc0U"
-			+ "AQv/2YhcBBMRAgAcBQJAfQV+AhsDBAsHAwIDFQIDAxYCAQIeAQIXgAAKCRCp"
-			+ "zFfL42UDqfa2AJ9hjtEeDTbTEAuuSbzhYFxN/qc0FACgsmzysdbBpuN65yK0"
-			+ "1tbEaeIMtqCwAgADuM0EQH0EfhADAKpG5Y6vGbm//xZYG08RRmdi67dZjF59"
-			+ "Eqfo43mRrliangB8qkqoqqf3za2OUbXcZUQ/ajDXUvjJAoY2b5XJURqmbtKk"
-			+ "wPRIeD2+wnKABat8wmcFhZKATX1bqjdyRRGxawADBgMAoMJKJLELdnn885oJ"
-			+ "6HDmIez++ZWTlafzfUtJkQTCRKiE0NsgSvKJr/20VdK3XUA/iy0m1nQwfzv/"
-			+ "okFuIhEPgldzH7N/NyEvtN5zOv/TpAymFKewAQ26luEu6l+lH4FsiEYEGBEC"
-			+ "AAYFAkB9BH4ACgkQqcxXy+NlA6mtMgCgtQMFBaKymktM+DQmCgy2qjW7WY0A"
-			+ "n3FaE6UZE9GMDmCIAjhI+0X9aH6CsAIAAw==");
-
-		private static readonly byte[] sec3 = Base64.Decode(
-			"lQHhBEB9BH0RBACtYQtE7tna6hgGyGLpq+ds3r2cLC0ISn5dNw7tm9vwiNVF"
-			+ "JA2N37RRrifw4PvgelRSvLaX3M3ZBqC9s1Metg3v4FSlIRtSLWCNpHSvNw7i"
-			+ "X8C2Xy9Hdlbh6Y/50o+iscojLRE14upfR1bIkcCZQGSyvGV52V2wBImUUZjV"
-			+ "s2ZngwCg7mu852vK7+euz4WaL7ERVYtq9CMEAJ5swrljerDpz/RQ4Lhp6KER"
-			+ "KyuI0PUttO57xINGshEINgYlZdGaZHRueHe7uKfI19mb0T4N3NJWaZ0wF+Cn"
-			+ "rixsq0VrTUfiwfZeGluNG73aTCeY45fVXMGTTSYXzS8T0LW100Xn/0g9HRyA"
-			+ "xUpuWo8IazxkMqHJis2uwriYKpAfA/9anvj5BS9p5pfPjp9dGM7GTMIYl5f2"
-			+ "fcP57f+AW1TVR6IZiMJAvAdeWuLtwLnJiFpGlnFz273pfl+sAuqm1yNceImR"
-			+ "2SDDP4+vtyycWy8nZhgEuhZx3W3cWMQz5WyNJSY1JJHh9TCQkCoN8E7XpVP4"
-			+ "zEPboB2GzD93mfD8JLHP+/4DAwIvYrn+YqRaaGAu19XUj895g/GROyP8WEaU"
-			+ "Bd/JNqWc4kE/0guetGnPzq7G3bLVwiKfFd4X7BrgHAo3mrQtVGVzdCBLZXkg"
-			+ "KG5vIGNvbW1lbnQpIDx0ZXN0QGJvdW5jeWNhc3RsZS5vcmc+iFkEExECABkF"
-			+ "AkB9BH0ECwcDAgMVAgMDFgIBAh4BAheAAAoJEKnMV8vjZQOpSRQAoKZy6YS1"
-			+ "irF5/Q3JlWiwbkN6dEuLAJ9lldRLOlXsuQ5JW1+SLEc6K9ho4rACAADRwXPB"
-			+ "cQEQAAEBAAAAAAAAAAAAAAAA/9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3Jl"
-			+ "YXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZ"
-			+ "EhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sA"
-			+ "QwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy"
-			+ "MjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAFAAUAwEiAAIRAQMRAf/EABoA"
-			+ "AQACAwEAAAAAAAAAAAAAAAAEBQIDBgf/xAAoEAABAgUDBAEFAAAAAAAAAAAB"
-			+ "AgMABBEhMQUSQQYTIiNhFFGBkcH/xAAXAQEAAwAAAAAAAAAAAAAAAAAEAgMF"
-			+ "/8QAJBEAAQQAAwkAAAAAAAAAAAAAAQACERIEIfATMTJBUZGx0fH/2gAMAwEA"
-			+ "AhEDEQA/APMuotJlJVxstqaPo22NlAUp+YsNO0qSUtBcMu6n6EtOHcfPAHHF"
-			+ "I16++oajQtTA3DapK02HFR8UpE9pTbQWtKm2WG2rlxVyQTcfGbn7Qm0OIjL7"
-			+ "7Wrs2NNm9lzTmmSxQ0PX4opSprk5tmESF6syggzGwOLG6gXgHFbZhBixk8Xl"
-			+ "IDcOQLRKt+rX+3qC5ZLTQblpQlvwvxn9CMpZturVGkJHapQJphRH8hCLXbzr"
-			+ "qpYsCx1zC5rtpJNuYQhASc0UAQv/2YhcBBMRAgAcBQJAfQV+AhsDBAsHAwID"
-			+ "FQIDAxYCAQIeAQIXgAAKCRCpzFfL42UDqfa2AJ9hjtEeDTbTEAuuSbzhYFxN"
-			+ "/qc0FACgsmzysdbBpuN65yK01tbEaeIMtqCwAgAAnQEUBEB9BH4QAwCqRuWO"
-			+ "rxm5v/8WWBtPEUZnYuu3WYxefRKn6ON5ka5Ymp4AfKpKqKqn982tjlG13GVE"
-			+ "P2ow11L4yQKGNm+VyVEapm7SpMD0SHg9vsJygAWrfMJnBYWSgE19W6o3ckUR"
-			+ "sWsAAwYDAKDCSiSxC3Z5/POaCehw5iHs/vmVk5Wn831LSZEEwkSohNDbIEry"
-			+ "ia/9tFXSt11AP4stJtZ0MH87/6JBbiIRD4JXcx+zfzchL7Teczr/06QMphSn"
-			+ "sAENupbhLupfpR+BbP4DAwIvYrn+YqRaaGBjvFK1fbxCt7ZM4I2W/3BC0lCX"
-			+ "m/NypKNspGflec8u96uUlA0fNCnxm6f9nbB0jpvoKi0g4iqAf+P2iEYEGBEC"
-			+ "AAYFAkB9BH4ACgkQqcxXy+NlA6mtMgCgvccZA/Sg7BXVpxli47SYhxSHoM4A"
-			+ "oNCOMplSnYTuh5ikKeBWtz36gC1psAIAAA==");
-
-		private static readonly char[] sec3pass1 = "123456".ToCharArray();
-
-		//
-		// GPG comment packets.
-		//
-		private static readonly byte[] sec4 = Base64.Decode(
-			"lQG7BD0PbK8RBAC0cW4Y2MZXmAmqYp5Txyw0kSQsFvwZKHNMFRv996IsN57URVF5"
-			+ "BGMVPRBi9dNucWbjiSYpiYN13wE9IuLZsvVaQojV4XWGRDc+Rxz9ElsXnsYQ3mZU"
-			+ "7H1bNQEofstChk4z+dlvPBN4GFahrIzn/CeVUn6Ut7dVdYbiTqviANqNXwCglfVA"
-			+ "2OEePvqFnGxs1jhJyPSOnTED/RwRvsLH/k43mk6UEvOyN1RIpBXN+Ieqs7h1gFrQ"
-			+ "kB+WMgeP5ZUsotTffVDSUS9UMxRQggVUW1Xml0geGwQsNfkr/ztWMs/T4xp1v5j+"
-			+ "QyJx6OqNlkGdqOsoqkzJx0SQ1zBxdinFyyC4H95SDAb/RQOu5LQmxFG7quexztMs"
-			+ "infEA/9cVc9+qCo92yRAaXRqKNVVQIQuPxeUsGMyVeJQvJBD4An8KTMCdjpF10Cp"
-			+ "qA3t+n1S0zKr5WRUtvS6y60MOONO+EJWVWBNkx8HJDaIMNkfoqQoz3Krn7w6FE/v"
-			+ "/5uwMd6jY3N3yJZn5nDZT9Yzv9Nx3j+BrY+henRlSU0c6xDc9QAAnjJYg0Z83VJG"
-			+ "6HrBcgc4+4K6lHulCqH9JiM6RFNBX2ZhY3RvcjoAAK9hV206agp99GI6x5qE9+pU"
-			+ "vs6O+Ich/SYjOkRTQV9mYWN0b3I6AACvYAfGn2FGrpBYbjnpTuFOHJMS/T5xg/0m"
-			+ "IzpEU0FfZmFjdG9yOgAAr0dAQz6XxMwxWIn8xIZR/v2iN2L9C6O0EkZvbyBCYXIg"
-			+ "PGJhekBxdXV4PohXBBMRAgAXBQI9D2yvBQsHCgMEAxUDAgMWAgECF4AACgkQUGLI"
-			+ "YCIktfoGogCfZiXMJUKrScqozv5tMwzTTk2AaT8AniM5iRr0Du/Y08SL/NMhtF6H"
-			+ "hJ89nO4EPQ9ssRADAI6Ggxj6ZBfoavuXd/ye99osW8HsNlbqhXObu5mCMNySX2wa"
-			+ "HoWyRUEaUkI9eQw+MlHzIwzA32E7y2mU3OQBKdgLcBg4jxtcWVEg8ESKF9MpFXxl"
-			+ "pExxWrr4DFBfCRcsTwAFEQL9G3OvwJuEZXgx2JSS41D3pG4/qiHYICVa0u3p/14i"
-			+ "cq0kXajIk5ZJ6frCIAHIzuQ3n7jjzr05yR8s/qCrNbBA+nlkVNa/samk+jCzxxxa"
-			+ "cR/Dbh2wkvTFuDFFETwQYLuZAADcDck4YGQAmHivVT2NNDCf/aTz0+CJWl+xRc2l"
-			+ "Qw7D/SQjOkVMR19mYWN0b3I6AACbBnv9m5/bb/pjYAm2PtDp0CysQ9X9JCM6RUxH"
-			+ "X2ZhY3RvcjoAAJsFyHnSmaWguTFf6lJ/j39LtUNtmf0kIzpFTEdfZmFjdG9yOgAA"
-			+ "mwfwMD3LxmWtuCWBE9BptWMNH07Z/SQjOkVMR19mYWN0b3I6AACbBdhBrbSiM4UN"
-			+ "y7khDW2Sk0e4v9mIRgQYEQIABgUCPQ9ssQAKCRBQYshgIiS1+jCMAJ9txwHnb1Kl"
-			+ "6i/fSoDs8SkdM7w48wCdFvPEV0sSxE73073YhBgPZtMWbBo=");
-
-		//
-		// PGP freeware version 7
-		//
-		private static readonly byte[] pub5 = Base64.Decode(
-			"mQENBEBrBE4BCACjXVcNIFDQSofaIyZnALb2CRg+WY9uUqgHEEAOlPe03Cs5STM5"
-			+ "HDlNmrh4TdFceJ46rxk1mQOjULES1YfHay8lCIzrD7FX4oj0r4DC14Fs1vXaSar2"
-			+ "1szIpttOw3obL4A1e0p6N4jjsoG7N/pA0fEL0lSw92SoBrMbAheXRg4qNTZvdjOR"
-			+ "grcuOuwgJRvPLtRXlhyLBoyhkd5mmrIDGv8QHJ/UjpeIcRXY9kn9oGXnEYcRbMaU"
-			+ "VwXB4pLzWqz3ZejFI3lOxRWjm760puPOnGYlzSVBxlt2LgzUgSj1Mn+lIpWmAzsa"
-			+ "xEiU4xUwEomQns72yYRZ6D3euNCibcte4SeXABEBAAG0KXBhbGFzaCBrYXNvZGhh"
-			+ "biA8cGthc29kaGFuQHRpYWEtY3JlZi5vcmc+iQEuBBABAgAYBQJAawROCAsBAwkI"
-			+ "BwIKAhkBBRsDAAAAAAoJEOfelumuiOrYqPEH+wYrdP5Tq5j+E5yN1pyCg1rwbSOt"
-			+ "Dka0y0p7Oq/VIGLk692IWPItLEunnBXQtGBcWqklrvogvlhxtf16FgoyScfLJx1e"
-			+ "1cJa+QQnVuH+VOESN6iS9Gp9lUfVOHv74mEMXw0l2Djfy/lnrkAMBatggyGnF9xF"
-			+ "VXOLk1J2WVFm9KUE23o6qdB7RGkf31pN2eA7SWmkdJSkUH7o/QSFBI+UTRZ/IY5P"
-			+ "ZIJpsdiIOqd9YMG/4RoSZuPqNRR6x7BSs8nQVR9bYs4PPlp4GfdRnOcRonoTeJCZ"
-			+ "83RnsraWJnJTg34gRLBcqumhTuFKc8nuCNK98D6zkQESdcHLLTquCOaF5L+5AQ0E"
-			+ "QGsETwEIAOVwNCTaDZvW4dowPbET1bI5UeYY8rAGLYsWSUfgaFv2srMiApyBVltf"
-			+ "i6OLcPjcUCHDBjCv4pwx/C4qcHWb8av4xQIpqQXOpO9NxYE1eZnel/QB7DtH12ZO"
-			+ "nrDNmHtaXlulcKNGe1i1utlFhgzfFx6rWkRL0ENmkTkaQmPY4gTGymJTUhBbsSRq"
-			+ "2ivWqQA1TPwBuda73UgslIAHRd/SUaxjXoLpMbGOTeqzcKGjr5XMPTs7/YgBpWPP"
-			+ "UxMlEQIiU3ia1bxpEhx05k97ceK6TSH2oCPQA7gumjxOSjKT+jEm+8jACVzymEmc"
-			+ "XRy4D5Ztqkw/Z16pvNcu1DI5m6xHwr8AEQEAAYkBIgQYAQIADAUCQGsETwUbDAAA"
-			+ "AAAKCRDn3pbprojq2EynB/4/cEOtKbI5UisUd3vkTzvWOcqWUqGqi5wjjioNtIM5"
-			+ "pur2nFvhQE7SZ+PbAa87HRJU/4WcWMcoLkHD48JrQwHCHOLHSV5muYowb78X4Yh9"
-			+ "epYtSJ0uUahcn4Gp48p4BkhgsPYXkxEImSYzAOWStv21/7WEMqItMYl89BV6Upm8"
-			+ "HyTJx5MPTDbMR7X51hRg3OeQs6po3WTCWRzFIMyGm1rd/VK1L5ZDFPqO3S6YUJ0z"
-			+ "cxecYruvfK0Wp7q834wE8Zkl/PQ3NhfEPL1ZiLr/L00Ty+77/FZqt8SHRCICzOfP"
-			+ "OawcVGI+xHVXW6lijMpB5VaVIH8i2KdBMHXHtduIkPr9");
-
-		private static readonly byte[] sec5 = Base64.Decode(
-			"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");
-
-		private static readonly char[] sec5pass1 = "12345678".ToCharArray();
-
-		//
-		// Werner Koch "odd keys"
-		//
-		private static readonly byte[] pub6 = Base64.Decode(
-			"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"
-			+ "L4Kb7TWkd/OHQScVBO8sTUz0+2g=");
+        private static readonly byte[] pub2 = Base64.Decode(
+            "mQGiBEBtfW8RBADfWjTxFedIbGBNVgh064D/OCf6ul7x4PGsCl+BkAyheYkr"
+            + "mVUsChmBKoeXaY+Fb85wwusXzyM/6JFK58Rg+vEb3Z19pue8Ixxq7cRtCtOA"
+            + "tOP1eKXLNtTRWJutvLkQmeOa19UZ6ziIq23aWuWKSq+KKMWek2GUnGycnx5M"
+            + "W0pn1QCg/39r9RKhY9cdKYqRcqsr9b2B/AsD/Ru24Q15Jmrsl9zZ6EC47J49"
+            + "iNW5sLQx1qf/mgfVWQTmU2j6gq4ND1OuK7+0OP/1yMOUpkjjcqxFgTnDAAoM"
+            + "hHDTzCv/aZzIzmMvgLsYU3aIMfbz+ojpuASMCMh+te01cEMjiPWwDtdWWOdS"
+            + "OSyX9ylzhO3PiNDks8R83onsacYpA/9WhTcg4bvkjaj66I7wGZkm3BmTxNSb"
+            + "pE4b5HZDh31rRYhY9tmrryCfFnU4BS2Enjj5KQe9zFv7pUBCBW2oFo8i8Osn"
+            + "O6fa1wVN4fBHC6wqWmmpnkFerNPkiC9V75KUFIfeWHmT3r2DVSO3dfdHDERA"
+            + "jFIAioMLjhaX6DnODF5KQrABh7QmU2FpIFB1bGxhYmhvdGxhIDxwc2FpQG15"
+            + "amF2YXdvcmxkLmNvbT6wAwP//4kAVwQQEQIAFwUCQG19bwcLCQgHAwIKAhkB"
+            + "BRsDAAAAAAoJEKXQf/RT99uYmfAAoMKxV5g2owIfmy2w7vSLvOQUpvvOAJ4n"
+            + "jB6xJot523rPAQW9itPoGGekirABZ7kCDQRAbX1vEAgA9kJXtwh/CBdyorrW"
+            + "qULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9"
+            + "ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50T8X8dryDxUcwYc58yWb/"
+            + "Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknbzSC0neSRBzZrM2w4"
+            + "DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdXQ6MdGGzeMyEs"
+            + "tSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbTCD1mpF1B"
+            + "n5x8vYlLIhkmuquiXsNV6TILOwACAgf9F7/nJHDayJ3pBVTTVSq2g5WKUXMg"
+            + "xxGKTvOahiVRcbO03w0pKAkH85COakVfe56sMYpWRl36adjNoKOxaciow74D"
+            + "1R5snY/hv/kBXPBkzo4UMkbANIVaZ0IcnLp+rkkXcDVbRCibZf8FfCY1zXbq"
+            + "d680UtEgRbv1D8wFBqfMt7kLsuf9FnIw6vK4DU06z5ZDg25RHGmswaDyY6Mw"
+            + "NGCrKGbHf9I/T7MMuhGF/in8UU8hv8uREOjseOqklG3/nsI1hD/MdUC7fzXi"
+            + "MRO4RvahLoeXOuaDkMYALdJk5nmNuCL1YPpbFGttI3XsK7UrP/Fhd8ND6Nro"
+            + "wCqrN6keduK+uLABh4kATAQYEQIADAUCQG19bwUbDAAAAAAKCRCl0H/0U/fb"
+            + "mC/0AJ4r1yvyu4qfOXlDgmVuCsvHFWo63gCfRIrCB2Jv/N1cgpmq0L8LGHM7"
+            + "G/KwAWeZAQ0EQG19owEIAMnavLYqR7ffaDPbbq+lQZvLCK/3uA0QlyngNyTa"
+            + "sDW0WC1/ryy2dx7ypOOCicjnPYfg3LP5TkYAGoMjxH5+xzM6xfOR+8/EwK1z"
+            + "N3A5+X/PSBDlYjQ9dEVKrvvc7iMOp+1K1VMf4Ug8Yah22Ot4eLGP0HRCXiv5"
+            + "vgdBNsAl/uXnBJuDYQmLrEniqq/6UxJHKHxZoS/5p13Cq7NfKB1CJCuJXaCE"
+            + "TW2do+cDpN6r0ltkF/r+ES+2L7jxyoHcvQ4YorJoDMlAN6xpIZQ8dNaTYP/n"
+            + "Mx/pDS3shUzbU+UYPQrreJLMF1pD+YWP5MTKaZTo+U/qPjDFGcadInhPxvh3"
+            + "1ssAEQEAAbABh7QuU2FuZGh5YSBQdWxsYWJob3RsYSA8cHNhbmRoeWFAbXlq"
+            + "YXZhd29ybGQuY29tPrADA///iQEtBBABAgAXBQJAbX2jBwsJCAcDAgoCGQEF"
+            + "GwMAAAAACgkQx87DL9gOvoeVUwgAkQXYiF0CxhKbDnuabAssnOEwJrutgCRO"
+            + "CJRQvIwTe3fe6hQaWn2Yowt8OQtNFiR8GfAY6EYxyFLKzZbAI/qtq5fHmN3e"
+            + "RSyNWe6d6e17hqZZL7kf2sVkyGTChHj7Jiuo7vWkdqT2MJN6BW5tS9CRH7Me"
+            + "D839STv+4mAAO9auGvSvicP6UEQikAyCy/ihoJxLQlspfbSNpi0vrUjCPT7N"
+            + "tWwfP0qF64i9LYkjzLqihnu+UareqOPhXcWnyFKrjmg4ezQkweNU2pdvCLbc"
+            + "W24FhT92ivHgpLyWTswXcqjhFjVlRr0+2sIz7v1k0budCsJ7PjzOoH0hJxCv"
+            + "sJQMlZR/e7ABZ7kBDQRAbX2kAQgAm5j+/LO2M4pKm/VUPkYuj3eefHkzjM6n"
+            + "KbvRZX1Oqyf+6CJTxQskUWKAtkzzKafPdS5Wg0CMqeXov+EFod4bPEYccszn"
+            + "cKd1U8NRwacbEpCvvvB84Yl2YwdWpDpkryyyLI4PbCHkeuwx9Dc2z7t4XDB6"
+            + "FyAJTMAkia7nzYa/kbeUO3c2snDb/dU7uyCsyKtTZyTyhTgtl/f9L03Bgh95"
+            + "y3mOUz0PimJ0Sg4ANczF4d04BpWkjLNVJi489ifWodPlHm1hag5drYekYpWJ"
+            + "+3g0uxs5AwayV9BcOkPKb1uU3EoYQw+nn0Kn314Nvx2M1tKYunuVNLEm0PhA"
+            + "/+B8PTq8BQARAQABsAGHiQEiBBgBAgAMBQJAbX2kBRsMAAAAAAoJEMfOwy/Y"
+            + "Dr6HkLoH/RBY8lvUv1r8IdTs5/fN8e/MnGeThLl+JrlYF/4t3tjXYIf5xUj/"
+            + "c9NdjreKYgHfMtrbVM08LlxUVQlkjuF3DIk5bVH9Blq8aXmyiwiM5GrCry+z"
+            + "WiqkpZze1G577C38mMJbHDwbqNCLALMzo+W2q04Avl5sniNnDNGbGz9EjhRg"
+            + "o7oS16KkkD6Ls4RnHTEZ0vyZOXodDHu+sk/2kzj8K07kKaM8rvR7aDKiI7HH"
+            + "1GxJz70fn1gkKuV2iAIIiU25bty+S3wr+5h030YBsUZF1qeKCdGOmpK7e9Of"
+            + "yv9U7rf6Z5l8q+akjqLZvej9RnxeH2Um7W+tGg2me482J+z6WOawAWc=");
+
+        private static readonly byte[] sec2 = Base64.Decode(
+            "lQHpBEBtfW8RBADfWjTxFedIbGBNVgh064D/OCf6ul7x4PGsCl+BkAyheYkr"
+            + "mVUsChmBKoeXaY+Fb85wwusXzyM/6JFK58Rg+vEb3Z19pue8Ixxq7cRtCtOA"
+            + "tOP1eKXLNtTRWJutvLkQmeOa19UZ6ziIq23aWuWKSq+KKMWek2GUnGycnx5M"
+            + "W0pn1QCg/39r9RKhY9cdKYqRcqsr9b2B/AsD/Ru24Q15Jmrsl9zZ6EC47J49"
+            + "iNW5sLQx1qf/mgfVWQTmU2j6gq4ND1OuK7+0OP/1yMOUpkjjcqxFgTnDAAoM"
+            + "hHDTzCv/aZzIzmMvgLsYU3aIMfbz+ojpuASMCMh+te01cEMjiPWwDtdWWOdS"
+            + "OSyX9ylzhO3PiNDks8R83onsacYpA/9WhTcg4bvkjaj66I7wGZkm3BmTxNSb"
+            + "pE4b5HZDh31rRYhY9tmrryCfFnU4BS2Enjj5KQe9zFv7pUBCBW2oFo8i8Osn"
+            + "O6fa1wVN4fBHC6wqWmmpnkFerNPkiC9V75KUFIfeWHmT3r2DVSO3dfdHDERA"
+            + "jFIAioMLjhaX6DnODF5KQv4JAwIJH6A/rzqmMGAG4e+b8Whdvp8jaTGVT4CG"
+            + "M1b65rbiDyAuf5KTFymQBOIi9towgFzG9NXAZC07nEYSukN56tUTUDNVsAGH"
+            + "tCZTYWkgUHVsbGFiaG90bGEgPHBzYWlAbXlqYXZhd29ybGQuY29tPrADA///"
+            + "iQBXBBARAgAXBQJAbX1vBwsJCAcDAgoCGQEFGwMAAAAACgkQpdB/9FP325iZ"
+            + "8ACgwrFXmDajAh+bLbDu9Iu85BSm+84AnieMHrEmi3nbes8BBb2K0+gYZ6SK"
+            + "sAFnnQJqBEBtfW8QCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoB"
+            + "p1ajFOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3b"
+            + "zpnhV5JZzf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa"
+            + "8L9GAFgr5fSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPw"
+            + "pVsYjY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obE"
+            + "AxnIByl6ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7"
+            + "AAICB/0Xv+ckcNrInekFVNNVKraDlYpRcyDHEYpO85qGJVFxs7TfDSkoCQfz"
+            + "kI5qRV97nqwxilZGXfpp2M2go7FpyKjDvgPVHmydj+G/+QFc8GTOjhQyRsA0"
+            + "hVpnQhycun6uSRdwNVtEKJtl/wV8JjXNdup3rzRS0SBFu/UPzAUGp8y3uQuy"
+            + "5/0WcjDq8rgNTTrPlkODblEcaazBoPJjozA0YKsoZsd/0j9Pswy6EYX+KfxR"
+            + "TyG/y5EQ6Ox46qSUbf+ewjWEP8x1QLt/NeIxE7hG9qEuh5c65oOQxgAt0mTm"
+            + "eY24IvVg+lsUa20jdewrtSs/8WF3w0Po2ujAKqs3qR524r64/gkDAmmp39NN"
+            + "U2pqYHokufIOab2VpD7iQo8UjHZNwR6dpjyky9dVfIe4MA0H+t0ju8UDdWoe"
+            + "IkRu8guWsI83mjGPbIq8lmsZOXPCA8hPuBmL0iaj8TnuotmsBjIBsAGHiQBM"
+            + "BBgRAgAMBQJAbX1vBRsMAAAAAAoJEKXQf/RT99uYL/QAnivXK/K7ip85eUOC"
+            + "ZW4Ky8cVajreAJ9EisIHYm/83VyCmarQvwsYczsb8rABZ5UDqARAbX2jAQgA"
+            + "ydq8tipHt99oM9tur6VBm8sIr/e4DRCXKeA3JNqwNbRYLX+vLLZ3HvKk44KJ"
+            + "yOc9h+Dcs/lORgAagyPEfn7HMzrF85H7z8TArXM3cDn5f89IEOViND10RUqu"
+            + "+9zuIw6n7UrVUx/hSDxhqHbY63h4sY/QdEJeK/m+B0E2wCX+5ecEm4NhCYus"
+            + "SeKqr/pTEkcofFmhL/mnXcKrs18oHUIkK4ldoIRNbZ2j5wOk3qvSW2QX+v4R"
+            + "L7YvuPHKgdy9DhiismgMyUA3rGkhlDx01pNg/+czH+kNLeyFTNtT5Rg9Cut4"
+            + "kswXWkP5hY/kxMpplOj5T+o+MMUZxp0ieE/G+HfWywARAQABCWEWL2cKQKcm"
+            + "XFTNsWgRoOcOkKyJ/osERh2PzNWvOF6/ir1BMRsg0qhd+hEcoWHaT+7Vt12i"
+            + "5Y2Ogm2HFrVrS5/DlV/rw0mkALp/3cR6jLOPyhmq7QGwhG27Iy++pLIksXQa"
+            + "RTboa7ZasEWw8zTqa4w17M5Ebm8dtB9Mwl/kqU9cnIYnFXj38BWeia3iFBNG"
+            + "PD00hqwhPUCTUAcH9qQPSqKqnFJVPe0KQWpq78zhCh1zPUIa27CE86xRBf45"
+            + "XbJwN+LmjCuQEnSNlloXJSPTRjEpla+gWAZz90fb0uVIR1dMMRFxsuaO6aCF"
+            + "QMN2Mu1wR/xzTzNCiQf8cVzq7YkkJD8ChJvu/4BtWp3BlU9dehAz43mbMhaw"
+            + "Qx3NmhKR/2dv1cJy/5VmRuljuzC+MRtuIjJ+ChoTa9ubNjsT6BF5McRAnVzf"
+            + "raZK+KVWCGA8VEZwe/K6ouYLsBr6+ekCKIkGZdM29927m9HjdFwEFjnzQlWO"
+            + "NZCeYgDcK22v7CzobKjdo2wdC7XIOUVCzMWMl+ch1guO/Y4KVuslfeQG5X1i"
+            + "PJqV+bwJriCx5/j3eE/aezK/vtZU6cchifmvefKvaNL34tY0Myz2bOx44tl8"
+            + "qNcGZbkYF7xrNCutzI63xa2ruN1p3hNxicZV1FJSOje6+ITXkU5Jmufto7IJ"
+            + "t/4Q2dQefBQ1x/d0EdX31yK6+1z9dF/k3HpcSMb5cAWa2u2g4duAmREHc3Jz"
+            + "lHCsNgyzt5mkb6kS43B6og8Mm2SOx78dBIOA8ANzi5B6Sqk3/uN5eQFLY+sQ"
+            + "qGxXzimyfbMjyq9DdqXThx4vlp3h/GC39KxL5MPeB0oe6P3fSP3C2ZGjsn3+"
+            + "XcYk0Ti1cBwBOFOZ59WYuc61B0wlkiU/WGeaebABh7QuU2FuZGh5YSBQdWxs"
+            + "YWJob3RsYSA8cHNhbmRoeWFAbXlqYXZhd29ybGQuY29tPrADA///iQEtBBAB"
+            + "AgAXBQJAbX2jBwsJCAcDAgoCGQEFGwMAAAAACgkQx87DL9gOvoeVUwgAkQXY"
+            + "iF0CxhKbDnuabAssnOEwJrutgCROCJRQvIwTe3fe6hQaWn2Yowt8OQtNFiR8"
+            + "GfAY6EYxyFLKzZbAI/qtq5fHmN3eRSyNWe6d6e17hqZZL7kf2sVkyGTChHj7"
+            + "Jiuo7vWkdqT2MJN6BW5tS9CRH7MeD839STv+4mAAO9auGvSvicP6UEQikAyC"
+            + "y/ihoJxLQlspfbSNpi0vrUjCPT7NtWwfP0qF64i9LYkjzLqihnu+UareqOPh"
+            + "XcWnyFKrjmg4ezQkweNU2pdvCLbcW24FhT92ivHgpLyWTswXcqjhFjVlRr0+"
+            + "2sIz7v1k0budCsJ7PjzOoH0hJxCvsJQMlZR/e7ABZ50DqARAbX2kAQgAm5j+"
+            + "/LO2M4pKm/VUPkYuj3eefHkzjM6nKbvRZX1Oqyf+6CJTxQskUWKAtkzzKafP"
+            + "dS5Wg0CMqeXov+EFod4bPEYccszncKd1U8NRwacbEpCvvvB84Yl2YwdWpDpk"
+            + "ryyyLI4PbCHkeuwx9Dc2z7t4XDB6FyAJTMAkia7nzYa/kbeUO3c2snDb/dU7"
+            + "uyCsyKtTZyTyhTgtl/f9L03Bgh95y3mOUz0PimJ0Sg4ANczF4d04BpWkjLNV"
+            + "Ji489ifWodPlHm1hag5drYekYpWJ+3g0uxs5AwayV9BcOkPKb1uU3EoYQw+n"
+            + "n0Kn314Nvx2M1tKYunuVNLEm0PhA/+B8PTq8BQARAQABCXo6bD6qi3s4U8Pp"
+            + "Uf9l3DyGuwiVPGuyb2P+sEmRFysi2AvxMe9CkF+CLCVYfZ32H3Fcr6XQ8+K8"
+            + "ZGH6bJwijtV4QRnWDZIuhUQDS7dsbGqTh4Aw81Fm0Bz9fpufViM9RPVEysxs"
+            + "CZRID+9jDrACthVsbq/xKomkKdBfNTK7XzGeZ/CBr9F4EPlnBWClURi9txc0"
+            + "pz9YP5ZRy4XTFgx+jCbHgKWUIz4yNaWQqpSgkHEDrGZwstXeRaaPftcfQN+s"
+            + "EO7OGl/Hd9XepGLez4vKSbT35CnqTwMzCK1IwUDUzyB4BYEFZ+p9TI18HQDW"
+            + "hA0Wmf6E8pjS16m/SDXoiRY43u1jUVZFNFzz25uLFWitfRNHCLl+VfgnetZQ"
+            + "jMFr36HGVQ65fogs3avkgvpgPwDc0z+VMj6ujTyXXgnCP/FdhzgkRFJqgmdJ"
+            + "yOlC+wFmZJEs0MX7L/VXEXdpR27XIGYm24CC7BTFKSdlmR1qqenXHmCCg4Wp"
+            + "00fV8+aAsnesgwPvxhCbZQVp4v4jqhVuB/rvsQu9t0rZnKdDnWeom/F3StYo"
+            + "A025l1rrt0wRP8YS4XlslwzZBqgdhN4urnzLH0/F3X/MfjP79Efj7Zk07vOH"
+            + "o/TPjz8lXroPTscOyXWHwtQqcMhnVsj9jvrzhZZSdUuvnT30DR7b8xcHyvAo"
+            + "WG2cnF/pNSQX11RlyyAOlw9TOEiDJ4aLbFdkUt+qZdRKeC8mEC2xsQ87HqFR"
+            + "pWKWABWaoUO0nxBEmvNOy97PkIeGVFNHDLlIeL++Ry03+JvuNNg4qAnwacbJ"
+            + "TwQzWP4vJqre7Gl/9D0tVlD4Yy6Xz3qyosxdoFpeMSKHhgKVt1bk0SQP7eXA"
+            + "C1c+eDc4gN/ZWpl+QLqdk2T9vr4wRAaK5LABh4kBIgQYAQIADAUCQG19pAUb"
+            + "DAAAAAAKCRDHzsMv2A6+h5C6B/0QWPJb1L9a/CHU7Of3zfHvzJxnk4S5fia5"
+            + "WBf+Ld7Y12CH+cVI/3PTXY63imIB3zLa21TNPC5cVFUJZI7hdwyJOW1R/QZa"
+            + "vGl5sosIjORqwq8vs1oqpKWc3tRue+wt/JjCWxw8G6jQiwCzM6PltqtOAL5e"
+            + "bJ4jZwzRmxs/RI4UYKO6EteipJA+i7OEZx0xGdL8mTl6HQx7vrJP9pM4/CtO"
+            + "5CmjPK70e2gyoiOxx9RsSc+9H59YJCrldogCCIlNuW7cvkt8K/uYdN9GAbFG"
+            + "RdanignRjpqSu3vTn8r/VO63+meZfKvmpI6i2b3o/UZ8Xh9lJu1vrRoNpnuP"
+            + "Nifs+ljmsAFn");
+
+        private static readonly char[] sec2pass1 = "sandhya".ToCharArray();
+        private static readonly char[] sec2pass2 = "psai".ToCharArray();
+
+        private static readonly byte[] pub3 = Base64.Decode(
+            "mQGiBEB9BH0RBACtYQtE7tna6hgGyGLpq+ds3r2cLC0ISn5dNw7tm9vwiNVF"
+            + "JA2N37RRrifw4PvgelRSvLaX3M3ZBqC9s1Metg3v4FSlIRtSLWCNpHSvNw7i"
+            + "X8C2Xy9Hdlbh6Y/50o+iscojLRE14upfR1bIkcCZQGSyvGV52V2wBImUUZjV"
+            + "s2ZngwCg7mu852vK7+euz4WaL7ERVYtq9CMEAJ5swrljerDpz/RQ4Lhp6KER"
+            + "KyuI0PUttO57xINGshEINgYlZdGaZHRueHe7uKfI19mb0T4N3NJWaZ0wF+Cn"
+            + "rixsq0VrTUfiwfZeGluNG73aTCeY45fVXMGTTSYXzS8T0LW100Xn/0g9HRyA"
+            + "xUpuWo8IazxkMqHJis2uwriYKpAfA/9anvj5BS9p5pfPjp9dGM7GTMIYl5f2"
+            + "fcP57f+AW1TVR6IZiMJAvAdeWuLtwLnJiFpGlnFz273pfl+sAuqm1yNceImR"
+            + "2SDDP4+vtyycWy8nZhgEuhZx3W3cWMQz5WyNJSY1JJHh9TCQkCoN8E7XpVP4"
+            + "zEPboB2GzD93mfD8JLHP+7QtVGVzdCBLZXkgKG5vIGNvbW1lbnQpIDx0ZXN0"
+            + "QGJvdW5jeWNhc3RsZS5vcmc+iFkEExECABkFAkB9BH0ECwcDAgMVAgMDFgIB"
+            + "Ah4BAheAAAoJEKnMV8vjZQOpSRQAnidAQswYkrXQAFcLBzhxQTknI9QMAKDR"
+            + "ryV3l6xuCCgHST8JlxpbjcXhlLACAAPRwXPBcQEQAAEBAAAAAAAAAAAAAAAA"
+            + "/9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q"
+            + "/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAi"
+            + "LCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIy"
+            + "MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy"
+            + "MjIy/8AAEQgAFAAUAwEiAAIRAQMRAf/EABoAAQACAwEAAAAAAAAAAAAAAAAE"
+            + "BQIDBgf/xAAoEAABAgUDBAEFAAAAAAAAAAABAgMABBEhMQUSQQYTIiNhFFGB"
+            + "kcH/xAAXAQEAAwAAAAAAAAAAAAAAAAAEAgMF/8QAJBEAAQQAAwkAAAAAAAAA"
+            + "AAAAAQACERIEIfATMTJBUZGx0fH/2gAMAwEAAhEDEQA/APMuotJlJVxstqaP"
+            + "o22NlAUp+YsNO0qSUtBcMu6n6EtOHcfPAHHFI16++oajQtTA3DapK02HFR8U"
+            + "pE9pTbQWtKm2WG2rlxVyQTcfGbn7Qm0OIjL77Wrs2NNm9lzTmmSxQ0PX4opS"
+            + "prk5tmESF6syggzGwOLG6gXgHFbZhBixk8XlIDcOQLRKt+rX+3qC5ZLTQblp"
+            + "Qlvwvxn9CMpZturVGkJHapQJphRH8hCLXbzrqpYsCx1zC5rtpJNuYQhASc0U"
+            + "AQv/2YhcBBMRAgAcBQJAfQV+AhsDBAsHAwIDFQIDAxYCAQIeAQIXgAAKCRCp"
+            + "zFfL42UDqfa2AJ9hjtEeDTbTEAuuSbzhYFxN/qc0FACgsmzysdbBpuN65yK0"
+            + "1tbEaeIMtqCwAgADuM0EQH0EfhADAKpG5Y6vGbm//xZYG08RRmdi67dZjF59"
+            + "Eqfo43mRrliangB8qkqoqqf3za2OUbXcZUQ/ajDXUvjJAoY2b5XJURqmbtKk"
+            + "wPRIeD2+wnKABat8wmcFhZKATX1bqjdyRRGxawADBgMAoMJKJLELdnn885oJ"
+            + "6HDmIez++ZWTlafzfUtJkQTCRKiE0NsgSvKJr/20VdK3XUA/iy0m1nQwfzv/"
+            + "okFuIhEPgldzH7N/NyEvtN5zOv/TpAymFKewAQ26luEu6l+lH4FsiEYEGBEC"
+            + "AAYFAkB9BH4ACgkQqcxXy+NlA6mtMgCgtQMFBaKymktM+DQmCgy2qjW7WY0A"
+            + "n3FaE6UZE9GMDmCIAjhI+0X9aH6CsAIAAw==");
+
+        private static readonly byte[] sec3 = Base64.Decode(
+            "lQHhBEB9BH0RBACtYQtE7tna6hgGyGLpq+ds3r2cLC0ISn5dNw7tm9vwiNVF"
+            + "JA2N37RRrifw4PvgelRSvLaX3M3ZBqC9s1Metg3v4FSlIRtSLWCNpHSvNw7i"
+            + "X8C2Xy9Hdlbh6Y/50o+iscojLRE14upfR1bIkcCZQGSyvGV52V2wBImUUZjV"
+            + "s2ZngwCg7mu852vK7+euz4WaL7ERVYtq9CMEAJ5swrljerDpz/RQ4Lhp6KER"
+            + "KyuI0PUttO57xINGshEINgYlZdGaZHRueHe7uKfI19mb0T4N3NJWaZ0wF+Cn"
+            + "rixsq0VrTUfiwfZeGluNG73aTCeY45fVXMGTTSYXzS8T0LW100Xn/0g9HRyA"
+            + "xUpuWo8IazxkMqHJis2uwriYKpAfA/9anvj5BS9p5pfPjp9dGM7GTMIYl5f2"
+            + "fcP57f+AW1TVR6IZiMJAvAdeWuLtwLnJiFpGlnFz273pfl+sAuqm1yNceImR"
+            + "2SDDP4+vtyycWy8nZhgEuhZx3W3cWMQz5WyNJSY1JJHh9TCQkCoN8E7XpVP4"
+            + "zEPboB2GzD93mfD8JLHP+/4DAwIvYrn+YqRaaGAu19XUj895g/GROyP8WEaU"
+            + "Bd/JNqWc4kE/0guetGnPzq7G3bLVwiKfFd4X7BrgHAo3mrQtVGVzdCBLZXkg"
+            + "KG5vIGNvbW1lbnQpIDx0ZXN0QGJvdW5jeWNhc3RsZS5vcmc+iFkEExECABkF"
+            + "AkB9BH0ECwcDAgMVAgMDFgIBAh4BAheAAAoJEKnMV8vjZQOpSRQAoKZy6YS1"
+            + "irF5/Q3JlWiwbkN6dEuLAJ9lldRLOlXsuQ5JW1+SLEc6K9ho4rACAADRwXPB"
+            + "cQEQAAEBAAAAAAAAAAAAAAAA/9j/4AAQSkZJRgABAQEASABIAAD//gAXQ3Jl"
+            + "YXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZ"
+            + "EhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sA"
+            + "QwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy"
+            + "MjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAFAAUAwEiAAIRAQMRAf/EABoA"
+            + "AQACAwEAAAAAAAAAAAAAAAAEBQIDBgf/xAAoEAABAgUDBAEFAAAAAAAAAAAB"
+            + "AgMABBEhMQUSQQYTIiNhFFGBkcH/xAAXAQEAAwAAAAAAAAAAAAAAAAAEAgMF"
+            + "/8QAJBEAAQQAAwkAAAAAAAAAAAAAAQACERIEIfATMTJBUZGx0fH/2gAMAwEA"
+            + "AhEDEQA/APMuotJlJVxstqaPo22NlAUp+YsNO0qSUtBcMu6n6EtOHcfPAHHF"
+            + "I16++oajQtTA3DapK02HFR8UpE9pTbQWtKm2WG2rlxVyQTcfGbn7Qm0OIjL7"
+            + "7Wrs2NNm9lzTmmSxQ0PX4opSprk5tmESF6syggzGwOLG6gXgHFbZhBixk8Xl"
+            + "IDcOQLRKt+rX+3qC5ZLTQblpQlvwvxn9CMpZturVGkJHapQJphRH8hCLXbzr"
+            + "qpYsCx1zC5rtpJNuYQhASc0UAQv/2YhcBBMRAgAcBQJAfQV+AhsDBAsHAwID"
+            + "FQIDAxYCAQIeAQIXgAAKCRCpzFfL42UDqfa2AJ9hjtEeDTbTEAuuSbzhYFxN"
+            + "/qc0FACgsmzysdbBpuN65yK01tbEaeIMtqCwAgAAnQEUBEB9BH4QAwCqRuWO"
+            + "rxm5v/8WWBtPEUZnYuu3WYxefRKn6ON5ka5Ymp4AfKpKqKqn982tjlG13GVE"
+            + "P2ow11L4yQKGNm+VyVEapm7SpMD0SHg9vsJygAWrfMJnBYWSgE19W6o3ckUR"
+            + "sWsAAwYDAKDCSiSxC3Z5/POaCehw5iHs/vmVk5Wn831LSZEEwkSohNDbIEry"
+            + "ia/9tFXSt11AP4stJtZ0MH87/6JBbiIRD4JXcx+zfzchL7Teczr/06QMphSn"
+            + "sAENupbhLupfpR+BbP4DAwIvYrn+YqRaaGBjvFK1fbxCt7ZM4I2W/3BC0lCX"
+            + "m/NypKNspGflec8u96uUlA0fNCnxm6f9nbB0jpvoKi0g4iqAf+P2iEYEGBEC"
+            + "AAYFAkB9BH4ACgkQqcxXy+NlA6mtMgCgvccZA/Sg7BXVpxli47SYhxSHoM4A"
+            + "oNCOMplSnYTuh5ikKeBWtz36gC1psAIAAA==");
+
+        private static readonly char[] sec3pass1 = "123456".ToCharArray();
+
+        //
+        // GPG comment packets.
+        //
+        private static readonly byte[] sec4 = Base64.Decode(
+            "lQG7BD0PbK8RBAC0cW4Y2MZXmAmqYp5Txyw0kSQsFvwZKHNMFRv996IsN57URVF5"
+            + "BGMVPRBi9dNucWbjiSYpiYN13wE9IuLZsvVaQojV4XWGRDc+Rxz9ElsXnsYQ3mZU"
+            + "7H1bNQEofstChk4z+dlvPBN4GFahrIzn/CeVUn6Ut7dVdYbiTqviANqNXwCglfVA"
+            + "2OEePvqFnGxs1jhJyPSOnTED/RwRvsLH/k43mk6UEvOyN1RIpBXN+Ieqs7h1gFrQ"
+            + "kB+WMgeP5ZUsotTffVDSUS9UMxRQggVUW1Xml0geGwQsNfkr/ztWMs/T4xp1v5j+"
+            + "QyJx6OqNlkGdqOsoqkzJx0SQ1zBxdinFyyC4H95SDAb/RQOu5LQmxFG7quexztMs"
+            + "infEA/9cVc9+qCo92yRAaXRqKNVVQIQuPxeUsGMyVeJQvJBD4An8KTMCdjpF10Cp"
+            + "qA3t+n1S0zKr5WRUtvS6y60MOONO+EJWVWBNkx8HJDaIMNkfoqQoz3Krn7w6FE/v"
+            + "/5uwMd6jY3N3yJZn5nDZT9Yzv9Nx3j+BrY+henRlSU0c6xDc9QAAnjJYg0Z83VJG"
+            + "6HrBcgc4+4K6lHulCqH9JiM6RFNBX2ZhY3RvcjoAAK9hV206agp99GI6x5qE9+pU"
+            + "vs6O+Ich/SYjOkRTQV9mYWN0b3I6AACvYAfGn2FGrpBYbjnpTuFOHJMS/T5xg/0m"
+            + "IzpEU0FfZmFjdG9yOgAAr0dAQz6XxMwxWIn8xIZR/v2iN2L9C6O0EkZvbyBCYXIg"
+            + "PGJhekBxdXV4PohXBBMRAgAXBQI9D2yvBQsHCgMEAxUDAgMWAgECF4AACgkQUGLI"
+            + "YCIktfoGogCfZiXMJUKrScqozv5tMwzTTk2AaT8AniM5iRr0Du/Y08SL/NMhtF6H"
+            + "hJ89nO4EPQ9ssRADAI6Ggxj6ZBfoavuXd/ye99osW8HsNlbqhXObu5mCMNySX2wa"
+            + "HoWyRUEaUkI9eQw+MlHzIwzA32E7y2mU3OQBKdgLcBg4jxtcWVEg8ESKF9MpFXxl"
+            + "pExxWrr4DFBfCRcsTwAFEQL9G3OvwJuEZXgx2JSS41D3pG4/qiHYICVa0u3p/14i"
+            + "cq0kXajIk5ZJ6frCIAHIzuQ3n7jjzr05yR8s/qCrNbBA+nlkVNa/samk+jCzxxxa"
+            + "cR/Dbh2wkvTFuDFFETwQYLuZAADcDck4YGQAmHivVT2NNDCf/aTz0+CJWl+xRc2l"
+            + "Qw7D/SQjOkVMR19mYWN0b3I6AACbBnv9m5/bb/pjYAm2PtDp0CysQ9X9JCM6RUxH"
+            + "X2ZhY3RvcjoAAJsFyHnSmaWguTFf6lJ/j39LtUNtmf0kIzpFTEdfZmFjdG9yOgAA"
+            + "mwfwMD3LxmWtuCWBE9BptWMNH07Z/SQjOkVMR19mYWN0b3I6AACbBdhBrbSiM4UN"
+            + "y7khDW2Sk0e4v9mIRgQYEQIABgUCPQ9ssQAKCRBQYshgIiS1+jCMAJ9txwHnb1Kl"
+            + "6i/fSoDs8SkdM7w48wCdFvPEV0sSxE73073YhBgPZtMWbBo=");
+
+        //
+        // PGP freeware version 7
+        //
+        private static readonly byte[] pub5 = Base64.Decode(
+            "mQENBEBrBE4BCACjXVcNIFDQSofaIyZnALb2CRg+WY9uUqgHEEAOlPe03Cs5STM5"
+            + "HDlNmrh4TdFceJ46rxk1mQOjULES1YfHay8lCIzrD7FX4oj0r4DC14Fs1vXaSar2"
+            + "1szIpttOw3obL4A1e0p6N4jjsoG7N/pA0fEL0lSw92SoBrMbAheXRg4qNTZvdjOR"
+            + "grcuOuwgJRvPLtRXlhyLBoyhkd5mmrIDGv8QHJ/UjpeIcRXY9kn9oGXnEYcRbMaU"
+            + "VwXB4pLzWqz3ZejFI3lOxRWjm760puPOnGYlzSVBxlt2LgzUgSj1Mn+lIpWmAzsa"
+            + "xEiU4xUwEomQns72yYRZ6D3euNCibcte4SeXABEBAAG0KXBhbGFzaCBrYXNvZGhh"
+            + "biA8cGthc29kaGFuQHRpYWEtY3JlZi5vcmc+iQEuBBABAgAYBQJAawROCAsBAwkI"
+            + "BwIKAhkBBRsDAAAAAAoJEOfelumuiOrYqPEH+wYrdP5Tq5j+E5yN1pyCg1rwbSOt"
+            + "Dka0y0p7Oq/VIGLk692IWPItLEunnBXQtGBcWqklrvogvlhxtf16FgoyScfLJx1e"
+            + "1cJa+QQnVuH+VOESN6iS9Gp9lUfVOHv74mEMXw0l2Djfy/lnrkAMBatggyGnF9xF"
+            + "VXOLk1J2WVFm9KUE23o6qdB7RGkf31pN2eA7SWmkdJSkUH7o/QSFBI+UTRZ/IY5P"
+            + "ZIJpsdiIOqd9YMG/4RoSZuPqNRR6x7BSs8nQVR9bYs4PPlp4GfdRnOcRonoTeJCZ"
+            + "83RnsraWJnJTg34gRLBcqumhTuFKc8nuCNK98D6zkQESdcHLLTquCOaF5L+5AQ0E"
+            + "QGsETwEIAOVwNCTaDZvW4dowPbET1bI5UeYY8rAGLYsWSUfgaFv2srMiApyBVltf"
+            + "i6OLcPjcUCHDBjCv4pwx/C4qcHWb8av4xQIpqQXOpO9NxYE1eZnel/QB7DtH12ZO"
+            + "nrDNmHtaXlulcKNGe1i1utlFhgzfFx6rWkRL0ENmkTkaQmPY4gTGymJTUhBbsSRq"
+            + "2ivWqQA1TPwBuda73UgslIAHRd/SUaxjXoLpMbGOTeqzcKGjr5XMPTs7/YgBpWPP"
+            + "UxMlEQIiU3ia1bxpEhx05k97ceK6TSH2oCPQA7gumjxOSjKT+jEm+8jACVzymEmc"
+            + "XRy4D5Ztqkw/Z16pvNcu1DI5m6xHwr8AEQEAAYkBIgQYAQIADAUCQGsETwUbDAAA"
+            + "AAAKCRDn3pbprojq2EynB/4/cEOtKbI5UisUd3vkTzvWOcqWUqGqi5wjjioNtIM5"
+            + "pur2nFvhQE7SZ+PbAa87HRJU/4WcWMcoLkHD48JrQwHCHOLHSV5muYowb78X4Yh9"
+            + "epYtSJ0uUahcn4Gp48p4BkhgsPYXkxEImSYzAOWStv21/7WEMqItMYl89BV6Upm8"
+            + "HyTJx5MPTDbMR7X51hRg3OeQs6po3WTCWRzFIMyGm1rd/VK1L5ZDFPqO3S6YUJ0z"
+            + "cxecYruvfK0Wp7q834wE8Zkl/PQ3NhfEPL1ZiLr/L00Ty+77/FZqt8SHRCICzOfP"
+            + "OawcVGI+xHVXW6lijMpB5VaVIH8i2KdBMHXHtduIkPr9");
+
+        private static readonly byte[] sec5 = Base64.Decode(
+            "lQOgBEBrBE4BCACjXVcNIFDQSofaIyZnALb2CRg+WY9uUqgHEEAOlPe03Cs5STM5"
+            + "HDlNmrh4TdFceJ46rxk1mQOjULES1YfHay8lCIzrD7FX4oj0r4DC14Fs1vXaSar2"
+            + "1szIpttOw3obL4A1e0p6N4jjsoG7N/pA0fEL0lSw92SoBrMbAheXRg4qNTZvdjOR"
+            + "grcuOuwgJRvPLtRXlhyLBoyhkd5mmrIDGv8QHJ/UjpeIcRXY9kn9oGXnEYcRbMaU"
+            + "VwXB4pLzWqz3ZejFI3lOxRWjm760puPOnGYlzSVBxlt2LgzUgSj1Mn+lIpWmAzsa"
+            + "xEiU4xUwEomQns72yYRZ6D3euNCibcte4SeXABEBAAEB8wqP7JkKN6oMNi1xJNqU"
+            + "vvt0OV4CCnrIFiOPCjebjH/NC4T/9pJ6BYSjYdo3VEPNhPhRS9U3071Kqbdt35J5"
+            + "kmzMq1yNStC1jkxHRCNTMsb1yIEY1v+fv8/Cy+tBpvAYiJKaox8jW3ppi9vTHZjW"
+            + "tYYq0kwAVojMovz1O3wW/pEF69UPBmPYsze+AHA1UucYYqdWO8U2tsdFJET/hYpe"
+            + "o7ppHJJCdqWzeiE1vDUrih9pP3MPpzcRS/gU7HRDb5HbfP7ghSLzByEa+2mvg5eK"
+            + "eLwNAx2OUtrVg9rJswXX7DOLa1nKPhdGrSV/qwuK4rBdaqJ/OvszVJ0Vln0T/aus"
+            + "it1PAuVROLUPqTVVN8/zkMenFbf5vtryC3GQYXvvZq+l3a4EXwrR/1pqrTfnfOuD"
+            + "GwlFhRJAqPfthxZS68/xC8qAmTtkl7j4nscNM9kSoZ3BFwSyD9B/vYHPWGlqnpGF"
+            + "k/hBXuIgl07KIeNIyEC3f1eRyaiMFqEz5yXbbTfEKirSVpHM/mpeKxG8w96aK3Je"
+            + "AV0X6ZkC4oLTp6HCG2TITUIeNxCh2rX3fhr9HvBDXBbMHgYlIcLwzNkwDX74cz/7"
+            + "nIclcubaWjEkDHP20XFicuChFc9zx6kBYuYy170snltTBgTWSuRH15W4NQqrLo37"
+            + "zyzZQubX7CObgQJu4ahquiOg4SWl6uEI7+36U0SED7sZzw8ns1LxrwOWbXuHie1i"
+            + "xCvsJ4RpJJ03iEdNdUIb77qf6AriqE92tXzcVXToBv5S2K5LdFYNJ1rWdwaKJRkt"
+            + "kmjCL67KM9WT/IagsUyU+57ao3COtqw9VWZi6ev+ubM6fIV0ZK46NEggOLph1hi2"
+            + "gZ9ew9uVuruYg7lG2Ku82N0fjrQpcGFsYXNoIGthc29kaGFuIDxwa2Fzb2RoYW5A"
+            + "dGlhYS1jcmVmLm9yZz6dA6AEQGsETwEIAOVwNCTaDZvW4dowPbET1bI5UeYY8rAG"
+            + "LYsWSUfgaFv2srMiApyBVltfi6OLcPjcUCHDBjCv4pwx/C4qcHWb8av4xQIpqQXO"
+            + "pO9NxYE1eZnel/QB7DtH12ZOnrDNmHtaXlulcKNGe1i1utlFhgzfFx6rWkRL0ENm"
+            + "kTkaQmPY4gTGymJTUhBbsSRq2ivWqQA1TPwBuda73UgslIAHRd/SUaxjXoLpMbGO"
+            + "TeqzcKGjr5XMPTs7/YgBpWPPUxMlEQIiU3ia1bxpEhx05k97ceK6TSH2oCPQA7gu"
+            + "mjxOSjKT+jEm+8jACVzymEmcXRy4D5Ztqkw/Z16pvNcu1DI5m6xHwr8AEQEAAQF7"
+            + "osMrvQieBAJFYY+x9jKPVclm+pVaMaIcHKwCTv6yUZMqbHNRTfwdCVKTdAzdlh5d"
+            + "zJNXXRu8eNwOcfnG3WrWAy59cYE389hA0pQPOh7iL2V1nITf1qdLru1HJqqLC+dy"
+            + "E5GtkNcgvQYbv7ACjQacscvnyBioYC6TATtPnHipMO0S1sXEnmUugNlW88pDln4y"
+            + "VxCtQXMBjuqMt0bURqmb+RoYhHhoCibo6sexxSnbEAPHBaW1b1Rm7l4UBSW6S5U0"
+            + "MXURE60IHfP1TBe1l/xOIxOi8qdBQCyaFW2up00EhRBy/WOO6KAYXQrRRpOs9TBq"
+            + "ic2wquwZePmErTbIttnnBcAKmpodrM/JBkn/we5fVg+FDTP8sM/Ubv0ZuM70aWmF"
+            + "v0/ZKbkCkh2YORLWl5+HR/RKShdkmmFgZZ5uzbOGxxEGKhw+Q3+QFUF7PmYOnOtv"
+            + "s9PZE3dV7ovRDoXIjfniD1+8sLUWwW5d+3NHAQnCHJrLnPx4sTHx6C0yWMcyZk6V"
+            + "fNHpLK4xDTbgoTmxJa/4l+wa0iD69h9K/Nxw/6+X/GEM5w3d/vjlK1Da6urN9myc"
+            + "GMsfiIll5DNIWdLLxCBPFmhJy653CICQLY5xkycWB7JOZUBTOEVrYr0AbBZSTkuB"
+            + "fq5p9MfH4N51M5TWnwlJnqEiGnpaK+VDeP8GniwCidTYyiocNPvghvWIzG8QGWMY"
+            + "PFncRpjFxmcY4XScYYpyRme4qyPbJhbZcgGpfeLvFKBPmNxVKJ2nXTdx6O6EbHDj"
+            + "XctWqNd1EQas7rUN728u7bk8G7m37MGqQuKCpNvOScH4TnPROBY8get0G3bC4mWz"
+            + "6emPeENnuyElfWQiHEtCZr1InjnNbb/C97O+vWu9PfsE");
+
+        private static readonly char[] sec5pass1 = "12345678".ToCharArray();
+
+        //
+        // Werner Koch "odd keys"
+        //
+        private static readonly byte[] pub6 = Base64.Decode(
+            "mQGiBDWiHh4RBAD+l0rg5p9rW4M3sKvmeyzhs2mDxhRKDTVVUnTwpMIR2kIA9pT4"
+            + "3No/coPajDvhZTaDM/vSz25IZDZWJ7gEu86RpoEdtr/eK8GuDcgsWvFs5+YpCDwW"
+            + "G2dx39ME7DN+SRvEE1xUm4E9G2Nnd2UNtLgg82wgi/ZK4Ih9CYDyo0a9awCgisn3"
+            + "RvZ/MREJmQq1+SjJgDx+c2sEAOEnxGYisqIKcOTdPOTTie7o7x+nem2uac7uOW68"
+            + "N+wRWxhGPIxsOdueMIa7U94Wg/Ydn4f2WngJpBvKNaHYmW8j1Q5zvZXXpIWRXSvy"
+            + "TR641BceGHNdYiR/PiDBJsGQ3ac7n7pwhV4qex3IViRDJWz5Dzr88x+Oju63KtxY"
+            + "urUIBACi7d1rUlHr4ok7iBRlWHYXU2hpUIQ8C+UOE1XXT+HB7mZLSRONQnWMyXnq"
+            + "bAAW+EUUX2xpb54CevAg4eOilt0es8GZMmU6c0wdUsnMWWqOKHBFFlDIvyI27aZ9"
+            + "quf0yvby63kFCanQKc0QnqGXQKzuXbFqBYW2UQrYgjXji8rd8bQnV2VybmVyIEtv"
+            + "Y2ggKGdudXBnIHNpZykgPGRkOWpuQGdudS5vcmc+iGUEExECAB0FAjZVoKYFCQht"
+            + "DIgDCwQDBRUDAgYBAxYCAQIXgAASCRBot6uJV1SNzQdlR1BHAAEBLj4AoId15gcy"
+            + "YpBX2YLtEQTlXPp3mtEGAJ9UxzJE/t3EHCHK2bAIOkBwIW8ItIkBXwMFEDWiHkMD"
+            + "bxG4/z6qCxADYzIFHR6I9Si9gzPQNRcFs2znrTp5pV5Mk6f1aqRgZxL3E4qUZ3xe"
+            + "PQhwAo3fSy3kCwLmFGqvzautSMHn8K5V1u+T5CSHqLFYKqj5FGtuB/xwoKDXH6UO"
+            + "P0+l5IP8H1RTjme3Fhqahec+zPG3NT57vc2Ru2t6PmuAwry2BMuSFMBs7wzXkyC3"
+            + "DbI54MV+IKPjHMORivK8uI8jmna9hdNVyBifCk1GcxkHBSCFvU8xJePsA/Q//zCe"
+            + "lvrnrIiMfY4CQTmKzke9MSzbAZQIRddgrGAsiX1tE8Z3YMd8lDpuujHLVEdWZo6s"
+            + "54OJuynHrtFFObdapu0uIrT+dEXSASMUbEuNCLL3aCnrEtGJCwxB2TPQvCCvR2BK"
+            + "zol6MGWxA+nmddeQib2r+GXoKXLdnHcpsAjA7lkXk3IFyJ7MLFK6uDrjGbGJs2FK"
+            + "SduUjS/Ib4hGBBARAgAGBQI1oic8AAoJEGx+4bhiHMATftYAn1fOaKDUOt+dS38r"
+            + "B+CJ2Q+iElWJAKDRPpp8q5GylbM8DPlMpClWN3TYqYhGBBARAgAGBQI27U5sAAoJ"
+            + "EF3iSZZbA1iiarYAn35qU3ZOlVECELE/3V6q98Q30eAaAKCtO+lacH0Qq1E6v4BP"
+            + "/9y6MoLIhohiBBMRAgAiAhsDBAsHAwIDFQIDAxYCAQIeAQIXgAUCP+mCaQUJDDMj"
+            + "ywAKCRBot6uJV1SNzaLvAJwLsPV1yfc2D+yT+2W11H/ftNMDvwCbBweORhCb/O/E"
+            + "Okg2UTXJBR4ekoCIXQQTEQIAHQMLBAMFFQMCBgEDFgIBAheABQI/6YJzBQkMMyPL"
+            + "AAoJEGi3q4lXVI3NgroAn2Z+4KgVo2nzW72TgCJwkAP0cOc2AJ0ZMilsOWmxmEG6"
+            + "B4sHMLkB4ir4GIhdBBMRAgAdAwsEAwUVAwIGAQMWAgECF4AFAj/pgnMFCQwzI8sA"
+            + "CgkQaLeriVdUjc2CugCfRrOIfllp3mSmGpHgIxvg5V8vtMcAn0BvKVehOn+12Yvn"
+            + "9BCHfg34jUZbiF0EExECAB0DCwQDBRUDAgYBAxYCAQIXgAUCP+mCcwUJDDMjywAK"
+            + "CRBot6uJV1SNzYK6AJ9x7R+daNIjkieNW6lJeVUIoj1UHgCeLZm025uULML/5DFs"
+            + "4tUvXs8n9XiZAaIENaIg8xEEALYPe0XNsPjx+inTQ+Izz527ZJnoc6BhWik/4a2b"
+            + "ZYENSOQXAMKTDQMv2lLeI0i6ceB967MNubhHeVdNeOWYHFSM1UGRfhmZERISho3b"
+            + "p+wVZvVG8GBVwpw34PJjgYU/0tDwnJaJ8BzX6j0ecTSTjQPnaUEtdJ/u/gmG9j02"
+            + "18TzAKDihdNoKJEU9IKUiSjdGomSuem/VwQArHfaucSiDmY8+zyZbVLLnK6UJMqt"
+            + "sIv1LvAg20xwXoUk2bY8H3tXL4UZ8YcoSXYozwALq3cIo5UZJ0q9Of71mI8WLK2i"
+            + "FSYVplpTX0WMClAdkGt3HgVb7xtOhGt1mEKeRQjNZ2LteUQrRDD9MTQ+XxcvEN0I"
+            + "pAj4kBJe9bR6HzAD/iecCmGwSlHUZZrgqWzv78o79XxDdcuLdl4i2fL7kwEOf9js"
+            + "De7hGs27yrdJEmAG9QF9TOF9LJFmE1CqkgW+EpKxsY01Wjm0BFJB1R7iPUaUtFRZ"
+            + "xYqfgXarmPjql2iBi+cVjLzGu+4BSojVAPgP/hhcnIowf4M4edPiICMP1GVjtCFX"
+            + "ZXJuZXIgS29jaCA8d2VybmVyLmtvY2hAZ3V1Zy5kZT6IYwQTEQIAGwUCNs8JNwUJ"
+            + "CCCxRAMLCgMDFQMCAxYCAQIXgAASCRBsfuG4YhzAEwdlR1BHAAEBaSAAn3YkpT5h"
+            + "xgehGFfnX7izd+c8jI0SAJ9qJZ6jJvXnGB07p60aIPYxgJbLmYkAdQMFEDWjdxQd"
+            + "GfTBDJhXpQEBPfMC/0cxo+4xYVAplFO0nIYyjQgP7D8O0ufzPsIwF3kvb7b5FNNj"
+            + "fp+DAhN6G0HOIgkL3GsWtCfH5UHali+mtNFIKDpTtr+F/lPpZP3OPzzsLZS4hYTq"
+            + "mMs1O/ACq8axKgAilYkBXwMFEDWiJw4DbxG4/z6qCxADB9wFH0i6mmn6rWYKFepJ"
+            + "hXyhE4wWqRPJAnvfoiWUntDp4aIQys6lORigVXIWo4k4SK/FH59YnzF7578qrTZW"
+            + "/RcA0bIqJqzqaqsOdTYEFa49cCjvLnBW4OebJlLTUs/nnmU0FWKW8OwwL+pCu8d7"
+            + "fLSSnggBsrUQwbepuw0cJoctFPAz5T1nQJieQKVsHaCNwL2du0XefOgF5ujB1jK1"
+            + "q3p4UysF9hEcBR9ltE3THr+iv4jtZXmC1P4at9W5LFWsYuwr0U3yJcaKSKp0v/wG"
+            + "EWe2J/gFQZ0hB1+35RrCZPgiWsEv87CHaG6XtQ+3HhirBCJsYhmOikVKoEan6PhU"
+            + "VR1qlXEytpAt389TBnvyceAX8hcHOE3diuGvILEgYes3gw3s5ZmM7bUX3jm2BrX8"
+            + "WchexUFUQIuKW2cL379MFXR8TbxpVxrsRYE/4jHZBYhGBBARAgAGBQI27U4LAAoJ"
+            + "EF3iSZZbA1iifJoAoLEsGy16hV/CfmDku6D1CBUIxXvpAJ9GBApdC/3OXig7sBrV"
+            + "CWOb3MQzcLkBjQQ2zwcIEAYA9zWEKm5eZpMMBRsipL0IUeSKEyeKUjABX4vYNurl"
+            + "44+2h6Y8rHn7rG1l/PNj39UJXBkLFj1jk8Q32v+3BQDjvwv8U5e/kTgGlf7hH3WS"
+            + "W38RkZw18OXYCvnoWkYneIuDj6/HH2bVNXmTac05RkBUPUv4yhqlaFpkVcswKGuE"
+            + "NRxujv/UWvVF+/2P8uSQgkmGp/cbwfMTkC8JBVLLBRrJhl1uap2JjZuSVklUUBez"
+            + "Vf3NJMagVzx47HPqLVl4yr4bAAMGBf9PujlH5I5OUnvZpz+DXbV/WQVfV1tGRCra"
+            + "kIj3mpN6GnUDF1LAbe6vayUUJ+LxkM1SqQVcmuy/maHXJ+qrvNLlPqUZPmU5cINl"
+            + "sA7bCo1ljVUp54J1y8PZUx6HxfEl/LzLVkr+ITWnyqeiRikDecUf4kix2teTlx6I"
+            + "3ecqT5oNqZSRXWwnN4SbkXtAd7rSgEptUYhQXgSEarp1pXJ4J4rgqFa49jKISDJq"
+            + "rn/ElltHe5Fx1bpfkCIYlYk45Cga9bOIVAQYEQIADAUCNs8HCAUJBvPJAAASCRBs"
+            + "fuG4YhzAEwdlR1BHAAEBeRUAoIGpCDmMy195TatlloHAJEjZu5KaAJwOvW989hOb"
+            + "8cg924YIFVA1+4/Ia7kBjQQ1oiE8FAYAkQmAlOXixb8wra83rE1i7LCENLzlvBZW"
+            + "KBXN4ONelZAnnkOm7IqRjMhtKRJN75zqVyKUaUwDKjpf9J5K2t75mSxBtnbNRqL3"
+            + "XodjHK93OcAUkz3ci7iuC/b24JI2q4XeQG/v4YR1VodM0zEQ1IC0JCq4Pl39QZyX"
+            + "JdZCrUFvMcXq5ruNSldztBqTFFUiFbkw1Fug/ZyXJve2FVcbsRXFrB7EEuy+iiU/"
+            + "kZ/NViKk0L4T6KRHVsEiriNlCiibW19fAAMFBf9Tbv67KFMDrLqQan/0oSSodjDQ"
+            + "KDGqtoh7KQYIKPXqfqT8ced9yd5MLFwPKf3t7AWG1ucW2x118ANYkPSU122UTndP"
+            + "sax0cY4XkaHxaNwpNFCotGQ0URShxKNpcqbdfvy+1d8ppEavgOyxnV1JOkLjZJLw"
+            + "K8bgxFdbPWcsJJnjuuH3Pwz87CzTgOSYQxMPnIwQcx5buZIV5NeELJtcbbd3RVua"
+            + "K/GQht8QJpuXSji8Nl1FihYDjACR8TaRlAh50GmIRgQoEQIABgUCOCv7gwAKCRBs"
+            + "fuG4YhzAE9hTAJ9cRHu+7q2hkxpFfnok4mRisofCTgCgzoPjNIuYiiV6+wLB5o11"
+            + "7MNWPZCIVAQYEQIADAUCNaIhPAUJB4TOAAASCRBsfuG4YhzAEwdlR1BHAAEBDfUA"
+            + "oLstR8cg5QtHwSQ3nFCOKEREUFIwAKDID3K3hM+b6jW1o+tNX9dnjb+YMZkAbQIw"
+            + "bYOUAAABAwC7ltmO5vdKssohwzXEZeYvDW2ll3CYD2I+ruiNq0ybxkfFBopq9cxt"
+            + "a0OvVML4LK/TH+60f/Fqx9wg2yk9APXyaomdLrXfWyfZ91YtNCfj3ElC4XB4qqm0"
+            + "HRn0wQyYV6UABRG0IVdlcm5lciBLb2NoIDx3ZXJuZXIua29jaEBndXVnLmRlPokA"
+            + "lQMFEDRfoOmOB31Gi6BmjQEBzwgD/2fHcdDXuRRY+SHvIVESweijstB+2/sVRp+F"
+            + "CDjR74Kg576sJHfTJCxtSSmzpaVpelb5z4URGJ/Byi5L9AU7hC75S1ZnJ+MjBT6V"
+            + "ePyk/r0uBrMkU/lMG7lk/y2By3Hll+edjzJsdwn6aoNPiyen4Ch4UGTEguxYsLq0"
+            + "HES/UvojiQEVAwUTNECE2gnp+QqKck5FAQH+1Af/QMlYPlLG+5E19qP6AilKQUzN"
+            + "kd1TWMenXTS66hGIVwkLVQDi6RCimhnLMq/F7ENA8bSbyyMuncaBz5dH4kjfiDp1"
+            + "o64LULcTmN1LW9ctpTAIeLLJZnwxoJLkUbLUYKADKqIBXHMt2B0zRmhFOqEjRN+P"
+            + "hI7XCcHeHWHiDeUB58QKMyeoJ/QG/7zLwnNgDN2PVqq2E72C3ye5FOkYLcHfWKyB"
+            + "Rrn6BdUphAB0LxZujSGk8ohZFbia+zxpWdE8xSBhZbjVGlwLurmS2UTjjxByBNih"
+            + "eUD6IC3u5P6psld0OfqnpriZofP0CBP2oTk65r529f/1lsy2kfWrVPYIFJXEnIkA"
+            + "lQMFEDQyneGkWMS9SnJfMQEBMBMD/1ADuhhuY9kyN7Oj6DPrDt5SpPQDGS0Jtw3y"
+            + "uIPoed+xyzlrEuL2HeaOj1O9urpn8XLN7V21ajkzlqsxnGkOuifbE9UT67o2b2vC"
+            + "ldCcY4nV5n+U1snMDwNv+RkcEgNa8ANiWkm03UItd7/FpHDQP0FIgbPEPwRoBN87"
+            + "I4gaebfRiQCVAwUQNDUSwxRNm5Suj3z1AQGMTAP/UaXXMhPzcjjLxBW0AccTdHUt"
+            + "Li+K+rS5PNxxef2nnasEhCdK4GkM9nwJgsP0EZxCG3ZSAIlWIgQ3MK3ZAV1Au5pL"
+            + "KolRjFyEZF420wAtiE7V+4lw3FCqNoXDJEFC3BW431kx1wAhDk9VaIHHadYcof4d"
+            + "dmMLQOW2cJ7LDEEBW/WJAJUDBRA0M/VQImbGhU33abUBARcoA/9eerDBZGPCuGyE"
+            + "mQBcr24KPJHWv/EZIKl5DM/Ynz1YZZbzLcvEFww34mvY0jCfoVcCKIeFFBMKiSKr"
+            + "OMtoVC6cQMKpmhE9hYRStw4E0bcf0BD/stepdVtpwRnG8SDP2ZbmtgyjYT/7T4Yt"
+            + "6/0f6N/0NC7E9qfq4ZlpU3uCGGu/44kAlQMFEDQz8kp2sPVxuCQEdQEBc5YD/Rix"
+            + "vFcLTO1HznbblrO0WMzQc+R4qQ50CmCpWcFMwvVeQHo/bxoxGggNMmuVT0bqf7Mo"
+            + "lZDSJNS96IAN32uf25tYHgERnQaMhmi1aSHvRDh4jxFu8gGVgL6lWit/vBDW/BiF"
+            + "BCH6sZJJrGSuSdpecTtaWC8OJGDoKTO9PqAA/HQRiQB1AwUQNDJSx011eFs7VOAZ"
+            + "AQGdKQL/ea3qD2OP3wVTzXvfjQL1CosX4wyKusBBhdt9u2vOT+KWkiRk1o35nIOG"
+            + "uZLHtSFQDY8CVDOkqg6g4sVbOcTl8QUwHA+A4AVDInwTm1m4Bk4oeCIwk4Bp6mDd"
+            + "W11g28k/iQEVAgUSNDIWPm/Y4wPDeaMxAQGvBQgAqGhzA/21K7oL/L5S5Xz//eO7"
+            + "J8hgvqqGXWd13drNy3bHbKPn7TxilkA3ca24st+6YPZDdSUHLMCqg16YOMyQF8gE"
+            + "kX7ZHWPacVoUpCmSz1uQ3p6W3+u5UCkRpgQN8wBbJx5ZpBBqeq5q/31okaoNjzA2"
+            + "ghEWyR5Ll+U0C87MY7pc7PlNHGCr0ZNOhhtf1jU+H9ag5UyT6exIYim3QqWYruiC"
+            + "LSUcim0l3wK7LMW1w/7Q6cWfAFQvl3rGjt3rg6OWg9J4H2h5ukf5JNiRybkupmat"
+            + "UM+OVMRkf93jzU62kbyZpJBHiQZuxxJaLkhpv2RgWib9pbkftwEy/ZnmjkxlIIkA"
+            + "lQMFEDQvWjh4313xYR8/NQEB37QEAIi9vR9h9ennz8Vi7RNU413h1ZoZjxfEbOpk"
+            + "QAjE/LrZ/L5WiWdoStSiyqCLPoyPpQafiU8nTOr1KmY4RgceJNgxIW4OiSMoSvrh"
+            + "c2kqP+skb8A2B4+47Aqjr5fSAVfVfrDMqDGireOguhQ/hf9BOYsM0gs+ROdtyLWP"
+            + "tMjRnFlviD8DBRAz8qQSj6lRT5YOKXIRAntSAJ9StSEMBoFvk8iRWpXb6+LDNLUW"
+            + "zACfT8iY3IxwvMF6jjCHrbuxQkL7chSJARUDBRA0MMO7569NIyeqD3EBATIAB/4t"
+            + "CPZ1sLWO07g2ZCpiP1HlYpf5PENaXtaasFvhWch7eUe3DksuMEPzB5GnauoQZAku"
+            + "hEGkoEfrfL3AXtXH+WMm2t7dIcTBD4p3XkeZ+PgJpKiASXDyul9rumXXvMxSL4KV"
+            + "7ar+F1ZJ0ycCx2r2au0prPao70hDAzLTy16hrWgvdHSK7+wwaYO5TPCL5JDmcB+d"
+            + "HKW72qNUOD0pxbe0uCkkb+gDxeVX28pZEkIIOMMV/eAs5bs/smV+eJqWT/EyfVBD"
+            + "o7heF2aeyJj5ecxNOODr88xKF7qEpqazCQ4xhvFY+Yn6+vNCcYfkoZbOn0XQAvqf"
+            + "a2Vab9woVIVSaDji/mlPiQB1AwUQNDC233FfeD4HYGBJAQFh6QL/XCgm5O3q9kWp"
+            + "gts1MHKoHoh7vxSSQGSP2k7flNP1UB2nv4sKvyGM8eJKApuROIodcTkccM4qXaBu"
+            + "XunMr5kJlvDJPm+NLzKyhtQP2fWI7xGYwiCiB29gm1GFMjdur4amiQEVAwUQNDBR"
+            + "9fjDdqGixRdJAQE+mAf+JyqJZEVFwNwZ2hSIMewekC1r7N97p924nqfZKnzn6weF"
+            + "pE80KIJSWtEVzI0XvHlVCOnS+WRxn7zxwrOTbrcEOy0goVbNgUsP5ypZa2/EM546"
+            + "uyyJTvgD0nwA45Q4bP5sGhjh0G63r9Vwov7itFe4RDBGM8ibGnZTr9hHo469jpom"
+            + "HSNeavcaUYyEqcr4GbpQmdpJTnn/H0A+fMl7ZHRoaclNx9ZksxihuCRrkQvUOb3u"
+            + "RD9lFIhCvNwEardN62dKOKJXmn1TOtyanZvnmWigU5AmGuk6FpsClm3p5vvlid64"
+            + "i49fZt9vW5krs2XfUevR4oL0IyUl+qW2HN0DIlDiAYkAlQMFEDQvbv2wcgJwUPMh"
+            + "JQEBVBID/iOtS8CQfMxtG0EmrfaeVUU8R/pegBmVWDBULAp8CLTtdfxjVzs/6DXw"
+            + "0RogXMRRl2aFfu1Yp0xhBYjII6Kque/FzAFXY9VNF1peqnPt7ADdeptYMppZa8sG"
+            + "n9BBRu9Fsw69z6JkyqvMiVxGcKy3XEpVGr0JHx8Xt6BYdrULiKr2iQB1AwUQNC68"
+            + "n6jZR/ntlUftAQFaYgL+NUYEj/sX9M5xq1ORX0SsVPMpNamHO3JBSmZSIzjiox5M"
+            + "AqoFOCigAkonuzk5aBy/bRHy1cmDBOxf4mNhzrH8N6IkGvPE70cimDnbFvr+hoZS"
+            + "jIqxtELNZsLuLVavLPAXiQCVAwUQNC6vWocCuHlnLQXBAQHb1gQAugp62aVzDCuz"
+            + "4ntfXsmlGbLY7o5oZXYIKdPP4riOj4imcJh6cSgYFL6OMzeIp9VW/PHo2mk8kkdk"
+            + "z5uif5LqOkEuIxgra7p1Yq/LL4YVhWGQeD8hwpmu+ulYoPOw40dVYS36PwrHIH9a"
+            + "fNhl8Or5O2VIHIWnoQ++9r6gwngFQOyJAJUDBRAzHnkh1sNKtX1rroUBAWphBACd"
+            + "huqm7GHoiXptQ/Y5F6BivCjxr9ch+gPSjaLMhq0kBHVO+TbXyVefVVGVgCYvFPjo"
+            + "zM8PEVykQAtY//eJ475aGXjF+BOAhl2z0IMkQKCJMExoEDHbcj0jIIMZ2/+ptgtb"
+            + "FSyJ2DQ3vvCdbw/1kyPHTPfP+L2u40GWMIYVBbyouokAlQMFEDMe7+UZsymln7HG"
+            + "2QEBzMED/3L0DyPK/u6PyAd1AdpjUODTkWTZjZ6XA2ubc6IXXsZWpmCgB/24v8js"
+            + "J3DIsvUD3Ke55kTr6xV+au+mAkwOQqWUTUWfQCkSrSDlbUJ1VPBzhyTpuzjBopte"
+            + "7o3R6XXfcLiC5jY6eCX0QtLGhKpLjTr5uRhf1fYODGsAGXmCByDviQB1AgUQMy6U"
+            + "MB0Z9MEMmFelAQHV4AMAjdFUIyFtpTr5jkyZSd3y//0JGO0z9U9hLVxeBBCwvdEQ"
+            + "xsrpeTtVdqpeKZxHN1GhPCYvgLFZAQlcPh/Gc8u9uO7wVSgJc3zYKFThKpQevdF/"
+            + "rzjTCHfgigf5Iui0qiqBiQCVAwUQMx22bAtzgG/ED06dAQFi0gQAkosqTMWy+1eU"
+            + "Xbi2azFK3RX5ERf9wlN7mqh7TvwcPXvVWzUARnwRv+4kk3uOWI18q5UPis7KH3KY"
+            + "OVeRrPd8bbp6SjhBh82ourTEQUXLBDQiI1V1cZZmwwEdlnAnhFnkXgMBNM2q7oBe"
+            + "fRHADfYDfGo90wXyrVVL+GihDNpzUwOJAJUDBRAzHUFnOWvfULwOR3EBAbOYA/90"
+            + "JIrKmxhwP6quaheFOjjPoxDGEZpGJEOwejEByYj+AgONCRmQS3BydtubA+nm/32D"
+            + "FeG8pe/dnFvGc+QgNW560hK21C2KJj72mhjRlg/na7jz4/MmBAv5k61Q7roWi0rw"
+            + "x+R9NSHxpshC8A92zmvo8w/XzVSogC8pJ04jcnY6YokAlQMFEDMdPtta9LwlvuSC"
+            + "3QEBvPMD/3TJGroHhHYjHhiEpDZZVszeRQ0cvVI/uLLi5yq3W4F6Jy47DF8VckA7"
+            + "mw0bXrOMNACN7Je7uyaU85qvJC2wgoQpFGdFlkjmkAwDAjR+koEysiE8FomiOHhv"
+            + "EpEY/SjSS4jj4IPmgV8Vq66XjPw+i7Z0RsPLOIf67yZHxypNiBiYiQCVAwUQMxxw"
+            + "pKrq6G7/78D5AQHo2QQAjnp6KxOl6Vvv5rLQ/4rj3OemvF7IUUq34xb25i/BSvGB"
+            + "UpDQVUmhv/qIfWvDqWGZedyM+AlNSfUWPWnP41S8OH+lcERH2g2dGKGl7kH1F2Bx"
+            + "ByZlqREHm2q624wPPA35RLXtXIx06yYjLtJ7b+FCAX6PUgZktZYk5gwjdoAGrC2J"
+            + "AJUDBRAzGvcCKC6c7f53PGUBAUozA/9l/qKmcqbi8RtLsKQSh3vHds9d22zcbkuJ"
+            + "PBSoOv2D7i2VLshaQFjq+62uYZGE6nU1WP5sZcBDuWjoX4t4NrffnOG/1R9D0t1t"
+            + "9F47D77HJzjvo+J52SN520YHcbT8VoHdPRoEOXPN4tzhvn2GapVVdaAlWM0MLloh"
+            + "NH3I9jap9okAdQMFEDMZlUAnyXglSykrxQEBnuwC/jXbFL+jzs2HQCuo4gyVrPlU"
+            + "ksQCLYZjNnZtw1ca697GV3NhBhSXR9WHLQH+ZWnpTzg2iL3WYSdi9tbPs78iY1FS"
+            + "d4EG8H9V700oQG8dlICF5W2VjzR7fByNosKM70WSXYkBFQMFEDMWBsGCy1t9eckW"
+            + "HQEBHzMH/jmrsHwSPrA5R055VCTuDzdS0AJ+tuWkqIyqQQpqbost89Hxper3MmjL"
+            + "Jas/VJv8EheuU3vQ9a8sG2SnlWKLtzFqpk7TCkyq/H3blub0agREbNnYhHHTGQFC"
+            + "YJb4lWjWvMjfP+N5jvlLcnDqQPloXfAOgy7W90POoqFrsvhxdpnXgoLrzyNNja1O"
+            + "1NRj+Cdv/GmJYNi6sQe43zmXWeA7syLKMw6058joDqEJFKndgSp3Zy/yXmObOZ/H"
+            + "C2OJwA3gzEaAu8Pqd1svwGIGznqtTNCn9k1+rMvJPaxglg7PXIJS282hmBl9AcJl"
+            + "wmh2GUCswl9/sj+REWTb8SgJUbkFcp6JAJUDBRAwdboVMPfsgxioXMEBAQ/LA/9B"
+            + "FTZ9T95P/TtsxeC7lm9imk2mpNQCBEvXk286FQnGFtDodGfBfcH5SeKHaUNxFaXr"
+            + "39rDGUtoTE98iAX3qgCElf4V2rzgoHLpuQzCg3U35dfs1rIxlpcSDk5ivaHpPV3S"
+            + "v+mlqWL049y+3bGaZeAnwM6kvGMP2uccS9U6cbhpw4hGBBARAgAGBQI3GtRfAAoJ"
+            + "EF3iSZZbA1iikWUAoIpSuXzuN/CI63dZtT7RL7c/KtWUAJ929SAtTr9SlpSgxMC8"
+            + "Vk1T1i5/SYkBFQMFEzccnFnSJilEzmrGwQEBJxwH/2oauG+JlUC3zBUsoWhRQwqo"
+            + "7DdqaPl7sH5oCGDKS4x4CRA23U15NicDI7ox6EizkwCjk0dRr1EeRK+RqL1b/2T4"
+            + "2B6nynOLhRG2A0BPHRRJLcoL4nKfoPSo/6dIC+3iVliGEl90KZZD5bnONrVJQkRj"
+            + "ZL8Ao+9IpmoYh8XjS5xMLEF9oAQqAkA93nVBm56lKmaL1kl+M3dJFtNKtVB8de1Z"
+            + "XifDs8HykD42qYVtcseCKxZXhC3UTG5YLNhPvgZKH8WBCr3zcR13hFDxuecUmu0M"
+            + "VhvEzoKyBYYt0rrqnyWrxwbv4gSTUWH5ZbgsTjc1SYKZxz6hrPQnfYWzNkznlFWJ"
+            + "ARUDBRM0xL43CdxwOTnzf10BATOCB/0Q6WrpzwPMofjHj54MiGLKVP++Yfwzdvns"
+            + "HxVpTZLZ5Ux8ErDsnLmvUGphnLVELZwEkEGRjln7a19h9oL8UYZaV+IcR6tQ06Fb"
+            + "1ldR+q+3nXtBYzGhleXdgJQSKLJkzPF72tvY0DHUB//GUV9IBLQMvfG8If/AFsih"
+            + "4iXi96DOtUAbeuIhnMlWwLJFeGjLLsX1u6HSX33xy4bGX6v/UcHbTSSYaxzb92GR"
+            + "/xpP2Xt332hOFRkDZL52g27HS0UrEJWdAVZbh25KbZEl7C6zX/82OZ5nTEziHo20"
+            + "eOS6Nrt2+gLSeA9X5h/+qUx30kTPz2LUPBQyIqLCJkHM8+0q5j9ciQCiAwUTNMS+"
+            + "HZFeTizbCJMJAQFrGgRlEAkG1FYU4ufTxsaxhFZy7xv18527Yxpls6mSCi1HL55n"
+            + "Joce6TI+Z34MrLOaiZljeQP3EUgzA+cs1sFRago4qz2wS8McmQ9w0FNQQMz4vVg9"
+            + "CVi1JUVd4EWYvJpA8swDd5b9+AodYFEsfxt9Z3aP+AcWFb10RlVVsNw9EhObc6IM"
+            + "nwAOHCEI9vp5FzzFiQCVAwUQNxyr6UyjTSyISdw9AQHf+wP+K+q6hIQ09tkgaYaD"
+            + "LlWKLbuxePXqM4oO72qi70Gkg0PV5nU4l368R6W5xgR8ZkxlQlg85sJ0bL6wW/Sj"
+            + "Mz7pP9hkhNwk0x3IFkGMTYG8i6Gt8Nm7x70dzJoiC+A496PryYC0rvGVf+Om8j5u"
+            + "TexBBjb/jpJhAQ/SGqeDeCHheOC0Lldlcm5lciBLb2NoIChtZWluIGFsdGVyIGtl"
+            + "eSkgPHdrQGNvbXB1dGVyLm9yZz6JAHUDBRM2G2MyHRn0wQyYV6UBASKKAv4wzmK7"
+            + "a9Z+g0KH+6W8ffIhzrQo8wDAU9X1WJKzJjS205tx4mmdnAt58yReBc/+5HXTI8IK"
+            + "R8IgF+LVXKWAGv5P5AqGhnPMeQSCs1JYdf9MPvbe34jD8wA1LTWFXn9e/cWIRgQQ"
+            + "EQIABgUCNxrUaQAKCRBd4kmWWwNYovRiAJ9dJBVfjx9lGARoFXmAieYrMGDrmwCZ"
+            + "AQyO4Wo0ntQ+iq4do9M3/FTFjiCZAaIENu1I6REEAJRGEqcYgXJch5frUYBj2EkD"
+            + "kWAbhRqVXnmiF3PjCEGAPMMYsTddiU7wcKfiCAqKWWXow7BjTJl6Do8RT1jdKpPO"
+            + "lBJXqqPYzsyBxLzE6mLps0K7SLJlSKTQqSVRcx0jx78JWYGlAlP0Kh9sPV2w/rPh"
+            + "0LrPeOKXT7lZt/DrIhfPAKDL/sVqCrmY3QfvrT8kSKJcgtLWfQP/cfbqVNrGjW8a"
+            + "m631N3UVA3tWfpgM/T9OjmKmw44NE5XfPJTAXlCV5j7zNMUkDeoPkrFF8DvbpYQs"
+            + "4XWYHozDjhR2Q+eI6gZ0wfmhLHqqc2eVVkEG7dT57Wp9DAtCMe7RZfhnarTQMqlY"
+            + "tOEa/suiHk0qLo59NsyF8eh68IDNCeYD/Apzonwaq2EQ1OEpfFlp6LcSnS34+UGZ"
+            + "tTO4BgJdmEjr/QrIPp6bJDstgho+/2oR8yQwuHGJwbS/8ADA4IFEpLduSpzrABho"
+            + "7RuNQcm96bceRY+7Hza3zf7pg/JGdWOb+bC3S4TIpK+3sx3YNWs7eURwpGREeJi5"
+            + "/Seic+GXlGzltBpXZXJuZXIgS29jaCA8d2tAZ251cGcub3JnPohjBBMRAgAbBQI3"
+            + "Gs+QBQkMyXyAAwsKAwMVAwIDFgIBAheAABIJEF3iSZZbA1iiB2VHUEcAAQFdwgCe"
+            + "O/s43kCLDMIsHCb2H3LC59clC5UAn1EyrqWk+qcOXLpQIrP6Qa3QSmXIiEYEEBEC"
+            + "AAYFAjca0T0ACgkQbH7huGIcwBOF9ACeNwO8G2G0ei03z0g/n3QZIpjbzvEAnRaE"
+            + "qX2PuBbClWoIP6h9yrRlAEbUiQB1AwUQNxrRYx0Z9MEMmFelAQHRrgL/QDNKPV5J"
+            + "gWziyzbHvEKfTIw/Ewv6El2MadVvQI8kbPN4qkPr2mZWwPzuc9rneCPQ1eL8AOdC"
+            + "8+ZyxWzx2vsrk/FcU5donMObva2ct4kqJN6xl8xjsxDTJhBSFRaiBJjxiEYEEBEC"
+            + "AAYFAjca0aMACgkQaLeriVdUjc0t+ACghK37H2vTYeXXieNJ8aZkiPJSte4An0WH"
+            + "FOotQdTW4NmZJK+Uqk5wbWlgiEYEEBECAAYFAjdPH10ACgkQ9u7fIBhLxNktvgCe"
+            + "LnQ5eOxAJz+Cvkb7FnL/Ko6qc5YAnjhWWW5c1o3onvKEH2Je2wQa8T6iiEYEEBEC"
+            + "AAYFAjenJv4ACgkQmDRl2yFDlCJ+yQCfSy1zLftEfLuIHZsUHis9U0MlqLMAn2EI"
+            + "f7TI1M5OKysQcuFLRC58CfcfiEUEEBECAAYFAjfhQTMACgkQNmdg8X0u14h55wCf"
+            + "d5OZCV3L8Ahi4QW/JoXUU+ZB0M0AmPe2uw7WYDLOzv48H76tm6cy956IRgQQEQIA"
+            + "BgUCOCpiDwAKCRDj8lhUEo8OeRsdAJ9FHupRibBPG2t/4XDqF+xiMLL/8ACfV5F2"
+            + "SR0ITE4k/C+scS1nJ1KZUDW0C1dlcm5lciBLb2NoiGMEExECABsFAjbtSOoFCQzJ"
+            + "fIADCwoDAxUDAgMWAgECF4AAEgkQXeJJllsDWKIHZUdQRwABAbXWAJ9SCW0ieOpL"
+            + "7AY6vF+OIaMmw2ZW1gCgkto0eWfgpjAuVg6jXqR1wHt2pQOJAh4EEBQDAAYFAjcv"
+            + "WdQACgkQbEwxpbHVFWcNxQf/bg14WGJ0GWMNSuuOOR0WYzUaNtzYpiLSVyLrreXt"
+            + "o8LBNwzbgzj2ramW7Ri+tYJAHLhtua8ZgSeibmgBuZasF8db1m5NN1ZcHBXGTysA"
+            + "jp+KnicTZ9Orj75D9o3oSmMyRcisEhr+gkj0tVhGfOAOC6eKbufVuyYFDVIyOyUB"
+            + "GlW7ApemzAzYemfs3DdjHn87lkjHMVESO4fM5rtLuSc7cBfL/e6ljaWQc5W8S0gI"
+            + "Dv0VtL39pMW4BlpKa25r14oJywuUpvWCZusvDm7ZJnqZ/WmgOHQUsyYudTROpGIb"
+            + "lsNg8iqC6huWpGSBRdu3oRQRhkqpfVdszz6BB/nAx01q2wf/Q+U9XId1jyzxUL1S"
+            + "GgaYMf6QdyjHQ1oxuFLNxzM6C/M069twbNgXJ71RsDDXVxFZfSTjSiH100AP9+9h"
+            + "b5mycaXLUOXYDvOSFzHBd/LsjFNVrrFbDs5Xw+cLGVHOIgR5IWAfgu5d1PAZU9uQ"
+            + "VgdGnQfmZg383RSPxvR3fnZz1rHNUGmS6w7x6FVbxa1QU2t38gNacIwHATAPcBpy"
+            + "JLfXoznbpg3ADbgCGyDjBwnuPQEQkYwRakbczRrge8IaPZbt2HYPoUsduXMZyJI8"
+            + "z5tvu7pUDws51nV1EX15BcN3++aY5pUyA1ItaaDymQVmoFbQC0BNMzMO53dMnFko"
+            + "4i42kohGBBARAgAGBQI3OvmjAAoJEHUPZJXInZM+hosAnRntCkj/70shGTPxgpUF"
+            + "74zA+EbzAKCcMkyHXIz2W0Isw3gDt27Z9ggsE4hGBBARAgAGBQI3NyPFAAoJEPbu"
+            + "3yAYS8TZh2UAoJVmzw85yHJzsXQ1vpO2IAPfv59NAJ9WY0oiYqb3q1MSxBRwG0gV"
+            + "iNCJ7YkBFQMFEDdD3tNSgFdEdlNAHQEByHEH/2JMfg71GgiyGJTKxCAymdyf2j2y"
+            + "fH6wI782JK4BWV4c0E/V38q+jpIYslihV9t8s8w1XK5niMaLwlCOyBWOkDP3ech6"
+            + "+GPPtfB3cmlL2hS896PWZ1adQHgCeQpB837n56yj0aTs4L1xarbSVT22lUwMiU6P"
+            + "wYdH2Rh8nh8FvN0IZsbln2nOj73qANQzNflmseUKF1Xh4ck8yLrRd4r6amhxAVAf"
+            + "cYFRJN4zdLL3cmhgkt0ADZlzAwXnEjwdHHy7SvAJk1ecNOA9pFsOJbvnzufd1afs"
+            + "/CbG78I+0JDhg75Z2Nwq8eKjsKqiO0zz/vG5yWSndZvWkTWz3D3b1xr1Id2IRgQQ"
+            + "EQIABgUCOCpiHgAKCRDj8lhUEo8OeQ+QAKCbOTscyUnWHSrDo4fIy0MThEjhOgCe"
+            + "L4Kb7TWkd/OHQScVBO8sTUz0+2g=");
 
 //		private static readonly byte[] pub6check = Base64.Decode("62O9");
 
-		//
-		// revoked sub key
-		//
-		private static readonly byte[] pub7 = Base64.Decode(
-			"mQGiBEFOsIwRBADcjRx7nAs4RaWsQU6p8/ECLZD9sSeYc6CN6UDI96RKj0/hCzMs"
-			+ "qlA0+9fzGZ7ZEJ34nuvDKlhKGC7co5eOiE0a9EijxgcrZU/LClZWa4YfyNg/ri6I"
-			+ "yTyfOfrPQ33GNQt2iImDf3FKp7XKuY9nIxicGQEaW0kkuAmbV3oh0+9q8QCg/+fS"
-			+ "epDEqEE/+nKONULGizKUjMED/RtL6RThRftZ9DOSdBytGYd48z35pca/qZ6HA36K"
-			+ "PVQwi7V77VKQyKFLTOXPLnVyO85hyYB/Nv4DFHN+vcC7/49lfoyYMZlN+LarckHi"
-			+ "NL154wmmzygB/KKysvWBLgkErEBCD0xBDd89iTQNlDtVQAWGORVffl6WWjOAkliG"
-			+ "3dL6A/9A288HfFRnywqi3xddriV6wCPmStC3dkCS4vHk2ofS8uw4ZNoRlp1iEPna"
-			+ "ai2Xa9DX1tkhaGk2k96MqqbBdGpbW8sMA9otJ9xdMjWEm/CgJUFUFQf3zaVy3mkM"
-			+ "S2Lvb6P4Wc2l/diEEIyK8+PqJItSh0OVU3K9oM7ngHwVcalKILQVUkV2b2tlZCA8"
-			+ "UmV2b2tlZEB0ZWQ+iQBOBBARAgAOBQJBTrCMBAsDAgECGQEACgkQvglkcFA/c63+"
-			+ "QgCguh8rsJbPTtbhZcrqBi5Mo1bntLEAoPZQ0Kjmu2knRUpHBeUemHDB6zQeuQIN"
-			+ "BEFOsIwQCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoBp1ajFOmPQFXz"
-			+ "0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3bzpnhV5JZzf24rnRP"
-			+ "xfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9GAFgr5fSI/VhOSdvN"
-			+ "ILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67VYy4XTjTNP18F1dD"
-			+ "ox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMI"
-			+ "PWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICB/93zriSvSHqsi1FeEmUBo431Jkh"
-			+ "VerIzb6Plb1j6FIq+s3vyvx9K+dMvjotZqylWZj4GXpH+2xLJTjWkrGSfUZVI2Nk"
-			+ "nyOFxUCKLLqaqVBFAQIjULfvQfGEWiGQKk9aRLkdG+D+8Y2N9zYoBXoQ9arvvS/t"
-			+ "4mlOsiuaTe+BZ4x+BXTpF4b9sKZl7V8QP/TkoJWUdydkvxciHdWp7ssqyiKOFRhG"
-			+ "818knDfFQ3cn2w/RnOb+7AF9wDncXDPYLfpPv9b2qZoLrXcyvlLffGDUdWs553ut"
-			+ "1F5AprMURs8BGmY9BnjggfVubHdhTUoA4gVvrdaf+D9NwZAl0xK/5Y/oPuMZiQBG"
-			+ "BBgRAgAGBQJBTrCMAAoJEL4JZHBQP3Ot09gAoMmLKloVDP+WhDXnsM5VikxysZ4+"
-			+ "AKCrJAUO+lYAyPYwEwgK+bKmUGeKrIkARgQoEQIABgUCQU6wpQAKCRC+CWRwUD9z"
-			+ "rQK4AJ98kKFxGU6yhHPr6jYBJPWemTNOXgCfeGB3ox4PXeS4DJDuLy9yllytOjo=");
+        //
+        // revoked sub key
+        //
+        private static readonly byte[] pub7 = Base64.Decode(
+            "mQGiBEFOsIwRBADcjRx7nAs4RaWsQU6p8/ECLZD9sSeYc6CN6UDI96RKj0/hCzMs"
+            + "qlA0+9fzGZ7ZEJ34nuvDKlhKGC7co5eOiE0a9EijxgcrZU/LClZWa4YfyNg/ri6I"
+            + "yTyfOfrPQ33GNQt2iImDf3FKp7XKuY9nIxicGQEaW0kkuAmbV3oh0+9q8QCg/+fS"
+            + "epDEqEE/+nKONULGizKUjMED/RtL6RThRftZ9DOSdBytGYd48z35pca/qZ6HA36K"
+            + "PVQwi7V77VKQyKFLTOXPLnVyO85hyYB/Nv4DFHN+vcC7/49lfoyYMZlN+LarckHi"
+            + "NL154wmmzygB/KKysvWBLgkErEBCD0xBDd89iTQNlDtVQAWGORVffl6WWjOAkliG"
+            + "3dL6A/9A288HfFRnywqi3xddriV6wCPmStC3dkCS4vHk2ofS8uw4ZNoRlp1iEPna"
+            + "ai2Xa9DX1tkhaGk2k96MqqbBdGpbW8sMA9otJ9xdMjWEm/CgJUFUFQf3zaVy3mkM"
+            + "S2Lvb6P4Wc2l/diEEIyK8+PqJItSh0OVU3K9oM7ngHwVcalKILQVUkV2b2tlZCA8"
+            + "UmV2b2tlZEB0ZWQ+iQBOBBARAgAOBQJBTrCMBAsDAgECGQEACgkQvglkcFA/c63+"
+            + "QgCguh8rsJbPTtbhZcrqBi5Mo1bntLEAoPZQ0Kjmu2knRUpHBeUemHDB6zQeuQIN"
+            + "BEFOsIwQCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoBp1ajFOmPQFXz"
+            + "0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3bzpnhV5JZzf24rnRP"
+            + "xfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9GAFgr5fSI/VhOSdvN"
+            + "ILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67VYy4XTjTNP18F1dD"
+            + "ox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMI"
+            + "PWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICB/93zriSvSHqsi1FeEmUBo431Jkh"
+            + "VerIzb6Plb1j6FIq+s3vyvx9K+dMvjotZqylWZj4GXpH+2xLJTjWkrGSfUZVI2Nk"
+            + "nyOFxUCKLLqaqVBFAQIjULfvQfGEWiGQKk9aRLkdG+D+8Y2N9zYoBXoQ9arvvS/t"
+            + "4mlOsiuaTe+BZ4x+BXTpF4b9sKZl7V8QP/TkoJWUdydkvxciHdWp7ssqyiKOFRhG"
+            + "818knDfFQ3cn2w/RnOb+7AF9wDncXDPYLfpPv9b2qZoLrXcyvlLffGDUdWs553ut"
+            + "1F5AprMURs8BGmY9BnjggfVubHdhTUoA4gVvrdaf+D9NwZAl0xK/5Y/oPuMZiQBG"
+            + "BBgRAgAGBQJBTrCMAAoJEL4JZHBQP3Ot09gAoMmLKloVDP+WhDXnsM5VikxysZ4+"
+            + "AKCrJAUO+lYAyPYwEwgK+bKmUGeKrIkARgQoEQIABgUCQU6wpQAKCRC+CWRwUD9z"
+            + "rQK4AJ98kKFxGU6yhHPr6jYBJPWemTNOXgCfeGB3ox4PXeS4DJDuLy9yllytOjo=");
 
 //		private static readonly byte[] pub7check = Base64.Decode("f/YQ");
 
-		private static readonly byte[] pub8 = Base64.Decode(
-			"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"
-			+ "9Uqz3fUvGoewAWA=");
-
-		private static readonly byte[] sec8 = Base64.Decode(
-			"lQHpBEEcraYRBADFYj+uFOhHz5SdECvJ3Z03P47gzmWLQ5HH8fPYC9rrv7AgqFFX"
-			+ "aWlJJVMLua9e6xoCiDWJs/n4BbZ/weL/11ELg6XqUnzFhYyz0H2KFsPgQ/b9lWLY"
-			+ "MtcPMFy5jE33hv/ixHgYLFqoNaAIbg0lzYEW/otQ9IhRl16fO1Q/CQZZrQCg/9M2"
-			+ "V2BTmm9RYog86CXJtjawRBcD/RIqU0zulxZ2Zt4javKVxrGIwW3iBU935ebmJEIK"
-			+ "Y5EVkGKBOCvsApZ+RGzpYeR2uMsTnQi8RJgiAnjaoVPCdsVJE7uQ0h8XuJ5n5mJ2"
-			+ "kLCFlF2hj5ViicZzse+crC12CGtgRe8z23ubLRcd6IUGhVutK8/b5knZ22vE14JD"
-			+ "ykKdA/96ObzJQdiuuPsEWN799nUUCaYWPAoLAmiXuICSP4GEnxLbYHWo8zhMrVMT"
-			+ "9Q5x3h8cszUz7Acu2BXjP1m96msUNoxPOZtt88NlaFz1Q/JSbQTsVOMd9b/IRN6S"
-			+ "A/uU0BiKEMHXuT8HUHVPK49oCKhZrGFP3RT8HZxDKLmR/qrgZ/4JAwLXyWhb4pf4"
-			+ "nmCmD0lDwoYvatLiR7UQVM2MamxClIiT0lCPN9C2AYIFgRWAJNS215Tjx7P/dh7e"
-			+ "8sYfh5XEHErT3dMbsAGHtCFKaWEgWWl5dSA8eXlqaWFAbm93bWVkaWF0ZWNoLmNv"
-			+ "bT6wAwP//4kAXQQQEQIAHQUCQRytpgcLCQgHAwIKAhkBBRsDAAAABR4BAAAAAAoJ"
-			+ "EPT+Vvgr/2IUmWEAoJEyJ9B7CJfmjwVTT30UbdCctVRmAJ9akw6we6UYd82vF0FK"
-			+ "QTlSuqHXKbABZ50CawRBHK2mEAgA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlL"
-			+ "OCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N"
-			+ "286Z4VeSWc39uK50T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/"
-			+ "RgBYK+X0iP1YTknbzSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2O"
-			+ "u1WMuF040zT9fBdXQ6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqV"
-			+ "DNmWn6vQClCbAkbTCD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwACAgf/crbApFLO"
-			+ "QikN9lHbn62dDxuu/dNigNmjf/A3cX+vo8aPHTXnRDyDwQALRuqbitdbM6p1LFjG"
-			+ "8g84Aabk/jL7zzjJLqPe8pxeK1Pu+P44NzalXAYMsOOsxGuixIrz3Jw8IrpH/mkP"
-			+ "tG/iX0NaLZ+Au9eokdLb+6NR/a51r2qL3E0ycFciJ61HzZKKHi6d0VQ7CHozCz+j"
-			+ "d5530Mh1qq/ZjYDDjfP+snpyNIZXcLtGR/3HzkBqNgDcvClLx3322AWKDa7pX8DX"
-			+ "qiLr8znWhPRpH9kCTnSpRzhYGT25FRcvdj4/q/oUIET/Tp+BWW3BxAc7WgpgqEfn"
-			+ "fa0Mv72Zbn91gf4JAwITijME9IlFBGAwH6YmBtWIlnDiRbsq/Pxozuhbnes831il"
-			+ "KmdpUKXkiIfHY0MqrEWl3Dfn6PMJGTnhgqXMrDxx3uHrq0Jl2swRnAWIIO8gID7j"
-			+ "uPetUqEviPiwAYeJAEwEGBECAAwFAkEcraYFGwwAAAAACgkQ9P5W+Cv/YhShrgCg"
-			+ "+JW8m5nF3R/oZGuG87bXQBszkjMAoLhGPncuGKowJXMRVc70/8qwXQJLsAFn");
-
-		private static readonly char[] sec8pass = "qwertyui".ToCharArray();
-
-		private static readonly byte[] sec9 = Base64.Decode(
-			"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"
-			+ "6neEEX/i1Q==");
-
-		public char[] sec9pass = "foo".ToCharArray();
-
-		// version 4 keys with expiry dates
-		private static readonly byte[] pub10 = Base64.Decode(
-			"mQGiBEKqia0RBACc3hkufmscRSC4UvPZqMDsHm4+d/GXIr+3iNMSSEySJu8yk+k0"
-			+ "Xs11C/K+n+v1rnn2jGGknv+1lDY6w75TIcTE6o6HGKeIDxsAm8P3MhoGU1GNPamA"
-			+ "eTDeNybtrN/g6C65fCY9uI11hsUboYgQZ8ND22PB0VtvdOgq9D85qNUzxwCg1BbJ"
-			+ "ycAKd4VqEvQ2Zglp3dCSrFMD/Ambq1kZqYa69sp3b9BPKuAgUgUPoytOArEej3Bk"
-			+ "easAgAxNhWJy4GxigES3vk50rVi7w8XBuqbD1mQCzldF0HX0/A7PxLBv6od5uqqF"
-			+ "HFxIyxg/KBZLd9ZOrsSaoUWH58jZq98X/sFtJtRi5VuJagMxCIJD4mLgtMv7Unlb"
-			+ "/GrsA/9DEnObA/fNTgK70T+ZmPIS5tSt+bio30Aw4YGpPCGqpnm1u73b5kqX3U3B"
-			+ "P+vGDvFuqZYpqQA8byAueH0MbaDHI4CFugvShXvgysJxN7ov7/8qsZZUMfK1t2Nr"
-			+ "SAsPuKRbcY4gNKXIElKeXbyaET7vX7uAEKuxEwdYGFp/lNTkHLQgdGVzdCBrZXkg"
-			+ "KHRlc3QpIDx0ZXN0QHRlc3QudGVzdD6IZAQTEQIAJAUCQqqJrQIbAwUJACTqAAYL"
-			+ "CQgHAwIDFQIDAxYCAQIeAQIXgAAKCRDjDROQZRqIzDzLAJ42AeCRIBBjv8r8qw9y"
-			+ "laNj2GZ1sACgiWYHVXMA6B1H9I1kS3YsCd3Oq7qwAgAAuM0EQqqJrhADAKWkix8l"
-			+ "pJN7MMTXob4xFF1TvGll0UD1bDGOMMbes6aeXSbT9QXee/fH3GnijLY7wB+qTPv9"
-			+ "ohubrSpnv3yen3CEBW6Q2YK+NlCskma42Py8YMV2idmYjtJi1ckvHFWt5wADBQL/"
-			+ "fkB5Q5xSGgspMaTZmtmX3zG7ZDeZ0avP8e8mRL8UszCTpqs6vMZrXwyQLZPbtMYv"
-			+ "PQpuRGEeKj0ysimwYRA5rrLQjnRER3nyuuEUUgc4j+aeRxPf9WVsJ/a1FCHtaAP1"
-			+ "iE8EGBECAA8FAkKqia4CGwwFCQAk6gAACgkQ4w0TkGUaiMzdqgCfd66H7DL7kFGd"
-			+ "IoS+NIp8JO+noxAAn25si4QAF7og8+4T5YQUuhIhx/NesAIAAA==");
-
-		private static readonly byte[] sec10 = Base64.Decode(
-			"lQHhBEKqia0RBACc3hkufmscRSC4UvPZqMDsHm4+d/GXIr+3iNMSSEySJu8yk+k0"
-			+ "Xs11C/K+n+v1rnn2jGGknv+1lDY6w75TIcTE6o6HGKeIDxsAm8P3MhoGU1GNPamA"
-			+ "eTDeNybtrN/g6C65fCY9uI11hsUboYgQZ8ND22PB0VtvdOgq9D85qNUzxwCg1BbJ"
-			+ "ycAKd4VqEvQ2Zglp3dCSrFMD/Ambq1kZqYa69sp3b9BPKuAgUgUPoytOArEej3Bk"
-			+ "easAgAxNhWJy4GxigES3vk50rVi7w8XBuqbD1mQCzldF0HX0/A7PxLBv6od5uqqF"
-			+ "HFxIyxg/KBZLd9ZOrsSaoUWH58jZq98X/sFtJtRi5VuJagMxCIJD4mLgtMv7Unlb"
-			+ "/GrsA/9DEnObA/fNTgK70T+ZmPIS5tSt+bio30Aw4YGpPCGqpnm1u73b5kqX3U3B"
-			+ "P+vGDvFuqZYpqQA8byAueH0MbaDHI4CFugvShXvgysJxN7ov7/8qsZZUMfK1t2Nr"
-			+ "SAsPuKRbcY4gNKXIElKeXbyaET7vX7uAEKuxEwdYGFp/lNTkHP4DAwLssmOjVC+d"
-			+ "mWB783Lpzjb9evKzsxisTdx8/jHpUSS+r//6/Guyx3aA/zUw5bbftItW57mhuNNb"
-			+ "JTu7WrQgdGVzdCBrZXkgKHRlc3QpIDx0ZXN0QHRlc3QudGVzdD6IZAQTEQIAJAUC"
-			+ "QqqJrQIbAwUJACTqAAYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRDjDROQZRqIzDzL"
-			+ "AJ0cYPwKeoSReY14LqJtAjnkX7URHACgsRZWfpbalrSyDnq3TtZeGPUqGX+wAgAA"
-			+ "nQEUBEKqia4QAwClpIsfJaSTezDE16G+MRRdU7xpZdFA9WwxjjDG3rOmnl0m0/UF"
-			+ "3nv3x9xp4oy2O8Afqkz7/aIbm60qZ798np9whAVukNmCvjZQrJJmuNj8vGDFdonZ"
-			+ "mI7SYtXJLxxVrecAAwUC/35AeUOcUhoLKTGk2ZrZl98xu2Q3mdGrz/HvJkS/FLMw"
-			+ "k6arOrzGa18MkC2T27TGLz0KbkRhHio9MrIpsGEQOa6y0I50REd58rrhFFIHOI/m"
-			+ "nkcT3/VlbCf2tRQh7WgD9f4DAwLssmOjVC+dmWDXVLRopzxbBGOvodp/LZoSDb56"
-			+ "gNJjDMJ1aXqWW9qTAg1CFjBq73J3oFpVzInXZ8+Q8inxv7bnWiHbiE8EGBECAA8F"
-			+ "AkKqia4CGwwFCQAk6gAACgkQ4w0TkGUaiMzdqgCgl2jw5hfk/JsyjulQqe1Nps1q"
-			+ "Lx0AoMdnFMZmTMLHn8scUW2j9XO312tmsAIAAA==");
+        private static readonly byte[] pub8 = Base64.Decode(
+            "mQGiBEEcraYRBADFYj+uFOhHz5SdECvJ3Z03P47gzmWLQ5HH8fPYC9rrv7AgqFFX"
+            + "aWlJJVMLua9e6xoCiDWJs/n4BbZ/weL/11ELg6XqUnzFhYyz0H2KFsPgQ/b9lWLY"
+            + "MtcPMFy5jE33hv/ixHgYLFqoNaAIbg0lzYEW/otQ9IhRl16fO1Q/CQZZrQCg/9M2"
+            + "V2BTmm9RYog86CXJtjawRBcD/RIqU0zulxZ2Zt4javKVxrGIwW3iBU935ebmJEIK"
+            + "Y5EVkGKBOCvsApZ+RGzpYeR2uMsTnQi8RJgiAnjaoVPCdsVJE7uQ0h8XuJ5n5mJ2"
+            + "kLCFlF2hj5ViicZzse+crC12CGtgRe8z23ubLRcd6IUGhVutK8/b5knZ22vE14JD"
+            + "ykKdA/96ObzJQdiuuPsEWN799nUUCaYWPAoLAmiXuICSP4GEnxLbYHWo8zhMrVMT"
+            + "9Q5x3h8cszUz7Acu2BXjP1m96msUNoxPOZtt88NlaFz1Q/JSbQTsVOMd9b/IRN6S"
+            + "A/uU0BiKEMHXuT8HUHVPK49oCKhZrGFP3RT8HZxDKLmR/qrgZ7ABh7QhSmlhIFlp"
+            + "eXUgPHl5amlhQG5vd21lZGlhdGVjaC5jb20+sAMD//+JAF0EEBECAB0FAkEcraYH"
+            + "CwkIBwMCCgIZAQUbAwAAAAUeAQAAAAAKCRD0/lb4K/9iFJlhAKCRMifQewiX5o8F"
+            + "U099FG3QnLVUZgCfWpMOsHulGHfNrxdBSkE5Urqh1ymwAWe5Ag0EQRytphAIAPZC"
+            + "V7cIfwgXcqK61qlC8wXo+VMROU+28W65Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdM"
+            + "ZIZJ+AyDvWXpF9Sh01D49Vlf3HZSTz09jdvOmeFXklnN/biudE/F/Ha8g8VHMGHO"
+            + "fMlm/xX5u/2RXscBqtNbno2gpXI61Brwv0YAWCvl9Ij9WE5J280gtJ3kkQc2azNs"
+            + "OA1FHQ98iLMcfFstjvbzySPAQ/ClWxiNjrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq"
+            + "/zzhsSlAGBGNfISnCnLWhsQDGcgHKXrKlQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2J"
+            + "SyIZJrqrol7DVekyCzsAAgIH/3K2wKRSzkIpDfZR25+tnQ8brv3TYoDZo3/wN3F/"
+            + "r6PGjx0150Q8g8EAC0bqm4rXWzOqdSxYxvIPOAGm5P4y+884yS6j3vKcXitT7vj+"
+            + "ODc2pVwGDLDjrMRrosSK89ycPCK6R/5pD7Rv4l9DWi2fgLvXqJHS2/ujUf2uda9q"
+            + "i9xNMnBXIietR82Sih4undFUOwh6Mws/o3eed9DIdaqv2Y2Aw43z/rJ6cjSGV3C7"
+            + "Rkf9x85AajYA3LwpS8d99tgFig2u6V/A16oi6/M51oT0aR/ZAk50qUc4WBk9uRUX"
+            + "L3Y+P6v6FCBE/06fgVltwcQHO1oKYKhH532tDL+9mW5/dYGwAYeJAEwEGBECAAwF"
+            + "AkEcraYFGwwAAAAACgkQ9P5W+Cv/YhShrgCg+JW8m5nF3R/oZGuG87bXQBszkjMA"
+            + "oLhGPncuGKowJXMRVc70/8qwXQJLsAFnmQGiBD2K5rYRBADD6kznWZA9nH/pMlk0"
+            + "bsG4nI3ELgyI7KpgRSS+Dr17+CCNExxCetT+fRFpiEvUcSxeW4pOe55h0bQWSqLo"
+            + "MNErXVJEXrm1VPkC08W8D/gZuPIsdtKJu4nowvdoA+WrI473pbeONGjaEDbuIJak"
+            + "yeKM1VMSGhsImdKtxqhndq2/6QCg/xARUIzPRvKr2TJ52K393895X1kEAMCdjSs+"
+            + "vABnhaeNNR5+NNkkIOCCjCS8qZRZ4ZnIayvn9ueG3KrhZeBIHoajUHrlTXBVj7XO"
+            + "wXVfGpW17jCDiqhU8Pu6VwEwX1iFbuUwqBffiRLXKg0zfcN+MyFKToi+VsJi4jiZ"
+            + "zcwUFMb8jE8tvR/muXti7zKPRPCbNBExoCt4A/0TgkzAosG/W4dUkkbc6XoHrjob"
+            + "iYuy6Xbs/JYlV0vf2CyuKCZC6UoznO5x2GkvOyVtAgyG4HSh1WybdrutZ8k0ysks"
+            + "mOthE7n7iczdj9Uwg2h+TfgDUnxcCAwxnOsX5UaBqGdkX1PjCWs+O3ZhUDg6UsZc"
+            + "7O5a3kstf16lHpf4q7ABAIkAYQQfEQIAIQUCPYrmtgIHABcMgBHRi/xlIgI+Q6LT"
+            + "kNJ7zKvTd87NHAAKCRDJM3gHb/sRj7bxAJ9f6mdlXQH7gMaYiY5tBe/FRtPr1gCf"
+            + "UhDJQG0ARvORFWHjwhhBMLxW7j2wAWC0KkRlc21vbmQgS2VlIDxkZXNtb25kLmtl"
+            + "ZUBub3dtZWRpYXRlY2guY29tPrADAQD9iQBYBBARAgAYBQI9iua2CAsDCQgHAgEK"
+            + "AhkBBRsDAAAAAAoJEMkzeAdv+xGP7v4An19iqadBCCgDIe2DTpspOMidwQYPAJ4/"
+            + "5QXbcn4ClhOKTO3ZEZefQvvL27ABYLkCDQQ9iua2EAgA9kJXtwh/CBdyorrWqULz"
+            + "Bej5UxE5T7bxbrlLOCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9ZekX1KHT"
+            + "UPj1WV/cdlJPPT2N286Z4VeSWc39uK50T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq"
+            + "01uejaClcjrUGvC/RgBYK+X0iP1YTknbzSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O"
+            + "9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdXQ6MdGGzeMyEstSr/POGxKUAYEY18hKcK"
+            + "ctaGxAMZyAcpesqVDNmWn6vQClCbAkbTCD1mpF1Bn5x8vYlLIhkmuquiXsNV6TIL"
+            + "OwACAgf/SO+bbg+owbFKVN5HgOjOElQZVnCsegwCLqTeQzPPzsWmkGX2qZJPDIRN"
+            + "RZfJzti6+oLJwaRA/3krjviUty4VKhZ3lKg8fd9U0jEdnw+ePA7yJ6gZmBHL15U5"
+            + "OKH4Zo+OVgDhO0c+oetFpend+eKcvtoUcRoQoi8VqzYUNG0b/nmZGDlxQe1/ZNbP"
+            + "HpNf1BAtJXivCEKMD6PVzsLPg2L4tFIvD9faeeuKYQ4jcWtTkBLuIaZba3i3a4wG"
+            + "xTN20j9HpISVuLW/EfZAK1ef4DNjLmHEU9dMzDqfi+hPmMbGlFqcKr+VjcYIDuje"
+            + "o+92xm/EWAmlti88r2hZ3MySamHDrLABAIkATAQYEQIADAUCPYrmtgUbDAAAAAAK"
+            + "CRDJM3gHb/sRjzVTAKDVS+OJLMeS9VLAmT8atVCB42MwIQCgoh1j3ccWnhc/h6B7"
+            + "9Uqz3fUvGoewAWA=");
+
+        private static readonly byte[] sec8 = Base64.Decode(
+            "lQHpBEEcraYRBADFYj+uFOhHz5SdECvJ3Z03P47gzmWLQ5HH8fPYC9rrv7AgqFFX"
+            + "aWlJJVMLua9e6xoCiDWJs/n4BbZ/weL/11ELg6XqUnzFhYyz0H2KFsPgQ/b9lWLY"
+            + "MtcPMFy5jE33hv/ixHgYLFqoNaAIbg0lzYEW/otQ9IhRl16fO1Q/CQZZrQCg/9M2"
+            + "V2BTmm9RYog86CXJtjawRBcD/RIqU0zulxZ2Zt4javKVxrGIwW3iBU935ebmJEIK"
+            + "Y5EVkGKBOCvsApZ+RGzpYeR2uMsTnQi8RJgiAnjaoVPCdsVJE7uQ0h8XuJ5n5mJ2"
+            + "kLCFlF2hj5ViicZzse+crC12CGtgRe8z23ubLRcd6IUGhVutK8/b5knZ22vE14JD"
+            + "ykKdA/96ObzJQdiuuPsEWN799nUUCaYWPAoLAmiXuICSP4GEnxLbYHWo8zhMrVMT"
+            + "9Q5x3h8cszUz7Acu2BXjP1m96msUNoxPOZtt88NlaFz1Q/JSbQTsVOMd9b/IRN6S"
+            + "A/uU0BiKEMHXuT8HUHVPK49oCKhZrGFP3RT8HZxDKLmR/qrgZ/4JAwLXyWhb4pf4"
+            + "nmCmD0lDwoYvatLiR7UQVM2MamxClIiT0lCPN9C2AYIFgRWAJNS215Tjx7P/dh7e"
+            + "8sYfh5XEHErT3dMbsAGHtCFKaWEgWWl5dSA8eXlqaWFAbm93bWVkaWF0ZWNoLmNv"
+            + "bT6wAwP//4kAXQQQEQIAHQUCQRytpgcLCQgHAwIKAhkBBRsDAAAABR4BAAAAAAoJ"
+            + "EPT+Vvgr/2IUmWEAoJEyJ9B7CJfmjwVTT30UbdCctVRmAJ9akw6we6UYd82vF0FK"
+            + "QTlSuqHXKbABZ50CawRBHK2mEAgA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlL"
+            + "OCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N"
+            + "286Z4VeSWc39uK50T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/"
+            + "RgBYK+X0iP1YTknbzSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2O"
+            + "u1WMuF040zT9fBdXQ6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqV"
+            + "DNmWn6vQClCbAkbTCD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwACAgf/crbApFLO"
+            + "QikN9lHbn62dDxuu/dNigNmjf/A3cX+vo8aPHTXnRDyDwQALRuqbitdbM6p1LFjG"
+            + "8g84Aabk/jL7zzjJLqPe8pxeK1Pu+P44NzalXAYMsOOsxGuixIrz3Jw8IrpH/mkP"
+            + "tG/iX0NaLZ+Au9eokdLb+6NR/a51r2qL3E0ycFciJ61HzZKKHi6d0VQ7CHozCz+j"
+            + "d5530Mh1qq/ZjYDDjfP+snpyNIZXcLtGR/3HzkBqNgDcvClLx3322AWKDa7pX8DX"
+            + "qiLr8znWhPRpH9kCTnSpRzhYGT25FRcvdj4/q/oUIET/Tp+BWW3BxAc7WgpgqEfn"
+            + "fa0Mv72Zbn91gf4JAwITijME9IlFBGAwH6YmBtWIlnDiRbsq/Pxozuhbnes831il"
+            + "KmdpUKXkiIfHY0MqrEWl3Dfn6PMJGTnhgqXMrDxx3uHrq0Jl2swRnAWIIO8gID7j"
+            + "uPetUqEviPiwAYeJAEwEGBECAAwFAkEcraYFGwwAAAAACgkQ9P5W+Cv/YhShrgCg"
+            + "+JW8m5nF3R/oZGuG87bXQBszkjMAoLhGPncuGKowJXMRVc70/8qwXQJLsAFn");
+
+        private static readonly char[] sec8pass = "qwertyui".ToCharArray();
+
+        private static readonly byte[] sec9 = Base64.Decode(
+            "lQGqBEHCokERBAC9rh5SzC1sX1y1zoFuBB/v0SGhoKMEvLYf8Qv/j4deAMrc"
+            + "w5dxasYoD9oxivIUfTbZKo8cqr+dKLgu8tycigTM5b/T2ms69SUAxSBtj2uR"
+            + "LZrh4vjC/93kF+vzYJ4fNaBs9DGfCnsTouKjXqmfN3SlPMKNcGutO7FaUC3d"
+            + "zcpYfwCg7qyONHvXPhS0Iw4QL3mJ/6wMl0UD/0PaonqW0lfGeSjJSM9Jx5Bt"
+            + "fTSlwl6GmvYmI8HKvOBXAUSTZSbEkMsMVcIgf577iupzgWCgNF6WsNqQpKaq"
+            + "QIq1Kjdd0Y00xU1AKflOkhl6eufTigjviM+RdDlRYsOO5rzgwDTRTu9giErs"
+            + "XIyJAIZIdu2iaBHX1zHTfJ1r7nlAA/9H4T8JIhppUk/fLGsoPNZzypzVip8O"
+            + "mFb9PgvLn5GmuIC2maiocT7ibbPa7XuXTO6+k+323v7PoOUaKD3uD93zHViY"
+            + "Ma4Q5pL5Ajc7isnLXJgJb/hvvB1oo+wSDo9vJX8OCSq1eUPUERs4jm90/oqy"
+            + "3UG2QVqs5gcKKR4o48jTiv4DZQJHTlUBtB1mb28ga2V5IDxmb28ua2V5QGlu"
+            + "dmFsaWQuY29tPoheBBMRAgAeBQJBwqJCAhsDBgsJCAcDAgMVAgMDFgIBAh4B"
+            + "AheAAAoJEOKcXvehtw4ajJMAoK9nLfsrRY6peq56l/KzmjzuaLacAKCXnmiU"
+            + "waI7+uITZ0dihJ3puJgUz50BWARBwqJDEAQA0DPcNIn1BQ4CDEzIiQkegNPY"
+            + "mkYyYWDQjb6QFUXkuk1WEB73TzMoemsA0UKXwNuwrUgVhdpkB1+K0OR/e5ik"
+            + "GhlFdrDCqyT+mw6dRWbJ2i4AmFXZaRKO8AozZeWojsfP1/AMxQoIiBEteMFv"
+            + "iuXnZ3pGxSfZYm2+33IuPAV8KKMAAwUD/0C2xZQXgVWTiVz70HUviOmeTQ+f"
+            + "b1Hj0U9NMXWB383oQRBZCvQDM12cqGsvPZuZZ0fkGehGAIoyXtIjJ9lejzZN"
+            + "1TE9fnXZ9okXI4yCl7XLSE26OAbNsis4EtKTNScNaU9Dk3CS5XD/pkRjrkPN"
+            + "2hdUFtshuGmYkqhb9BIlrwE7/gMDAglbVSwecr9mYJcDYCH62U9TScWDTzsQ"
+            + "NFEfhMez3hGnNHNfHe+7yN3+Q9/LIhbba3IJEN5LsE5BFvudLbArp56EusIn"
+            + "JCxgiEkEGBECAAkFAkHCokMCGwwACgkQ4pxe96G3Dho2UQCeN3VPwx3dROZ+"
+            + "4Od8Qj+cLrBndGEAn0vaQdy6eIGeDw2I9u3Quwy6JnROnQHhBEHCozMRBADH"
+            + "ZBlB6xsAnqFYtYQOHr4pX6Q8TrqXCiHHc/q56G2iGbI9IlbfykQzaPHgWqZw"
+            + "9P0QGgF/QZh8TitiED+imLlGDqj3nhzpazqDh5S6sg6LYkQPqhwG/wT5sZQQ"
+            + "fzdeupxupjI5YN8RdIqkWF+ILOjk0+awZ4z0TSY/f6OSWpOXlwCgjIquR3KR"
+            + "tlCLk+fBlPnOXaOjX+kEAJw7umykNIHNaoY/2sxNhQhjqHVxKyN44y6FCSv9"
+            + "jRyW8Q/Qc8YhqBIHdmlcXoNWkDtlvErjdYMvOKFqKB1e2bGpjvhtIhNVQWdk"
+            + "oHap9ZuM1nV0+fD/7g/NM6D9rOOVCahBG2fEEeIwxa2CQ7zHZYfg9Umn3vbh"
+            + "TYi68R3AmgLOA/wKIVkfFKioI7iX4crQviQHJK3/A90SkrjdMQwLoiUjdgtk"
+            + "s7hJsTP1OPb2RggS1wCsh4sv9nOyDULj0T0ySGv7cpyv5Nq0FY8gw2oogHs5"
+            + "fjUnG4VeYW0zcIzI8KCaJT4UhR9An0A1jF6COrYCcjuzkflFbQLtQb9uNj8a"
+            + "hCpU4/4DAwIUxXlRMYE8uWCranzPo83FnBPRnGJ2aC9SqZWJYVUKIn4Vf2nu"
+            + "pVvCGFja0usl1WfV72hqlNKEONq7lohJBBgRAgAJBQJBwqMzAhsCAAoJEOKc"
+            + "Xvehtw4afisAoME/t8xz/rj/N7QRN9p8Ji8VPGSqAJ9K8eFJ+V0mxR+octJr"
+            + "6neEEX/i1Q==");
+
+        public char[] sec9pass = "foo".ToCharArray();
+
+        // version 4 keys with expiry dates
+        private static readonly byte[] pub10 = Base64.Decode(
+            "mQGiBEKqia0RBACc3hkufmscRSC4UvPZqMDsHm4+d/GXIr+3iNMSSEySJu8yk+k0"
+            + "Xs11C/K+n+v1rnn2jGGknv+1lDY6w75TIcTE6o6HGKeIDxsAm8P3MhoGU1GNPamA"
+            + "eTDeNybtrN/g6C65fCY9uI11hsUboYgQZ8ND22PB0VtvdOgq9D85qNUzxwCg1BbJ"
+            + "ycAKd4VqEvQ2Zglp3dCSrFMD/Ambq1kZqYa69sp3b9BPKuAgUgUPoytOArEej3Bk"
+            + "easAgAxNhWJy4GxigES3vk50rVi7w8XBuqbD1mQCzldF0HX0/A7PxLBv6od5uqqF"
+            + "HFxIyxg/KBZLd9ZOrsSaoUWH58jZq98X/sFtJtRi5VuJagMxCIJD4mLgtMv7Unlb"
+            + "/GrsA/9DEnObA/fNTgK70T+ZmPIS5tSt+bio30Aw4YGpPCGqpnm1u73b5kqX3U3B"
+            + "P+vGDvFuqZYpqQA8byAueH0MbaDHI4CFugvShXvgysJxN7ov7/8qsZZUMfK1t2Nr"
+            + "SAsPuKRbcY4gNKXIElKeXbyaET7vX7uAEKuxEwdYGFp/lNTkHLQgdGVzdCBrZXkg"
+            + "KHRlc3QpIDx0ZXN0QHRlc3QudGVzdD6IZAQTEQIAJAUCQqqJrQIbAwUJACTqAAYL"
+            + "CQgHAwIDFQIDAxYCAQIeAQIXgAAKCRDjDROQZRqIzDzLAJ42AeCRIBBjv8r8qw9y"
+            + "laNj2GZ1sACgiWYHVXMA6B1H9I1kS3YsCd3Oq7qwAgAAuM0EQqqJrhADAKWkix8l"
+            + "pJN7MMTXob4xFF1TvGll0UD1bDGOMMbes6aeXSbT9QXee/fH3GnijLY7wB+qTPv9"
+            + "ohubrSpnv3yen3CEBW6Q2YK+NlCskma42Py8YMV2idmYjtJi1ckvHFWt5wADBQL/"
+            + "fkB5Q5xSGgspMaTZmtmX3zG7ZDeZ0avP8e8mRL8UszCTpqs6vMZrXwyQLZPbtMYv"
+            + "PQpuRGEeKj0ysimwYRA5rrLQjnRER3nyuuEUUgc4j+aeRxPf9WVsJ/a1FCHtaAP1"
+            + "iE8EGBECAA8FAkKqia4CGwwFCQAk6gAACgkQ4w0TkGUaiMzdqgCfd66H7DL7kFGd"
+            + "IoS+NIp8JO+noxAAn25si4QAF7og8+4T5YQUuhIhx/NesAIAAA==");
+
+        private static readonly byte[] sec10 = Base64.Decode(
+            "lQHhBEKqia0RBACc3hkufmscRSC4UvPZqMDsHm4+d/GXIr+3iNMSSEySJu8yk+k0"
+            + "Xs11C/K+n+v1rnn2jGGknv+1lDY6w75TIcTE6o6HGKeIDxsAm8P3MhoGU1GNPamA"
+            + "eTDeNybtrN/g6C65fCY9uI11hsUboYgQZ8ND22PB0VtvdOgq9D85qNUzxwCg1BbJ"
+            + "ycAKd4VqEvQ2Zglp3dCSrFMD/Ambq1kZqYa69sp3b9BPKuAgUgUPoytOArEej3Bk"
+            + "easAgAxNhWJy4GxigES3vk50rVi7w8XBuqbD1mQCzldF0HX0/A7PxLBv6od5uqqF"
+            + "HFxIyxg/KBZLd9ZOrsSaoUWH58jZq98X/sFtJtRi5VuJagMxCIJD4mLgtMv7Unlb"
+            + "/GrsA/9DEnObA/fNTgK70T+ZmPIS5tSt+bio30Aw4YGpPCGqpnm1u73b5kqX3U3B"
+            + "P+vGDvFuqZYpqQA8byAueH0MbaDHI4CFugvShXvgysJxN7ov7/8qsZZUMfK1t2Nr"
+            + "SAsPuKRbcY4gNKXIElKeXbyaET7vX7uAEKuxEwdYGFp/lNTkHP4DAwLssmOjVC+d"
+            + "mWB783Lpzjb9evKzsxisTdx8/jHpUSS+r//6/Guyx3aA/zUw5bbftItW57mhuNNb"
+            + "JTu7WrQgdGVzdCBrZXkgKHRlc3QpIDx0ZXN0QHRlc3QudGVzdD6IZAQTEQIAJAUC"
+            + "QqqJrQIbAwUJACTqAAYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRDjDROQZRqIzDzL"
+            + "AJ0cYPwKeoSReY14LqJtAjnkX7URHACgsRZWfpbalrSyDnq3TtZeGPUqGX+wAgAA"
+            + "nQEUBEKqia4QAwClpIsfJaSTezDE16G+MRRdU7xpZdFA9WwxjjDG3rOmnl0m0/UF"
+            + "3nv3x9xp4oy2O8Afqkz7/aIbm60qZ798np9whAVukNmCvjZQrJJmuNj8vGDFdonZ"
+            + "mI7SYtXJLxxVrecAAwUC/35AeUOcUhoLKTGk2ZrZl98xu2Q3mdGrz/HvJkS/FLMw"
+            + "k6arOrzGa18MkC2T27TGLz0KbkRhHio9MrIpsGEQOa6y0I50REd58rrhFFIHOI/m"
+            + "nkcT3/VlbCf2tRQh7WgD9f4DAwLssmOjVC+dmWDXVLRopzxbBGOvodp/LZoSDb56"
+            + "gNJjDMJ1aXqWW9qTAg1CFjBq73J3oFpVzInXZ8+Q8inxv7bnWiHbiE8EGBECAA8F"
+            + "AkKqia4CGwwFCQAk6gAACgkQ4w0TkGUaiMzdqgCgl2jw5hfk/JsyjulQqe1Nps1q"
+            + "Lx0AoMdnFMZmTMLHn8scUW2j9XO312tmsAIAAA==");
 
 //		private static readonly char[] sec10pass = "test".ToCharArray();
 
-		private static readonly byte[] subKeyBindingKey = Base64.Decode(
-			"mQGiBDWagYwRBAD7UcH4TAIp7tmUoHBNxVxCVz2ZrNo79M6fV63riOiH2uDxfIpr"
-			+ "IrL0cM4ehEKoqlhngjDhX60eJrOw1nC5BpYZRnDnyDYT4wTWRguxObzGq9pqA1dM"
-			+ "oPTJhkFZVIBgFY99/ULRqaUYIhFGgBtnwS70J8/L/PGVc3DmWRLMkTDjSQCg/5Nh"
-			+ "MCjMK++MdYMcMl/ziaKRT6EEAOtw6PnU9afdohbpx9CK4UvCCEagfbnUtkSCQKSk"
-			+ "6cUp6VsqyzY0pai/BwJ3h4apFMMMpVrtBAtchVgqo4xTr0Sve2j0k+ase6FSImiB"
-			+ "g+AR7hvTUTcBjwtIExBc8TuCTqmn4GG8F7UMdl5Z0AZYj/FfAQYaRVZYP/pRVFNx"
-			+ "Lw65BAC/Fi3qgiGCJFvXnHIckTfcAmZnKSEXWY9NJ4YQb4+/nH7Vsw0wR/ZObUHR"
-			+ "bWgTc9Vw1uZIMe0XVj6Yk1dhGRehUnrm3mE7UJxu7pgkBCbFECFSlSSqP4MEJwZV"
-			+ "09YP/msu50kjoxyoTpt+16uX/8B4at24GF1aTHBxwDLd8X0QWrQsTWVycmlsbCBM"
-			+ "eW5jaCBDTEVBUiBzeXN0ZW0gREggPGNsZWFyQG1sLmNvbT6JAEsEEBECAAsFAjWa"
-			+ "gYwECwMBAgAKCRDyAGjiP47/XanfAKCs6BPURWVQlGh635VgL+pdkUVNUwCdFcNa"
-			+ "1isw+eAcopXPMj6ACOapepu5Ag0ENZqBlBAIAPZCV7cIfwgXcqK61qlC8wXo+VMR"
-			+ "OU+28W65Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdMZIZJ+AyDvWXpF9Sh01D49Vlf"
-			+ "3HZSTz09jdvOmeFXklnN/biudE/F/Ha8g8VHMGHOfMlm/xX5u/2RXscBqtNbno2g"
-			+ "pXI61Brwv0YAWCvl9Ij9WE5J280gtJ3kkQc2azNsOA1FHQ98iLMcfFstjvbzySPA"
-			+ "Q/ClWxiNjrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq/zzhsSlAGBGNfISnCnLWhsQD"
-			+ "GcgHKXrKlQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2JSyIZJrqrol7DVekyCzsAAgIH"
-			+ "/RYtVo+HROZ6jrNjrATEwQm1fUQrk6n5+2dniN881lF0CNkB4NkHw1Xxz4Ejnu/0"
-			+ "iLg8fkOAsmanOsKpOkRtqUnVpsVL5mLJpFEyCY5jbcfj+KY9/25bs0ga7kLHNZia"
-			+ "zbCxJdF+W179z3nudQxRaXG/0XISIH7ziZbSVni69sKc1osk1+OoOMbSuZ86z535"
-			+ "Pln4fXclkFE927HxfbWoO+60hkOLKh7x+8fC82b3x9vCETujEaxrscO2xS7/MYXP"
-			+ "8t1ffriTDmhuIuQS2q4fLgeWdqrODrMhrD8Dq7e558gzp30ZCqpiS7EmKGczL7B8"
-			+ "gXxbBCVSTxYMJheXt2xMXsuJAD8DBRg1moGU8gBo4j+O/10RAgWdAKCPhaFIXuC8"
-			+ "/cdiNMxTDw9ug3De5QCfYXmDzRSFUu/nrCi8yz/l09wsnxo=");
+        private static readonly byte[] subKeyBindingKey = Base64.Decode(
+            "mQGiBDWagYwRBAD7UcH4TAIp7tmUoHBNxVxCVz2ZrNo79M6fV63riOiH2uDxfIpr"
+            + "IrL0cM4ehEKoqlhngjDhX60eJrOw1nC5BpYZRnDnyDYT4wTWRguxObzGq9pqA1dM"
+            + "oPTJhkFZVIBgFY99/ULRqaUYIhFGgBtnwS70J8/L/PGVc3DmWRLMkTDjSQCg/5Nh"
+            + "MCjMK++MdYMcMl/ziaKRT6EEAOtw6PnU9afdohbpx9CK4UvCCEagfbnUtkSCQKSk"
+            + "6cUp6VsqyzY0pai/BwJ3h4apFMMMpVrtBAtchVgqo4xTr0Sve2j0k+ase6FSImiB"
+            + "g+AR7hvTUTcBjwtIExBc8TuCTqmn4GG8F7UMdl5Z0AZYj/FfAQYaRVZYP/pRVFNx"
+            + "Lw65BAC/Fi3qgiGCJFvXnHIckTfcAmZnKSEXWY9NJ4YQb4+/nH7Vsw0wR/ZObUHR"
+            + "bWgTc9Vw1uZIMe0XVj6Yk1dhGRehUnrm3mE7UJxu7pgkBCbFECFSlSSqP4MEJwZV"
+            + "09YP/msu50kjoxyoTpt+16uX/8B4at24GF1aTHBxwDLd8X0QWrQsTWVycmlsbCBM"
+            + "eW5jaCBDTEVBUiBzeXN0ZW0gREggPGNsZWFyQG1sLmNvbT6JAEsEEBECAAsFAjWa"
+            + "gYwECwMBAgAKCRDyAGjiP47/XanfAKCs6BPURWVQlGh635VgL+pdkUVNUwCdFcNa"
+            + "1isw+eAcopXPMj6ACOapepu5Ag0ENZqBlBAIAPZCV7cIfwgXcqK61qlC8wXo+VMR"
+            + "OU+28W65Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdMZIZJ+AyDvWXpF9Sh01D49Vlf"
+            + "3HZSTz09jdvOmeFXklnN/biudE/F/Ha8g8VHMGHOfMlm/xX5u/2RXscBqtNbno2g"
+            + "pXI61Brwv0YAWCvl9Ij9WE5J280gtJ3kkQc2azNsOA1FHQ98iLMcfFstjvbzySPA"
+            + "Q/ClWxiNjrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq/zzhsSlAGBGNfISnCnLWhsQD"
+            + "GcgHKXrKlQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2JSyIZJrqrol7DVekyCzsAAgIH"
+            + "/RYtVo+HROZ6jrNjrATEwQm1fUQrk6n5+2dniN881lF0CNkB4NkHw1Xxz4Ejnu/0"
+            + "iLg8fkOAsmanOsKpOkRtqUnVpsVL5mLJpFEyCY5jbcfj+KY9/25bs0ga7kLHNZia"
+            + "zbCxJdF+W179z3nudQxRaXG/0XISIH7ziZbSVni69sKc1osk1+OoOMbSuZ86z535"
+            + "Pln4fXclkFE927HxfbWoO+60hkOLKh7x+8fC82b3x9vCETujEaxrscO2xS7/MYXP"
+            + "8t1ffriTDmhuIuQS2q4fLgeWdqrODrMhrD8Dq7e558gzp30ZCqpiS7EmKGczL7B8"
+            + "gXxbBCVSTxYMJheXt2xMXsuJAD8DBRg1moGU8gBo4j+O/10RAgWdAKCPhaFIXuC8"
+            + "/cdiNMxTDw9ug3De5QCfYXmDzRSFUu/nrCi8yz/l09wsnxo=");
 
 //		private static readonly byte[] subKeyBindingCheckSum = Base64.Decode("3HU+");
 
-		//
-		// PGP8 with SHA1 checksum.
-		//
-		private static readonly byte[] rewrapKey = Base64.Decode(
-			"lQOWBEUPOQgBCADdjPTtl8oOwqJFA5WU8p7oDK5KRWfmXeXUZr+ZJipemY5RSvAM"
-			+ "rxqsM47LKYbmXOJznXCQ8+PPa+VxXAsI1CXFHIFqrXSwvB/DUmb4Ec9EuvNd18Zl"
-			+ "hJAybzmV2KMkaUp9oG/DUvxZJqkpUddNfwqZu0KKKZWF5gwW5Oy05VCpaJxQVXFS"
-			+ "whdbRfwEENJiNx4RB3OlWhIjY2p+TgZfgQjiGB9i15R+37sV7TqzBUZF4WWcnIRQ"
-			+ "DnpUfxHgxQ0wO/h/aooyRHSpIx5i4oNpMYq9FNIyakEx/Bomdbs5hW9dFxhrE8Es"
-			+ "UViAYITgTsyROxmgGatGG09dcmVDJVYF4i7JAAYpAAf/VnVyUDs8HrxYTOIt4rYY"
-			+ "jIHToBsV0IiLpA8fEA7k078L1MwSwERVVe6oHVTjeR4A9OxE52Vroh2eOLnF3ftf"
-			+ "6QThVVZr+gr5qeG3yvQ36N7PXNEVOlkyBzGmFQNe4oCA+NR2iqnAIspnekVmwJV6"
-			+ "xVvPCjWw/A7ZArDARpfthspwNcJAp4SWfoa2eKzvUTznTyqFu2PSS5fwQZUgOB0P"
-			+ "Y2FNaKeqV8vEZu4SUWwLOqXBQIZXiaLvdKNgwFvUe3kSHdCNsrVzW7SYxFwaEog2"
-			+ "o6YLKPVPqjlGX1cMOponGp+7n9nDYkQjtEsGSSMQkQRDAcBdSVJmLO07kFOQSOhL"
-			+ "WQQA49BcgTZyhyH6TnDBMBHsGCYj43FnBigypGT9FrQHoWybfX47yZaZFROAaaMa"
-			+ "U6man50YcYZPwzDzXHrK2MoGALY+DzB3mGeXVB45D/KYtlMHPLgntV9T5b14Scbc"
-			+ "w1ES2OUtsSIUs0zelkoXqjLuKnSIYK3mMb67Au7AEp6LXM8EAPj2NypvC86VEnn+"
-			+ "FH0QHvUwBpmDw0EZe25xQs0brvAG00uIbiZnTH66qsIfRhXV/gbKK9J5DTGIqQ15"
-			+ "DuPpz7lcxg/n2+SmjQLNfXCnG8hmtBjhTe+udXAUrmIcfafXyu68SAtebgm1ga56"
-			+ "zUfqsgN3FFuMUffLl3myjyGsg5DnA/oCFWL4WCNClOgL6A5VkNIUait8QtSdCACT"
-			+ "Y7jdSOguSNXfln0QT5lTv+q1AjU7zjRl/LsFNmIJ5g2qdDyK937FOXM44FEEjZty"
-			+ "/4P2dzYpThUI4QUohIj8Qi9f2pZQueC5ztH6rpqANv9geZKcciAeAbZ8Md0K2TEU"
-			+ "RD3Lh+RSBzILtBtUZXN0IEtleSA8dGVzdEBleGFtcGxlLmNvbT6JATYEEwECACAF"
-			+ "AkUPOQgCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDYpknHeQaskD9NB/9W"
-			+ "EbFuLaqZAl3yjLU5+vb75BdvcfL1lUs44LZVwobNp3/0XbZdY76xVPNZURtU4u3L"
-			+ "sJfGlaF+EqZDE0Mqc+vs5SIb0OnCzNJ00KaUFraUtkByRV32T5ECHK0gMBjCs5RT"
-			+ "I0vVv+Qmzl4+X1Y2bJ2mlpBejHIrOzrBD5NTJimTAzyfnNfipmbqL8p/cxXKKzS+"
-			+ "OM++ZFNACj6lRM1W9GioXnivBRC88gFSQ4/GXc8yjcrMlKA27JxV+SZ9kRWwKH2f"
-			+ "6o6mojUQxnHr+ZFKUpo6ocvTgBDlC57d8IpwJeZ2TvqD6EdA8rZ0YriVjxGMDrX1"
-			+ "8esfw+iLchfEwXtBIRwS");
-
-		private static readonly char[] rewrapPass = "voltage123".ToCharArray();
-
-		private static readonly byte[] pubWithX509 = Base64.Decode(
-			  "mQENBERabjABCACtmfyo6Nph9MQjv4nmCWjZrRYnhXbivomAdIwYkLZUj1bjqE+j"
-			+ "uaLzjZV8xSI59odZvrmOiqlzOc4txitQ1OX7nRgbOJ7qku0dvwjtIn46+HQ+cAFn"
-			+ "2mTi81RyXEpO2uiZXfsNTxUtMi+ZuFLufiMc2kdk27GZYWEuasdAPOaPJnA+wW6i"
-			+ "ZHlt0NfXIGNz864gRwhD07fmBIr1dMFfATWxCbgMd/rH7Z/j4rvceHD2n9yrhPze"
-			+ "YN7W4Nuhsr2w/Ft5Cm9xO7vXT/cpto45uxn8f7jERep6bnUwNOhH8G+6xLQgTLD0"
-			+ "qFBGVSIneK3lobs6+xn6VaGN8W0tH3UOaxA1ABEBAAG0D0NOPXFhLWRlZXBzaWdo"
-			+ "dIkFDgQQZAIFAQUCRFpuMAUDCWdU0gMF/3gCGwPELGQBAQQwggTkMIIDzKADAgEC"
-			+ "AhBVUMV/M6rIiE+IzmnPheQWMA0GCSqGSIb3DQEBBQUAMG4xEzARBgoJkiaJk/Is"
-			+ "ZAEZFgNjb20xEjAQBgoJkiaJk/IsZAEZFgJxYTEVMBMGCgmSJomT8ixkARkWBXRt"
-			+ "czAxMRUwEwYKCZImiZPyLGQBGRYFV2ViZmUxFTATBgNVBAMTDHFhLWRlZXBzaWdo"
-			+ "dDAeFw0wNjA1MDQyMTEyMTZaFw0xMTA1MDQyMTIwMDJaMG4xEzARBgoJkiaJk/Is"
-			+ "ZAEZFgNjb20xEjAQBgoJkiaJk/IsZAEZFgJxYTEVMBMGCgmSJomT8ixkARkWBXRt"
-			+ "czAxMRUwEwYKCZImiZPyLGQBGRYFV2ViZmUxFTATBgNVBAMTDHFhLWRlZXBzaWdo"
-			+ "dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK2Z/Kjo2mH0xCO/ieYJ"
-			+ "aNmtFieFduK+iYB0jBiQtlSPVuOoT6O5ovONlXzFIjn2h1m+uY6KqXM5zi3GK1DU"
-			+ "5fudGBs4nuqS7R2/CO0ifjr4dD5wAWfaZOLzVHJcSk7a6Jld+w1PFS0yL5m4Uu5+"
-			+ "IxzaR2TbsZlhYS5qx0A85o8mcD7BbqJkeW3Q19cgY3PzriBHCEPTt+YEivV0wV8B"
-			+ "NbEJuAx3+sftn+Piu9x4cPaf3KuE/N5g3tbg26GyvbD8W3kKb3E7u9dP9ym2jjm7"
-			+ "Gfx/uMRF6npudTA06Efwb7rEtCBMsPSoUEZVIid4reWhuzr7GfpVoY3xbS0fdQ5r"
-			+ "EDUCAwEAAaOCAXwwggF4MAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0G"
-			+ "A1UdDgQWBBSmFTRv5y65DHtTYae48zl0ExNWZzCCASUGA1UdHwSCARwwggEYMIIB"
-			+ "FKCCARCgggEMhoHFbGRhcDovLy9DTj1xYS1kZWVwc2lnaHQsQ049cWEtd3VtYW4x"
-			+ "LWRjLENOPUNEUCxDTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNl"
-			+ "cyxDTj1Db25maWd1cmF0aW9uLERDPVdlYmZlLERDPXRtczAxLERDPXFhLERDPWNv"
-			+ "bT9jZXJ0aWZpY2F0ZVJldm9jYXRpb25MaXN0P2Jhc2U/b2JqZWN0Q2xhc3M9Y1JM"
-			+ "RGlzdHJpYnV0aW9uUG9pbnSGQmh0dHA6Ly9xYS13dW1hbjEtZGMud2ViZmUudG1z"
-			+ "MDEucWEuY29tL0NlcnRFbnJvbGwvcWEtZGVlcHNpZ2h0LmNybDAQBgkrBgEEAYI3"
-			+ "FQEEAwIBADANBgkqhkiG9w0BAQUFAAOCAQEAfuZCW3XlB7Eok35zQbvYt9rhAndT"
-			+ "DNw3wPNI4ZzD1nXoYWnwhNNvWRpsOt4ExOSNdaHErfgDXAMyyg66Sro0TkAx8eAj"
-			+ "fPQsyRAh0nm0glzFmJN6TdOZbj7hqGZjc4opQ6nZo8h/ULnaEwMIUW4gcSkZt0ww"
-			+ "CuErl5NUrN3DpkREeCG/fVvQZ8ays3ibQ5ZCZnYBkLYq/i0r3NLW34WfYhjDY48J"
-			+ "oQWtvFSAxvRfz2NGmqnrCHPQZxqlfdta97kDa4VQ0zSeBaC70gZkLmD1GJMxWoXW"
-			+ "6tmEcgPY5SghInUf+L2u52V55MjyAFzVp7kTK2KY+p7qw35vzckrWkwu8AAAAAAA"
-			+ "AQE=");
-
-		private static readonly byte[] secWithPersonalCertificate = Base64.Decode(
-			"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"
-			+ "0/vPdYWSaQIAwYeo2Ce+b7M5ifbGMDWYBisEvGISg5xfvbe6qApmHS4QVQzE"
-			+ "Ym81rdJJ8OfvgSbHcgn37S3OBXIQvNdejF4BWqM9sAGHtCBIeW5lay1JbnRy"
-			+ "YW5ldCA8aHluZWtAYWxzb2Z0LmN6PrADA///iQDrBBABAgBVBQJIxi2bBQkB"
-			+ "mgKAMBSAAAAAACAAB3ByZWZlcnJlZC1lbWFpbC1lbmNvZGluZ0BwZ3AuY29t"
-			+ "cGdwbWltZQULBwgJAgIZAQUbAQAAAAUeAQAAAAIVAgAKCRDlTa3BE84gWVKW"
-			+ "BACcoCFKvph9r9QiHT1Z3N4wZH36Uxqu/059EFALnBkEdVudX/p6S9mynGRk"
-			+ "EfhmWFC1O6dMpnt+ZBEed/4XyFWVSLPwirML+6dxfXogdUsdFF1NCRHc3QGc"
-			+ "txnNUT/zcZ9IRIQjUhp6RkIvJPHcyfTXKSbLviI+PxzHU2Padq8pV7ABZ7kA"
-			+ "jQRIfg8tAQQAutJR/aRnfZYwlVv+KlUDYjG8YQUfHpTxpnmVu7W6N0tNg/Xr"
-			+ "5dg50wq3I4HOamRxUwHpdPkXyNF1szpDSRZmlM+VmiIvJDBnyH5YVlxT6+zO"
-			+ "8LUJ2VTbfPxoLFp539SQ0oJOm7IGMAGO7c0n/QV0N3hKUfWgCyJ+sENDa0Ft"
-			+ "JycAEQEAAbABj4kEzQQYAQIENwUCSMYtnAUJAeEzgMLFFAAAAAAAFwNleDUw"
-			+ "OWNlcnRpZmljYXRlQHBncC5jb20wggNhMIICyqADAgECAgkA1AoCoRKJCgsw"
-			+ "DQYJKoZIhvcNAQEFBQAwgakxCzAJBgNVBAYTAkNaMRcwFQYDVQQIEw5DemVj"
-			+ "aCBSZXB1YmxpYzESMBAGA1UEChQJQSYmTCBzb2Z0MSAwHgYDVQQLExdJbnRl"
-			+ "cm5hbCBEZXZlbG9wbWVudCBDQTEqMCgGA1UEAxQhQSYmTCBzb2Z0IEludGVy"
-			+ "bmFsIERldmVsb3BtZW50IENBMR8wHQYJKoZIhvcNAQkBFhBrYWRsZWNAYWxz"
-			+ "b2Z0LmN6MB4XDTA4MDcxNjE1MDkzM1oXDTA5MDcxNjE1MDkzM1owaTELMAkG"
-			+ "A1UEBhMCQ1oxFzAVBgNVBAgTDkN6ZWNoIFJlcHVibGljMRIwEAYDVQQKFAlB"
-			+ "JiZMIHNvZnQxFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5IeW5l"
-			+ "ay1JbnRyYW5ldDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAutJR/aRn"
-			+ "fZYwlVv+KlUDYjG8YQUfHpTxpnmVu7W6N0tNg/Xr5dg50wq3I4HOamRxUwHp"
-			+ "dPkXyNF1szpDSRZmlM+VmiIvJDBnyH5YVlxT6+zO8LUJ2VTbfPxoLFp539SQ"
-			+ "0oJOm7IGMAGO7c0n/QV0N3hKUfWgCyJ+sENDa0FtJycCAwEAAaOBzzCBzDAJ"
-			+ "BgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBD"
-			+ "ZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUNaw7A6r10PtYZzAvr9CrSKeRYJgwHwYD"
-			+ "VR0jBBgwFoAUmqSRM8rN3+T1+tkGiqef8S5suYgwGgYDVR0RBBMwEYEPaHlu"
-			+ "ZWtAYWxzb2Z0LmN6MCgGA1UdHwQhMB8wHaAboBmGF2h0dHA6Ly9wZXRyazIv"
-			+ "Y2EvY2EuY3JsMAsGA1UdDwQEAwIF4DANBgkqhkiG9w0BAQUFAAOBgQCUdOWd"
-			+ "7mBLWj1/GSiYgfwgdTrgk/VZOJvMKBiiFyy1iFEzldz6Xx+mAexnFJKfZXZb"
-			+ "EMEGWHfWPmgJzAtuTT0Jz6tUwDmeLH3MP4m8uOZtmyUJ2aq41kciV3rGxF0G"
-			+ "BVlZ/bWTaOzHdm6cjylt6xxLt6MJzpPBA/9ZfybSBh1DaAUbDgAAAJ0gBBkB"
-			+ "AgAGBQJIxi2bAAoJEAdYkEWLb2R2fJED/RK+JErZ98uGo3Z81cHkdP3rk8is"
-			+ "DUL/PR3odBPFH2SIA5wrzklteLK/ZXmBUzcvxqHEgI1F7goXbsBgeTuGgZdx"
-			+ "pINErxkNpcMl9FTldWKGiapKrhkZ+G8knDizF/Y7Lg6uGd2nKVxzutLXdHJZ"
-			+ "pU89Q5nzq6aJFAZo5TBIcchQAAoJEOVNrcETziBZXvQD/1mvFqBfWqwXxoj3"
-			+ "8fHUuFrE2pcp32y3ciO2i+uNVEkNDoaVVNw5eHQaXXWpllI/Pe6LnBl4vkyc"
-			+ "n3pjONa4PKrePkEsCUhRbIySqXIHuNwZumDOlKzZHDpCUw72LaC6S6zwuoEf"
-			+ "ucOcxTeGIUViANWXyTIKkHfo7HfigixJIL8nsAFn");
-
-		[Test]
-		public void PerformTest1()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub1);
-
-			int count = 0;
-
-			foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
-			{
-				count++;
-
-				int keyCount = 0;
-				byte[] bytes = pgpPub1.GetEncoded();
-
-				PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
-
-				foreach (PgpPublicKey pubKey in pgpPub2.GetPublicKeys())
-				{
-					keyCount++;
-
-					foreach (PgpSignature sig in pubKey.GetSignatures())
-					{
-						if (sig == null)
-							Fail("null signature found");
-					}
-				}
-
-				if (keyCount != 2)
-				{
-					Fail("wrong number of public keys");
-				}
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings");
-			}
-
-			//
-			// exact match
-			//
-			count = 0;
-			foreach (PgpPublicKeyRing pgpPub3 in pubRings.GetKeyRings("test (Test key) <test@ubicall.com>"))
-			{
-				if (pgpPub3 == null)
-					Fail("null keyring found");
-
-				count++;
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings on exact match");
-			}
-
-			//
-			// partial match 1 expected
-			//
-			count = 0;
-			foreach (PgpPublicKeyRing pgpPub4 in pubRings.GetKeyRings("test", true))
-			{
-				if (pgpPub4 == null)
-					Fail("null keyring found");
-
-				count++;
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings on partial match 1");
-			}
-
-			//
-			// partial match 0 expected
-			//
-			count = 0;
-			foreach (PgpPublicKeyRing pgpPub5 in pubRings.GetKeyRings("XXX", true))
-			{
-				if (pgpPub5 == null)
-					Fail("null keyring found");
-
-				count++;
-			}
-
-			if (count != 0)
-			{
-				Fail("wrong number of public keyrings on partial match 0");
-			}
-
-			//
-			// case-insensitive partial match
-			//
-			count = 0;
-			foreach (PgpPublicKeyRing pgpPub6 in pubRings.GetKeyRings("TEST@ubicall.com", true, true))
-			{
-				if (pgpPub6 == null)
-					Fail("null keyring found");
-
-				count++;
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings on case-insensitive partial match");
-			}
-
-			PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(sec1);
-			count = 0;
-
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings.GetKeyRings())
-			{
-				count++;
-
-				int keyCount = 0;
-
-				byte[] bytes = pgpSec1.GetEncoded();
-
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
-
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					PgpPublicKey pk = k.PublicKey;
-
-					pk.GetSignatures();
-
-					byte[] pkBytes = pk.GetEncoded();
-
-					PgpPublicKeyRing pkR = new PgpPublicKeyRing(pkBytes);
-				}
-
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-
-			//
-			// exact match
-			//
-			count = 0;
-			foreach (PgpSecretKeyRing o1 in secretRings.GetKeyRings("test (Test key) <test@ubicall.com>"))
-			{
-				if (o1 == null)
-					Fail("null keyring found");
-
-				count++;
-			}
-
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings on exact match");
-			}
-
-			//
-			// partial match 1 expected
-			//
-			count = 0;
-			foreach (PgpSecretKeyRing o2 in secretRings.GetKeyRings("test", true))
-			{
-				if (o2 == null)
-					Fail("null keyring found");
+        //
+        // PGP8 with SHA1 checksum.
+        //
+        private static readonly byte[] rewrapKey = Base64.Decode(
+            "lQOWBEUPOQgBCADdjPTtl8oOwqJFA5WU8p7oDK5KRWfmXeXUZr+ZJipemY5RSvAM"
+            + "rxqsM47LKYbmXOJznXCQ8+PPa+VxXAsI1CXFHIFqrXSwvB/DUmb4Ec9EuvNd18Zl"
+            + "hJAybzmV2KMkaUp9oG/DUvxZJqkpUddNfwqZu0KKKZWF5gwW5Oy05VCpaJxQVXFS"
+            + "whdbRfwEENJiNx4RB3OlWhIjY2p+TgZfgQjiGB9i15R+37sV7TqzBUZF4WWcnIRQ"
+            + "DnpUfxHgxQ0wO/h/aooyRHSpIx5i4oNpMYq9FNIyakEx/Bomdbs5hW9dFxhrE8Es"
+            + "UViAYITgTsyROxmgGatGG09dcmVDJVYF4i7JAAYpAAf/VnVyUDs8HrxYTOIt4rYY"
+            + "jIHToBsV0IiLpA8fEA7k078L1MwSwERVVe6oHVTjeR4A9OxE52Vroh2eOLnF3ftf"
+            + "6QThVVZr+gr5qeG3yvQ36N7PXNEVOlkyBzGmFQNe4oCA+NR2iqnAIspnekVmwJV6"
+            + "xVvPCjWw/A7ZArDARpfthspwNcJAp4SWfoa2eKzvUTznTyqFu2PSS5fwQZUgOB0P"
+            + "Y2FNaKeqV8vEZu4SUWwLOqXBQIZXiaLvdKNgwFvUe3kSHdCNsrVzW7SYxFwaEog2"
+            + "o6YLKPVPqjlGX1cMOponGp+7n9nDYkQjtEsGSSMQkQRDAcBdSVJmLO07kFOQSOhL"
+            + "WQQA49BcgTZyhyH6TnDBMBHsGCYj43FnBigypGT9FrQHoWybfX47yZaZFROAaaMa"
+            + "U6man50YcYZPwzDzXHrK2MoGALY+DzB3mGeXVB45D/KYtlMHPLgntV9T5b14Scbc"
+            + "w1ES2OUtsSIUs0zelkoXqjLuKnSIYK3mMb67Au7AEp6LXM8EAPj2NypvC86VEnn+"
+            + "FH0QHvUwBpmDw0EZe25xQs0brvAG00uIbiZnTH66qsIfRhXV/gbKK9J5DTGIqQ15"
+            + "DuPpz7lcxg/n2+SmjQLNfXCnG8hmtBjhTe+udXAUrmIcfafXyu68SAtebgm1ga56"
+            + "zUfqsgN3FFuMUffLl3myjyGsg5DnA/oCFWL4WCNClOgL6A5VkNIUait8QtSdCACT"
+            + "Y7jdSOguSNXfln0QT5lTv+q1AjU7zjRl/LsFNmIJ5g2qdDyK937FOXM44FEEjZty"
+            + "/4P2dzYpThUI4QUohIj8Qi9f2pZQueC5ztH6rpqANv9geZKcciAeAbZ8Md0K2TEU"
+            + "RD3Lh+RSBzILtBtUZXN0IEtleSA8dGVzdEBleGFtcGxlLmNvbT6JATYEEwECACAF"
+            + "AkUPOQgCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDYpknHeQaskD9NB/9W"
+            + "EbFuLaqZAl3yjLU5+vb75BdvcfL1lUs44LZVwobNp3/0XbZdY76xVPNZURtU4u3L"
+            + "sJfGlaF+EqZDE0Mqc+vs5SIb0OnCzNJ00KaUFraUtkByRV32T5ECHK0gMBjCs5RT"
+            + "I0vVv+Qmzl4+X1Y2bJ2mlpBejHIrOzrBD5NTJimTAzyfnNfipmbqL8p/cxXKKzS+"
+            + "OM++ZFNACj6lRM1W9GioXnivBRC88gFSQ4/GXc8yjcrMlKA27JxV+SZ9kRWwKH2f"
+            + "6o6mojUQxnHr+ZFKUpo6ocvTgBDlC57d8IpwJeZ2TvqD6EdA8rZ0YriVjxGMDrX1"
+            + "8esfw+iLchfEwXtBIRwS");
+
+        private static readonly char[] rewrapPass = "voltage123".ToCharArray();
+
+        private static readonly byte[] pubWithX509 = Base64.Decode(
+              "mQENBERabjABCACtmfyo6Nph9MQjv4nmCWjZrRYnhXbivomAdIwYkLZUj1bjqE+j"
+            + "uaLzjZV8xSI59odZvrmOiqlzOc4txitQ1OX7nRgbOJ7qku0dvwjtIn46+HQ+cAFn"
+            + "2mTi81RyXEpO2uiZXfsNTxUtMi+ZuFLufiMc2kdk27GZYWEuasdAPOaPJnA+wW6i"
+            + "ZHlt0NfXIGNz864gRwhD07fmBIr1dMFfATWxCbgMd/rH7Z/j4rvceHD2n9yrhPze"
+            + "YN7W4Nuhsr2w/Ft5Cm9xO7vXT/cpto45uxn8f7jERep6bnUwNOhH8G+6xLQgTLD0"
+            + "qFBGVSIneK3lobs6+xn6VaGN8W0tH3UOaxA1ABEBAAG0D0NOPXFhLWRlZXBzaWdo"
+            + "dIkFDgQQZAIFAQUCRFpuMAUDCWdU0gMF/3gCGwPELGQBAQQwggTkMIIDzKADAgEC"
+            + "AhBVUMV/M6rIiE+IzmnPheQWMA0GCSqGSIb3DQEBBQUAMG4xEzARBgoJkiaJk/Is"
+            + "ZAEZFgNjb20xEjAQBgoJkiaJk/IsZAEZFgJxYTEVMBMGCgmSJomT8ixkARkWBXRt"
+            + "czAxMRUwEwYKCZImiZPyLGQBGRYFV2ViZmUxFTATBgNVBAMTDHFhLWRlZXBzaWdo"
+            + "dDAeFw0wNjA1MDQyMTEyMTZaFw0xMTA1MDQyMTIwMDJaMG4xEzARBgoJkiaJk/Is"
+            + "ZAEZFgNjb20xEjAQBgoJkiaJk/IsZAEZFgJxYTEVMBMGCgmSJomT8ixkARkWBXRt"
+            + "czAxMRUwEwYKCZImiZPyLGQBGRYFV2ViZmUxFTATBgNVBAMTDHFhLWRlZXBzaWdo"
+            + "dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK2Z/Kjo2mH0xCO/ieYJ"
+            + "aNmtFieFduK+iYB0jBiQtlSPVuOoT6O5ovONlXzFIjn2h1m+uY6KqXM5zi3GK1DU"
+            + "5fudGBs4nuqS7R2/CO0ifjr4dD5wAWfaZOLzVHJcSk7a6Jld+w1PFS0yL5m4Uu5+"
+            + "IxzaR2TbsZlhYS5qx0A85o8mcD7BbqJkeW3Q19cgY3PzriBHCEPTt+YEivV0wV8B"
+            + "NbEJuAx3+sftn+Piu9x4cPaf3KuE/N5g3tbg26GyvbD8W3kKb3E7u9dP9ym2jjm7"
+            + "Gfx/uMRF6npudTA06Efwb7rEtCBMsPSoUEZVIid4reWhuzr7GfpVoY3xbS0fdQ5r"
+            + "EDUCAwEAAaOCAXwwggF4MAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0G"
+            + "A1UdDgQWBBSmFTRv5y65DHtTYae48zl0ExNWZzCCASUGA1UdHwSCARwwggEYMIIB"
+            + "FKCCARCgggEMhoHFbGRhcDovLy9DTj1xYS1kZWVwc2lnaHQsQ049cWEtd3VtYW4x"
+            + "LWRjLENOPUNEUCxDTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNl"
+            + "cyxDTj1Db25maWd1cmF0aW9uLERDPVdlYmZlLERDPXRtczAxLERDPXFhLERDPWNv"
+            + "bT9jZXJ0aWZpY2F0ZVJldm9jYXRpb25MaXN0P2Jhc2U/b2JqZWN0Q2xhc3M9Y1JM"
+            + "RGlzdHJpYnV0aW9uUG9pbnSGQmh0dHA6Ly9xYS13dW1hbjEtZGMud2ViZmUudG1z"
+            + "MDEucWEuY29tL0NlcnRFbnJvbGwvcWEtZGVlcHNpZ2h0LmNybDAQBgkrBgEEAYI3"
+            + "FQEEAwIBADANBgkqhkiG9w0BAQUFAAOCAQEAfuZCW3XlB7Eok35zQbvYt9rhAndT"
+            + "DNw3wPNI4ZzD1nXoYWnwhNNvWRpsOt4ExOSNdaHErfgDXAMyyg66Sro0TkAx8eAj"
+            + "fPQsyRAh0nm0glzFmJN6TdOZbj7hqGZjc4opQ6nZo8h/ULnaEwMIUW4gcSkZt0ww"
+            + "CuErl5NUrN3DpkREeCG/fVvQZ8ays3ibQ5ZCZnYBkLYq/i0r3NLW34WfYhjDY48J"
+            + "oQWtvFSAxvRfz2NGmqnrCHPQZxqlfdta97kDa4VQ0zSeBaC70gZkLmD1GJMxWoXW"
+            + "6tmEcgPY5SghInUf+L2u52V55MjyAFzVp7kTK2KY+p7qw35vzckrWkwu8AAAAAAA"
+            + "AQE=");
+
+        private static readonly byte[] secWithPersonalCertificate = Base64.Decode(
+            "lQOYBEjGLGsBCACp1I1dZKsK4N/I0/4g02hDVNLdQkDZfefduJgyJUyBGo/I"
+            + "/ZBpc4vT1YwVIdic4ADjtGB4+7WohN4v8siGzwRSeXardSdZVIw2va0JDsQC"
+            + "yeoTnwVkUgn+w/MDgpL0BBhTpr9o3QYoo28/qKMni3eA8JevloZqlAbQ/sYq"
+            + "rToMAqn0EIdeVVh6n2lRQhUJaNkH/kA5qWBpI+eI8ot/Gm9kAy3i4e0Xqr3J"
+            + "Ff1lkGlZuV5H5p/ItZui9BDIRn4IDaeR511NQnKlxFalM/gP9R9yDVI1aXfy"
+            + "STcp3ZcsTOTGNzACtpvMvl6LZyL42DyhlOKlJQJS81wp4dg0LNrhMFOtABEB"
+            + "AAEAB/0QIH5UEg0pTqAG4r/3v1uKmUbKJVJ3KhJB5xeSG3dKWIqy3AaXR5ZN"
+            + "mrJfXK7EfC5ZcSAqx5br1mzVl3PHVBKQVQxvIlmG4r/LKvPVhQYZUFyJWckZ"
+            + "9QMR+EA0Dcran9Ds5fa4hH84jgcwalkj64XWRAKDdVh098g17HDw+IYnQanl"
+            + "7IXbYvh+1Lr2HyPo//vHX8DxXIJBv+E4skvqGoNfCIfwcMeLsrI5EKo+D2pu"
+            + "kAuBYI0VBiZkrJHFXWmQLW71Mc/Bj7wTG8Q1pCpu7YQ7acFSv+/IOCsB9l9S"
+            + "vdB7pNhB3lEjYFGoTgr03VfeixA7/x8uDuSXjnBdTZqmGqkZBADNwCqlzdaQ"
+            + "X6CjS5jc3vzwDSPgM7ovieypEL6NU3QDEUhuP6fVvD2NYOgVnAEbJzgOleZS"
+            + "W2AFXKAf5NDxfqHnBmo/jlYb5yZV5Y+8/poLLj/m8t7sAfAmcZqGXfYMbSbe"
+            + "tr6TGTUXcXgbRyU5oH1e4iq691LOwZ39QjL8lNQQywQA006XYEr/PS9uJkyM"
+            + "Cg+M+nmm40goW4hU/HboFh9Ru6ataHj+CLF42O9sfMAV02UcD3Agj6w4kb5L"
+            + "VswuwfmY+17IryT81d+dSmDLhpo6ufKoAp4qrdP+bzdlbfIim4Rdrw5vF/Yk"
+            + "rC/Nfm3CLJxTimHJhqFx4MG7yEC89lxgdmcD/iJ3m41fwS+bPN2rrCAf7j1u"
+            + "JNr/V/8GAnoXR8VV9150BcOneijftIIYKKyKkV5TGwcTfjaxRKp87LTeC3MV"
+            + "szFDw04MhlIKRA6nBdU0Ay8Yu+EjXHK2VSpLG/Ny+KGuNiFzhqgBxM8KJwYA"
+            + "ISa1UEqWjXoLU3qu1aD7cCvANPVCOASwAYe0GlBHUCBEZXNrdG9wIDxpbmZv"
+            + "QHBncC5jb20+sAMD//+JAW4EEAECAFgFAkjGLGswFIAAAAAAIAAHcHJlZmVy"
+            + "cmVkLWVtYWlsLWVuY29kaW5nQHBncC5jb21wZ3BtaW1lBwsJCAcDAgoCGQEF"
+            + "GwMAAAADFgECBR4BAAAABRUCCAkKAAoJEHHHqp2m1tlWsx8H/icpHl1Nw17A"
+            + "D6MJN6zJm+aGja+5BOFxOsntW+IV6JI+l5WwiIVE8xTDhoXW4zdH3IZTqoyY"
+            + "frtkqLGpvsPtAQmV6eiPgE3+25ahL+MmjXKsceyhbZeCPDtM2M382VCHYCZK"
+            + "DZ4vrHVgK/BpyTeP/mqoWra9+F5xErhody71/cLyIdImLqXgoAny6YywjuAD"
+            + "2TrFnzPEBmZrkISHVEso+V9sge/8HsuDqSI03BAVWnxcg6aipHtxm907sdVo"
+            + "jzl2yFbxCCCaDIKR7XVbmdX7VZgCYDvNSxX3WEOgFq9CYl4ZlXhyik6Vr4XP"
+            + "7EgqadtfwfMcf4XrYoImSQs0gPOd4QqwAWedA5gESMYsawEIALiazFREqBfi"
+            + "WouTjIdLuY09Ks7PCkn0eo/i40/8lEj1R6JKFQ5RlHNnabh+TLvjvb3nOSU0"
+            + "sDg+IKK/JUc8/Fo7TBdZvARX6BmltEGakqToDC3eaF9EQgHLEhyE/4xXiE4H"
+            + "EeIQeCHdC7k0pggEuWUn5lt6oeeiPUWhqdlUOvzjG+jqMPJL0bk9STbImHUR"
+            + "EiugCPTekC0X0Zn0yrwyqlJQMWnh7wbSl/uo4q45K7qOhxcijo+hNNrkRAMi"
+            + "fdNqD4s5qDERqqHdAAgpWqydo7zV5tx0YSz5fjh59Z7FxkUXpcu1WltT6uVn"
+            + "hubiMTWpXzXOQI8wZL2fb12JmRY47BEAEQEAAQAH+wZBeanj4zne+fBHrWAS"
+            + "2vx8LYiRV9EKg8I/PzKBVdGUnUs0vTqtXU1dXGXsAsPtu2r1bFh0TQH06gR1"
+            + "24iq2obgwkr6x54yj+sZlE6SU0SbF/mQc0NCNAXtSKV2hNXvy+7P+sVJR1bn"
+            + "b5ukuvkj1tgEln/0W4r20qJ60F+M5QxXg6kGh8GAlo2tetKEv1NunAyWY6iv"
+            + "FTnSaIJ/YaKQNcudNvOJjeIakkIzfzBL+trUiI5n1LTBB6+u3CF/BdZBTxOy"
+            + "QwjAh6epZr+GnQqeaomFxBc3mU00sjrsB1Loso84UIs6OKfjMkPoZWkQrQQW"
+            + "+xvQ78D33YwqNfXk/5zQAxkEANZxJGNKaAeDpN2GST/tFZg0R5GPC7uWYC7T"
+            + "pG100mir9ugRpdeIFvfAa7IX2jujxo9AJWo/b8hq0q0koUBdNAX3xxUaWy+q"
+            + "KVCRxBifpYVBfEViD3lsbMy+vLYUrXde9087YD0c0/XUrj+oowWJavblmZtS"
+            + "V9OjkQW9zoCigpf5BADcYV+6bkmJtstxJopJG4kD/lr1o35vOEgLkNsMLayc"
+            + "NuzES084qP+8yXPehkzSsDB83kc7rKfQCQMZ54V7KCCz+Rr4wVG7FCrFAw4e"
+            + "4YghfGVU/5whvbJohl/sXXCYGtVljvY/BSQrojRdP+/iZxFbeD4IKiTjV+XL"
+            + "WKSS56Fq2QQAzeoKBJFUq8nqc8/OCmc52WHSOLnB4AuHL5tNfdE9tjqfzZAE"
+            + "tx3QB7YGGP57tPQxPFDFJVRJDqw0YxI2tG9Pum8iriKGjHg+oEfFhxvCmPxf"
+            + "zDKaGibkLeD7I6ATpXq9If+Nqb5QjzPjFbXBIz/q2nGjamZmp4pujKt/aZxF"
+            + "+YRCebABh4kCQQQYAQIBKwUCSMYsbAUbDAAAAMBdIAQZAQgABgUCSMYsawAK"
+            + "CRCrkqZshpdZSNAiB/9+5nAny2O9/lp2K2z5KVXqlNAHUmd4S/dpqtsZCbAo"
+            + "8Lcr/VYayrNojga1U7cyhsvFky3N9wczzPHq3r9Z+R4WnRM1gpRWl+9+xxtd"
+            + "ZxGfGzMRlxX1n5rCqltKKk6IKuBAr2DtTnxThaQiISO2hEw+P1MT2HnSzMXt"
+            + "zse5CZ5OiOd/bm/rdvTRD/JmLqhXmOFaIwzdVP0dR9Ld4Dug2onOlIelIntC"
+            + "cywY6AmnL0DThaTy5J8MiMSPamSmATl4Bicm8YRbHHz58gCYxI5UMLwtwR1+"
+            + "rSEmrB6GwVHZt0/BzOpuGpvFZI5ZmC5yO/waR1hV+VYj025cIz+SNuDPyjy4"
+            + "AAoJEHHHqp2m1tlW/w0H/3w38SkB5n9D9JL3chp+8fex03t7CQowVMdsBYNY"
+            + "qI4QoVQkakkxzCz5eF7rijXt5eC3NE/quWhlMigT8LARiwBROBWgDRFW4WuX"
+            + "6MwYtjKKUkZSkBKxP3lmaqZrJpF6jfhPEN76zr/NxWPC/nHRNldUdqkzSu/r"
+            + "PeJyePMofJevzMkUzw7EVtbtWhZavCz+EZXRTZXub9M4mDMj64BG6JHMbVZI"
+            + "1iDF2yka5RmhXz9tOhYgq80m7UQUb1ttNn86v1zVbe5lmB8NG4Ndv+JaaSuq"
+            + "SBZOYQ0ZxtMAB3vVVLZCWxma1P5HdXloegh+hosqeu/bl0Wh90z5Bspt6eI4"
+            + "imqwAWeVAdgESMYtmwEEAM9ZeMFxor7oSoXnhQAXD9lXLLfBky6IcIWISY4F"
+            + "JWc8sK8+XiVzpOrefKro0QvmEGSYcDFQMHdScBLOTsiVJiqenA7fg1bkBr/M"
+            + "bnD7vTKMJe0DARlU27tE5hsWCDYTluxIFjGcAcecY2UqHkqpctYKY0WY9EIm"
+            + "dBA5TYaw3c0PABEBAAEAA/0Zg6318nC57cWLIp5dZiO/dRhTPZD0hI+BWZrg"
+            + "zJtPT8rXVY+qK3Jwquig8z29/r+nppEE+xQWVWDlv4M28BDJAbGE+qWKAZqT"
+            + "67lyKgc0c50W/lfbGvvs+F7ldCcNpFvlk79GODKxcEeTGDQKb9R6FnHFee/K"
+            + "cZum71O3Ku3vUQIA3B3PNM+tKocIUNDHnInuLyqLORwQBNGfjU/pLMM0MkpP"
+            + "lWeIfgUmn2zL/e0JrRoO0LQqX1LN/TlfcurDM0SEtwIA8Sba9OpDq99Yz360"
+            + "FiePJiGNNlbj9EZsuGJyMVXL1mTLA6WHnz5XZOfYqJXHlmKvaKDbARW4+0U7"
+            + "0/vPdYWSaQIAwYeo2Ce+b7M5ifbGMDWYBisEvGISg5xfvbe6qApmHS4QVQzE"
+            + "Ym81rdJJ8OfvgSbHcgn37S3OBXIQvNdejF4BWqM9sAGHtCBIeW5lay1JbnRy"
+            + "YW5ldCA8aHluZWtAYWxzb2Z0LmN6PrADA///iQDrBBABAgBVBQJIxi2bBQkB"
+            + "mgKAMBSAAAAAACAAB3ByZWZlcnJlZC1lbWFpbC1lbmNvZGluZ0BwZ3AuY29t"
+            + "cGdwbWltZQULBwgJAgIZAQUbAQAAAAUeAQAAAAIVAgAKCRDlTa3BE84gWVKW"
+            + "BACcoCFKvph9r9QiHT1Z3N4wZH36Uxqu/059EFALnBkEdVudX/p6S9mynGRk"
+            + "EfhmWFC1O6dMpnt+ZBEed/4XyFWVSLPwirML+6dxfXogdUsdFF1NCRHc3QGc"
+            + "txnNUT/zcZ9IRIQjUhp6RkIvJPHcyfTXKSbLviI+PxzHU2Padq8pV7ABZ7kA"
+            + "jQRIfg8tAQQAutJR/aRnfZYwlVv+KlUDYjG8YQUfHpTxpnmVu7W6N0tNg/Xr"
+            + "5dg50wq3I4HOamRxUwHpdPkXyNF1szpDSRZmlM+VmiIvJDBnyH5YVlxT6+zO"
+            + "8LUJ2VTbfPxoLFp539SQ0oJOm7IGMAGO7c0n/QV0N3hKUfWgCyJ+sENDa0Ft"
+            + "JycAEQEAAbABj4kEzQQYAQIENwUCSMYtnAUJAeEzgMLFFAAAAAAAFwNleDUw"
+            + "OWNlcnRpZmljYXRlQHBncC5jb20wggNhMIICyqADAgECAgkA1AoCoRKJCgsw"
+            + "DQYJKoZIhvcNAQEFBQAwgakxCzAJBgNVBAYTAkNaMRcwFQYDVQQIEw5DemVj"
+            + "aCBSZXB1YmxpYzESMBAGA1UEChQJQSYmTCBzb2Z0MSAwHgYDVQQLExdJbnRl"
+            + "cm5hbCBEZXZlbG9wbWVudCBDQTEqMCgGA1UEAxQhQSYmTCBzb2Z0IEludGVy"
+            + "bmFsIERldmVsb3BtZW50IENBMR8wHQYJKoZIhvcNAQkBFhBrYWRsZWNAYWxz"
+            + "b2Z0LmN6MB4XDTA4MDcxNjE1MDkzM1oXDTA5MDcxNjE1MDkzM1owaTELMAkG"
+            + "A1UEBhMCQ1oxFzAVBgNVBAgTDkN6ZWNoIFJlcHVibGljMRIwEAYDVQQKFAlB"
+            + "JiZMIHNvZnQxFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5IeW5l"
+            + "ay1JbnRyYW5ldDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAutJR/aRn"
+            + "fZYwlVv+KlUDYjG8YQUfHpTxpnmVu7W6N0tNg/Xr5dg50wq3I4HOamRxUwHp"
+            + "dPkXyNF1szpDSRZmlM+VmiIvJDBnyH5YVlxT6+zO8LUJ2VTbfPxoLFp539SQ"
+            + "0oJOm7IGMAGO7c0n/QV0N3hKUfWgCyJ+sENDa0FtJycCAwEAAaOBzzCBzDAJ"
+            + "BgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBD"
+            + "ZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUNaw7A6r10PtYZzAvr9CrSKeRYJgwHwYD"
+            + "VR0jBBgwFoAUmqSRM8rN3+T1+tkGiqef8S5suYgwGgYDVR0RBBMwEYEPaHlu"
+            + "ZWtAYWxzb2Z0LmN6MCgGA1UdHwQhMB8wHaAboBmGF2h0dHA6Ly9wZXRyazIv"
+            + "Y2EvY2EuY3JsMAsGA1UdDwQEAwIF4DANBgkqhkiG9w0BAQUFAAOBgQCUdOWd"
+            + "7mBLWj1/GSiYgfwgdTrgk/VZOJvMKBiiFyy1iFEzldz6Xx+mAexnFJKfZXZb"
+            + "EMEGWHfWPmgJzAtuTT0Jz6tUwDmeLH3MP4m8uOZtmyUJ2aq41kciV3rGxF0G"
+            + "BVlZ/bWTaOzHdm6cjylt6xxLt6MJzpPBA/9ZfybSBh1DaAUbDgAAAJ0gBBkB"
+            + "AgAGBQJIxi2bAAoJEAdYkEWLb2R2fJED/RK+JErZ98uGo3Z81cHkdP3rk8is"
+            + "DUL/PR3odBPFH2SIA5wrzklteLK/ZXmBUzcvxqHEgI1F7goXbsBgeTuGgZdx"
+            + "pINErxkNpcMl9FTldWKGiapKrhkZ+G8knDizF/Y7Lg6uGd2nKVxzutLXdHJZ"
+            + "pU89Q5nzq6aJFAZo5TBIcchQAAoJEOVNrcETziBZXvQD/1mvFqBfWqwXxoj3"
+            + "8fHUuFrE2pcp32y3ciO2i+uNVEkNDoaVVNw5eHQaXXWpllI/Pe6LnBl4vkyc"
+            + "n3pjONa4PKrePkEsCUhRbIySqXIHuNwZumDOlKzZHDpCUw72LaC6S6zwuoEf"
+            + "ucOcxTeGIUViANWXyTIKkHfo7HfigixJIL8nsAFn");
+
+        [Test]
+        public void PerformTest1()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub1);
+
+            int count = 0;
+
+            foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
+            {
+                count++;
+
+                int keyCount = 0;
+                byte[] bytes = pgpPub1.GetEncoded();
+
+                PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
+
+                foreach (PgpPublicKey pubKey in pgpPub2.GetPublicKeys())
+                {
+                    keyCount++;
+
+                    foreach (PgpSignature sig in pubKey.GetSignatures())
+                    {
+                        if (sig == null)
+                            Fail("null signature found");
+                    }
+                }
+
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of public keys");
+                }
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings");
+            }
+
+            //
+            // exact match
+            //
+            count = 0;
+            foreach (PgpPublicKeyRing pgpPub3 in pubRings.GetKeyRings("test (Test key) <test@ubicall.com>"))
+            {
+                if (pgpPub3 == null)
+                    Fail("null keyring found");
+
+                count++;
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings on exact match");
+            }
+
+            //
+            // partial match 1 expected
+            //
+            count = 0;
+            foreach (PgpPublicKeyRing pgpPub4 in pubRings.GetKeyRings("test", true))
+            {
+                if (pgpPub4 == null)
+                    Fail("null keyring found");
+
+                count++;
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings on partial match 1");
+            }
+
+            //
+            // partial match 0 expected
+            //
+            count = 0;
+            foreach (PgpPublicKeyRing pgpPub5 in pubRings.GetKeyRings("XXX", true))
+            {
+                if (pgpPub5 == null)
+                    Fail("null keyring found");
+
+                count++;
+            }
+
+            if (count != 0)
+            {
+                Fail("wrong number of public keyrings on partial match 0");
+            }
+
+            //
+            // case-insensitive partial match
+            //
+            count = 0;
+            foreach (PgpPublicKeyRing pgpPub6 in pubRings.GetKeyRings("TEST@ubicall.com", true, true))
+            {
+                if (pgpPub6 == null)
+                    Fail("null keyring found");
+
+                count++;
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings on case-insensitive partial match");
+            }
+
+            PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(sec1);
+            count = 0;
+
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings.GetKeyRings())
+            {
+                count++;
+
+                int keyCount = 0;
+
+                byte[] bytes = pgpSec1.GetEncoded();
+
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    PgpPublicKey pk = k.PublicKey;
+
+                    pk.GetSignatures();
+
+                    byte[] pkBytes = pk.GetEncoded();
+
+                    PgpPublicKeyRing pkR = new PgpPublicKeyRing(pkBytes);
+                }
+
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+
+            //
+            // exact match
+            //
+            count = 0;
+            foreach (PgpSecretKeyRing o1 in secretRings.GetKeyRings("test (Test key) <test@ubicall.com>"))
+            {
+                if (o1 == null)
+                    Fail("null keyring found");
+
+                count++;
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings on exact match");
+            }
+
+            //
+            // partial match 1 expected
+            //
+            count = 0;
+            foreach (PgpSecretKeyRing o2 in secretRings.GetKeyRings("test", true))
+            {
+                if (o2 == null)
+                    Fail("null keyring found");
 
-				count++;
-			}
+                count++;
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings on partial match 1");
-			}
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings on partial match 1");
+            }
 
-			//
-			// exact match 0 expected
-			//
-			count = 0;
-			foreach (PgpSecretKeyRing o3 in secretRings.GetKeyRings("test", false))
-			{
-				if (o3 == null)
-					Fail("null keyring found");
+            //
+            // exact match 0 expected
+            //
+            count = 0;
+            foreach (PgpSecretKeyRing o3 in secretRings.GetKeyRings("test", false))
+            {
+                if (o3 == null)
+                    Fail("null keyring found");
 
-				count++;
-			}
+                count++;
+            }
 
-			if (count != 0)
-			{
-				Fail("wrong number of secret keyrings on partial match 0");
-			}
+            if (count != 0)
+            {
+                Fail("wrong number of secret keyrings on partial match 0");
+            }
 
-			//
-			// case-insensitive partial match
-			//
-			count = 0;
-			foreach (PgpSecretKeyRing o4 in secretRings.GetKeyRings("TEST@ubicall.com", true, true))
-			{
-				if (o4 == null)
-					Fail("null keyring found");
+            //
+            // case-insensitive partial match
+            //
+            count = 0;
+            foreach (PgpSecretKeyRing o4 in secretRings.GetKeyRings("TEST@ubicall.com", true, true))
+            {
+                if (o4 == null)
+                    Fail("null keyring found");
 
-				count++;
-			}
+                count++;
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings on case-insensitive partial match");
-			}
-		}
-
-		[Test]
-		public void PerformTest2()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub2);
-
-			int count = 0;
-
-			byte[] encRing = pubRings.GetEncoded();
-
-			pubRings = new PgpPublicKeyRingBundle(encRing);
-
-			foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
-			{
-				count++;
-
-				int keyCount = 0;
-
-				byte[] bytes = pgpPub1.GetEncoded();
-
-				PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
-
-				foreach (PgpPublicKey pk in pgpPub2.GetPublicKeys())
-				{
-					byte[] pkBytes = pk.GetEncoded();
-
-					PgpPublicKeyRing pkR = new PgpPublicKeyRing(pkBytes);
-
-					keyCount++;
-				}
-
-				if (keyCount != 2)
-				{
-					Fail("wrong number of public keys");
-				}
-			}
-
-			if (count != 2)
-			{
-				Fail("wrong number of public keyrings");
-			}
-
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(sec2);
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings on case-insensitive partial match");
+            }
+        }
+
+        [Test]
+        public void PerformTest2()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub2);
+
+            int count = 0;
+
+            byte[] encRing = pubRings.GetEncoded();
+
+            pubRings = new PgpPublicKeyRingBundle(encRing);
+
+            foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
+            {
+                count++;
+
+                int keyCount = 0;
+
+                byte[] bytes = pgpPub1.GetEncoded();
+
+                PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
+
+                foreach (PgpPublicKey pk in pgpPub2.GetPublicKeys())
+                {
+                    byte[] pkBytes = pk.GetEncoded();
+
+                    PgpPublicKeyRing pkR = new PgpPublicKeyRing(pkBytes);
+
+                    keyCount++;
+                }
+
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of public keys");
+                }
+            }
+
+            if (count != 2)
+            {
+                Fail("wrong number of public keyrings");
+            }
+
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(sec2);
 
-			count = 0;
-
-
-			encRing = secretRings2.GetEncoded();
-			PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(encRing);
-
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings2.GetKeyRings())
-			{
-				count++;
+            count = 0;
+
+
+            encRing = secretRings2.GetEncoded();
+            PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(encRing);
+
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings2.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpSec1.GetEncoded();
+                byte[] bytes = pgpSec1.GetEncoded();
 
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					PgpPublicKey pk = k.PublicKey;
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    PgpPublicKey pk = k.PublicKey;
 
-					if (pk.KeyId == -1413891222336124627L)
-					{
-						int sCount = 0;
+                    if (pk.KeyId == -1413891222336124627L)
+                    {
+                        int sCount = 0;
 
-						foreach (PgpSignature pgpSignature in pk.GetSignaturesOfType(PgpSignature.SubkeyBinding))
-						{
-							int type = pgpSignature.SignatureType;
-							if (type != PgpSignature.SubkeyBinding)
-							{
-								Fail("failed to return correct signature type");
-							}
-							sCount++;
-						}
+                        foreach (PgpSignature pgpSignature in pk.GetSignaturesOfType(PgpSignature.SubkeyBinding))
+                        {
+                            int type = pgpSignature.SignatureType;
+                            if (type != PgpSignature.SubkeyBinding)
+                            {
+                                Fail("failed to return correct signature type");
+                            }
+                            sCount++;
+                        }
 
-						if (sCount != 1)
-						{
-							Fail("failed to find binding signature");
-						}
-					}
+                        if (sCount != 1)
+                        {
+                            Fail("failed to find binding signature");
+                        }
+                    }
 
-					pk.GetSignatures();
+                    pk.GetSignatures();
 
-					if (k.KeyId == -4049084404703773049L
-						|| k.KeyId == -1413891222336124627L)
-					{
-						k.ExtractPrivateKey(sec2pass1);
-					}
-					else if (k.KeyId == -6498553574938125416L
-						|| k.KeyId == 59034765524361024L)
-					{
-						k.ExtractPrivateKey(sec2pass2);
-					}
-				}
+                    if (k.KeyId == -4049084404703773049L
+                        || k.KeyId == -1413891222336124627L)
+                    {
+                        k.ExtractPrivateKey(sec2pass1);
+                    }
+                    else if (k.KeyId == -6498553574938125416L
+                        || k.KeyId == 59034765524361024L)
+                    {
+                        k.ExtractPrivateKey(sec2pass2);
+                    }
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
 
-			if (count != 2)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-		}
+            if (count != 2)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
 
-		[Test]
-		public void PerformTest3()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub3);
+        [Test]
+        public void PerformTest3()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub3);
 
-			int count = 0;
+            int count = 0;
 
-			byte[] encRing = pubRings.GetEncoded();
+            byte[] encRing = pubRings.GetEncoded();
 
-			pubRings = new PgpPublicKeyRingBundle(encRing);
+            pubRings = new PgpPublicKeyRingBundle(encRing);
 
-			foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
-			{
-				count++;
+            foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpPub1.GetEncoded();
+                byte[] bytes = pgpPub1.GetEncoded();
 
-				PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
+                PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
 
-				foreach (PgpPublicKey pubK in pgpPub2.GetPublicKeys())
-				{
-					keyCount++;
-					pubK.GetSignatures();
-				}
+                foreach (PgpPublicKey pubK in pgpPub2.GetPublicKeys())
+                {
+                    keyCount++;
+                    pubK.GetSignatures();
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of public keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of public keys");
+                }
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings");
-			}
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings");
+            }
 
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(sec3);
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(sec3);
 
-			count = 0;
+            count = 0;
 
-			encRing = secretRings2.GetEncoded();
+            encRing = secretRings2.GetEncoded();
 
-			PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(encRing);
+            PgpSecretKeyRingBundle secretRings = new PgpSecretKeyRingBundle(encRing);
 
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings2.GetKeyRings())
-			{
-				count++;
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings2.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpSec1.GetEncoded();
+                byte[] bytes = pgpSec1.GetEncoded();
 
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					k.ExtractPrivateKey(sec3pass1);
-				}
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    k.ExtractPrivateKey(sec3pass1);
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-		}
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
 
-		[Test]
-		public void PerformTest4()
-		{
-			PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec4);
-			int count = 0;
+        [Test]
+        public void PerformTest4()
+        {
+            PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec4);
+            int count = 0;
 
 
-			byte[] encRing = secretRings1.GetEncoded();
+            byte[] encRing = secretRings1.GetEncoded();
 
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
 
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
-			{
-				count++;
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpSec1.GetEncoded();
+                byte[] bytes = pgpSec1.GetEncoded();
 
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					k.ExtractPrivateKey(sec3pass1);
-				}
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    k.ExtractPrivateKey(sec3pass1);
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-		}
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
 
-		[Test]
-		public void PerformTest5()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub5);
+        [Test]
+        public void PerformTest5()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub5);
 
-			int count = 0;
+            int count = 0;
 
-			byte[] encRing = pubRings.GetEncoded();
+            byte[] encRing = pubRings.GetEncoded();
 
-			pubRings = new PgpPublicKeyRingBundle(encRing);
+            pubRings = new PgpPublicKeyRingBundle(encRing);
 
-			foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
-			{
-				count++;
+            foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpPub1.GetEncoded();
+                byte[] bytes = pgpPub1.GetEncoded();
 
-				PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
+                PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
 
-				foreach (PgpPublicKey o in pgpPub2.GetPublicKeys())
-				{
-					if (o == null)
-						Fail("null keyring found");
+                foreach (PgpPublicKey o in pgpPub2.GetPublicKeys())
+                {
+                    if (o == null)
+                        Fail("null keyring found");
 
-					keyCount++;
-				}
+                    keyCount++;
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of public keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of public keys");
+                }
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of public keyrings");
-			}
+            if (count != 1)
+            {
+                Fail("wrong number of public keyrings");
+            }
 
-#if INCLUDE_IDEA
-			PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec5);
+            PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec5);
 
-			count = 0;
-
-			encRing = secretRings1.GetEncoded();
+            count = 0;
+
+            encRing = secretRings1.GetEncoded();
 
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
 
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
-			{
-				count++;
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpSec1.GetEncoded();
+                byte[] bytes = pgpSec1.GetEncoded();
 
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					k.ExtractPrivateKey(sec5pass1);
-				}
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    k.ExtractPrivateKey(sec5pass1);
+                }
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-#endif
-		}
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
 
-		[Test]
-		public void PerformTest6()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub6);
+        [Test]
+        public void PerformTest6()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub6);
 
-			foreach (PgpPublicKeyRing pgpPub in pubRings.GetKeyRings())
-			{
-				foreach (PgpPublicKey k in pgpPub.GetPublicKeys())
-				{
-					if (k.KeyId == 0x5ce086b5b5a18ff4L)
-					{
-						int count = 0;
+            foreach (PgpPublicKeyRing pgpPub in pubRings.GetKeyRings())
+            {
+                foreach (PgpPublicKey k in pgpPub.GetPublicKeys())
+                {
+                    if (k.KeyId == 0x5ce086b5b5a18ff4L)
+                    {
+                        int count = 0;
 
-						foreach (PgpSignature sig in k.GetSignaturesOfType(PgpSignature.SubkeyRevocation))
-						{
-							if (sig == null)
-								Fail("null signature found");
+                        foreach (PgpSignature sig in k.GetSignaturesOfType(PgpSignature.SubkeyRevocation))
+                        {
+                            if (sig == null)
+                                Fail("null signature found");
 
-							count++;
-						}
+                            count++;
+                        }
 
-						if (count != 1)
-						{
-							Fail("wrong number of revocations in test6.");
-						}
-					}
-				}
-			}
+                        if (count != 1)
+                        {
+                            Fail("wrong number of revocations in test6.");
+                        }
+                    }
+                }
+            }
 
-			byte[] encRing = pubRings.GetEncoded();
-		}
+            byte[] encRing = pubRings.GetEncoded();
+        }
 
-		[Test, Explicit]
-		public void PerformTest7()
-		{
-			PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(pub7);
-			PgpPublicKey masterKey = null;
+        [Test, Explicit]
+        public void PerformTest7()
+        {
+            PgpPublicKeyRing pgpPub = new PgpPublicKeyRing(pub7);
+            PgpPublicKey masterKey = null;
 
-			foreach (PgpPublicKey k in pgpPub.GetPublicKeys())
-			{
-				if (k.IsMasterKey)
-				{
-					masterKey = k;
-					continue;
-				}
+            foreach (PgpPublicKey k in pgpPub.GetPublicKeys())
+            {
+                if (k.IsMasterKey)
+                {
+                    masterKey = k;
+                    continue;
+                }
 
-				int count = 0;
-				PgpSignature sig = null;
+                int count = 0;
+                PgpSignature sig = null;
 
-				foreach (PgpSignature sigTemp in k.GetSignaturesOfType(PgpSignature.SubkeyRevocation))
-				{
-					sig = sigTemp;
-					count++;
-				}
+                foreach (PgpSignature sigTemp in k.GetSignaturesOfType(PgpSignature.SubkeyRevocation))
+                {
+                    sig = sigTemp;
+                    count++;
+                }
 
-				if (count != 1)
-				{
-					Fail("wrong number of revocations in test7.");
-				}
+                if (count != 1)
+                {
+                    Fail("wrong number of revocations in test7.");
+                }
 
-				sig.InitVerify(masterKey);
+                sig.InitVerify(masterKey);
 
-				if (!sig.VerifyCertification(k))
-				{
-					Fail("failed to verify revocation certification");
-				}
-			}
-		}
+                if (!sig.VerifyCertification(k))
+                {
+                    Fail("failed to verify revocation certification");
+                }
+            }
+        }
 
-		[Test]
-		public void PerformTest8()
-		{
-			PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub8);
+        [Test]
+        public void PerformTest8()
+        {
+            PgpPublicKeyRingBundle pubRings = new PgpPublicKeyRingBundle(pub8);
 
-			int count = 0;
+            int count = 0;
 
-			byte[] encRing = pubRings.GetEncoded();
+            byte[] encRing = pubRings.GetEncoded();
 
-			pubRings = new PgpPublicKeyRingBundle(encRing);
+            pubRings = new PgpPublicKeyRingBundle(encRing);
 
-			foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
-			{
-				count++;
+            foreach (PgpPublicKeyRing pgpPub1 in pubRings.GetKeyRings())
+            {
+                count++;
 
-				int keyCount = 0;
+                int keyCount = 0;
 
-				byte[] bytes = pgpPub1.GetEncoded();
-
-				PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
+                byte[] bytes = pgpPub1.GetEncoded();
 
-				foreach (PgpPublicKey o in pgpPub2.GetPublicKeys())
-				{
-					if (o == null)
-						Fail("null key found");
+                PgpPublicKeyRing pgpPub2 = new PgpPublicKeyRing(bytes);
 
-					keyCount++;
-				}
+                foreach (PgpPublicKey o in pgpPub2.GetPublicKeys())
+                {
+                    if (o == null)
+                        Fail("null key found");
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of public keys");
-				}
-			}
+                    keyCount++;
+                }
 
-			if (count != 2)
-			{
-				Fail("wrong number of public keyrings");
-			}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of public keys");
+                }
+            }
 
-			PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec8);
+            if (count != 2)
+            {
+                Fail("wrong number of public keyrings");
+            }
 
-			count = 0;
+            PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec8);
 
-			encRing = secretRings1.GetEncoded();
+            count = 0;
 
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
+            encRing = secretRings1.GetEncoded();
 
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
-			{
-				count++;
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
 
-				int keyCount = 0;
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
+            {
+                count++;
 
-				byte[] bytes = pgpSec1.GetEncoded();
+                int keyCount = 0;
 
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                byte[] bytes = pgpSec1.GetEncoded();
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-					k.ExtractPrivateKey(sec8pass);
-				}
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				if (keyCount != 2)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+                    k.ExtractPrivateKey(sec8pass);
+                }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-		}
+                if (keyCount != 2)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
 
-		[Test]
-		public void PerformTest9()
-		{
-			PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec9);
-
-			int count = 0;
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
 
-			byte[] encRing = secretRings1.GetEncoded();
+        [Test]
+        public void PerformTest9()
+        {
+            PgpSecretKeyRingBundle secretRings1 = new PgpSecretKeyRingBundle(sec9);
+
+            int count = 0;
 
-			PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
-
-			foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
-			{
-				count++;
+            byte[] encRing = secretRings1.GetEncoded();
 
-				int keyCount = 0;
+            PgpSecretKeyRingBundle secretRings2 = new PgpSecretKeyRingBundle(encRing);
+
+            foreach (PgpSecretKeyRing pgpSec1 in secretRings1.GetKeyRings())
+            {
+                count++;
 
-				byte[] bytes = pgpSec1.GetEncoded();
-
-				PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
+                int keyCount = 0;
 
-				foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
-				{
-					keyCount++;
-
-					PgpPrivateKey pKey = k.ExtractPrivateKey(sec9pass);
-					if (keyCount == 1 && pKey != null)
-					{
-						Fail("primary secret key found, null expected");
-					}
-				}
+                byte[] bytes = pgpSec1.GetEncoded();
+
+                PgpSecretKeyRing pgpSec2 = new PgpSecretKeyRing(bytes);
 
-				if (keyCount != 3)
-				{
-					Fail("wrong number of secret keys");
-				}
-			}
+                foreach (PgpSecretKey k in pgpSec2.GetSecretKeys())
+                {
+                    keyCount++;
+
+                    PgpPrivateKey pKey = k.ExtractPrivateKey(sec9pass);
+                    if (keyCount == 1 && pKey != null)
+                    {
+                        Fail("primary secret key found, null expected");
+                    }
+                }
 
-			if (count != 1)
-			{
-				Fail("wrong number of secret keyrings");
-			}
-		}
-
-		[Test]
-		public void PerformTest10()
-		{
-			PgpSecretKeyRing secretRing = new PgpSecretKeyRing(sec10);
-
-			foreach (PgpSecretKey secretKey in secretRing.GetSecretKeys())
-			{
-				PgpPublicKey pubKey = secretKey.PublicKey;
-
-				if (pubKey.ValidDays != 28)
-				{
-					Fail("days wrong on secret key ring");
-				}
-
-				if (pubKey.GetValidSeconds() != 28 * 24 * 60 * 60)
-				{
-					Fail("seconds wrong on secret key ring");
-				}
-			}
-
-			PgpPublicKeyRing publicRing = new PgpPublicKeyRing(pub10);
-
-			foreach (PgpPublicKey pubKey in publicRing.GetPublicKeys())
-			{
-				if (pubKey.ValidDays != 28)
-				{
-					Fail("days wrong on public key ring");
-				}
-
-				if (pubKey.GetValidSeconds() != 28 * 24 * 60 * 60)
-				{
-					Fail("seconds wrong on public key ring");
-				}
-			}
-		}
-
-		[Test]
-		public void PerformTest11()
-		{
-			PgpPublicKeyRing pubRing = new PgpPublicKeyRing(subKeyBindingKey);
-
-			foreach (PgpPublicKey key in pubRing.GetPublicKeys())
-			{
-				if (key.GetValidSeconds() != 0)
-				{
-					Fail("expiration time non-zero");
-				}
-			}
-		}
-
-		[Test]
-		public void GenerateTest()
-		{
-			char[] passPhrase = "hello".ToCharArray();
-			DsaParametersGenerator pGen = new DsaParametersGenerator();
-			pGen.Init(512, 80, new SecureRandom());
-			DsaParameters dsaParams = pGen.GenerateParameters();
-			DsaKeyGenerationParameters dsaKgp = new DsaKeyGenerationParameters(new SecureRandom(), dsaParams);
-			IAsymmetricCipherKeyPairGenerator dsaKpg = GeneratorUtilities.GetKeyPairGenerator("DSA");
-			dsaKpg.Init(dsaKgp);
-
-
-			//
-			// this takes a while as the key generator has to Generate some DSA parameters
-			// before it Generates the key.
-			//
-			AsymmetricCipherKeyPair dsaKp = dsaKpg.GenerateKeyPair();
-			IAsymmetricCipherKeyPairGenerator elgKpg = GeneratorUtilities.GetKeyPairGenerator("ELGAMAL");
-
-			BigInteger g = new BigInteger("153d5d6172adb43045b68ae8e1de1070b6137005686d29d3d73a7749199681ee5b212c9b96bfdcfa5b20cd5e3fd2044895d609cf9b410b7a0f12ca1cb9a428cc", 16);
-			BigInteger p = new BigInteger("9494fec095f3b85ee286542b3836fc81a5dd0a0349b4c239dd38744d488cf8e31db8bcb7d33b41abb9e5a33cca9144b1cef332c94bf0573bf047a3aca98cdf3b", 16);
-
-			ElGamalParameters elParams = new ElGamalParameters(p, g);
-			ElGamalKeyGenerationParameters elKgp = new ElGamalKeyGenerationParameters(new SecureRandom(), elParams);
-			elgKpg.Init(elKgp);
-
-			//
-			// this is quicker because we are using preGenerated parameters.
-			//
-			AsymmetricCipherKeyPair elgKp = elgKpg.GenerateKeyPair();
-			PgpKeyPair dsaKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.Dsa, dsaKp, DateTime.UtcNow);
-			PgpKeyPair elgKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.ElGamalEncrypt, elgKp, DateTime.UtcNow);
-
-			PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification, dsaKeyPair,
-				"test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, new SecureRandom());
-
-			keyRingGen.AddSubKey(elgKeyPair);
-
-			PgpSecretKeyRing keyRing = keyRingGen.GenerateSecretKeyRing();
-
-			keyRing.GetSecretKey().ExtractPrivateKey(passPhrase);
-
-			PgpPublicKeyRing pubRing = keyRingGen.GeneratePublicKeyRing();
-
-			PgpPublicKey vKey = null;
-			PgpPublicKey sKey = null;
-
-			foreach (PgpPublicKey pk in pubRing.GetPublicKeys())
-			{
-				if (pk.IsMasterKey)
-				{
-					vKey = pk;
-				}
-				else
-				{
-					sKey = pk;
-				}
-			}
-
-			foreach (PgpSignature sig in sKey.GetSignatures())
-			{
-				if (sig.KeyId == vKey.KeyId
-					&& sig.SignatureType == PgpSignature.SubkeyBinding)
-				{
-					sig.InitVerify(vKey);
-
-					if (!sig.VerifyCertification(vKey, sKey))
-					{
-						Fail("failed to verify sub-key signature.");
-					}
-				}
-			}
-		}
-
-		[Test]
-		public void InsertMasterTest()
-		{
-			SecureRandom random = new SecureRandom();
-
-			char[] passPhrase = "hello".ToCharArray();
-			IAsymmetricCipherKeyPairGenerator rsaKpg = GeneratorUtilities.GetKeyPairGenerator("RSA");
-
-			rsaKpg.Init(new KeyGenerationParameters(random, 512));
-
-			//
-			// this is quicker because we are using pregenerated parameters.
-			//
-			AsymmetricCipherKeyPair rsaKp = rsaKpg.GenerateKeyPair();
-			PgpKeyPair rsaKeyPair1 = new PgpKeyPair(PublicKeyAlgorithmTag.RsaGeneral, rsaKp, DateTime.UtcNow);
-
-			rsaKp = rsaKpg.GenerateKeyPair();
-			PgpKeyPair rsaKeyPair2 = new PgpKeyPair(PublicKeyAlgorithmTag.RsaGeneral, rsaKp, DateTime.UtcNow);
-
-			PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification,
-				rsaKeyPair1, "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, random);
-			PgpSecretKeyRing secRing1 = keyRingGen.GenerateSecretKeyRing();
-			PgpPublicKeyRing pubRing1 = keyRingGen.GeneratePublicKeyRing();
-
-			keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification,
-				rsaKeyPair2, "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, random);
-			PgpSecretKeyRing secRing2 = keyRingGen.GenerateSecretKeyRing();
-			PgpPublicKeyRing pubRing2 = keyRingGen.GeneratePublicKeyRing();
-
-			try
-			{
-				PgpPublicKeyRing.InsertPublicKey(pubRing1, pubRing2.GetPublicKey());
-				Fail("adding second master key (public) should throw an ArgumentException");
-			}
-			catch (ArgumentException e)
-			{
-				if (!e.Message.Equals("cannot add a master key to a ring that already has one"))
-				{
-					Fail("wrong message in public test");
-				}
-			}
-
-			try
-			{
-				PgpSecretKeyRing.InsertSecretKey(secRing1, secRing2.GetSecretKey());
-				Fail("adding second master key (secret) should throw an ArgumentException");
-			}
-			catch (ArgumentException e)
-			{
-				if (!e.Message.Equals("cannot add a master key to a ring that already has one"))
-				{
-					Fail("wrong message in secret test");
-				}
-			}
-		}
-
-		[Test]
-		public void GenerateSha1Test()
-		{
-			char[] passPhrase = "hello".ToCharArray();
-
-			IAsymmetricCipherKeyPairGenerator dsaKpg = GeneratorUtilities.GetKeyPairGenerator("DSA");
-			DsaParametersGenerator pGen = new DsaParametersGenerator();
-			pGen.Init(512, 80, new SecureRandom());
-			DsaParameters dsaParams = pGen.GenerateParameters();
-			DsaKeyGenerationParameters kgp = new DsaKeyGenerationParameters(new SecureRandom(), dsaParams);
-			dsaKpg.Init(kgp);
-
-			//
-			// this takes a while as the key generator has to generate some DSA params
-			// before it generates the key.
-			//
-			AsymmetricCipherKeyPair dsaKp = dsaKpg.GenerateKeyPair();
-
-
-			IAsymmetricCipherKeyPairGenerator elgKpg = GeneratorUtilities.GetKeyPairGenerator("ELGAMAL");
-
-			BigInteger g = new BigInteger("153d5d6172adb43045b68ae8e1de1070b6137005686d29d3d73a7749199681ee5b212c9b96bfdcfa5b20cd5e3fd2044895d609cf9b410b7a0f12ca1cb9a428cc", 16);
-			BigInteger p = new BigInteger("9494fec095f3b85ee286542b3836fc81a5dd0a0349b4c239dd38744d488cf8e31db8bcb7d33b41abb9e5a33cca9144b1cef332c94bf0573bf047a3aca98cdf3b", 16);
-
-			ElGamalParameters elParams = new ElGamalParameters(p, g);
-			ElGamalKeyGenerationParameters elKgp = new ElGamalKeyGenerationParameters(new SecureRandom(), elParams);
-			elgKpg.Init(elKgp);
-
-			//
-			// this is quicker because we are using preGenerated parameters.
-			//
-			AsymmetricCipherKeyPair elgKp = elgKpg.GenerateKeyPair();
-
-
-			PgpKeyPair dsaKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.Dsa, dsaKp, DateTime.UtcNow);
-			PgpKeyPair elgKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.ElGamalEncrypt, elgKp, DateTime.UtcNow);
-
-			PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification, dsaKeyPair,
-				"test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, true, null, null, new SecureRandom());
-
-			keyRingGen.AddSubKey(elgKeyPair);
-
-			PgpSecretKeyRing keyRing = keyRingGen.GenerateSecretKeyRing();
-
-			keyRing.GetSecretKey().ExtractPrivateKey(passPhrase);
-
-			PgpPublicKeyRing pubRing = keyRingGen.GeneratePublicKeyRing();
-
-			PgpPublicKey vKey = null;
-			PgpPublicKey sKey = null;
-
-			foreach (PgpPublicKey pk in pubRing.GetPublicKeys())
-			{
-				if (pk.IsMasterKey)
-				{
-					vKey = pk;
-				}
-				else
-				{
-					sKey = pk;
-				}
-			}
-
-			foreach (PgpSignature sig in sKey.GetSignatures())
-			{
-				if (sig.KeyId == vKey.KeyId
-					&& sig.SignatureType == PgpSignature.SubkeyBinding)
-				{
-					sig.InitVerify(vKey);
-
-					if (!sig.VerifyCertification(vKey, sKey))
-					{
-						Fail("failed to verify sub-key signature.");
-					}
-				}
-			}
-		}
-
-		[Test]
-		public void RewrapTest()
-		{
-			SecureRandom rand = new SecureRandom();
-
-			// Read the secret key rings
-			PgpSecretKeyRingBundle privRings = new PgpSecretKeyRingBundle(
-				new MemoryStream(rewrapKey, false));
-
-			foreach (PgpSecretKeyRing pgpPrivEnum in privRings.GetKeyRings())
-			{
-				foreach (PgpSecretKey pgpKeyEnum in pgpPrivEnum.GetSecretKeys())
-				{
-					// re-encrypt the key with an empty password
-					PgpSecretKeyRing pgpPriv = PgpSecretKeyRing.RemoveSecretKey(pgpPrivEnum, pgpKeyEnum);
-					PgpSecretKey pgpKey = PgpSecretKey.CopyWithNewPassword(
-						pgpKeyEnum,
-						rewrapPass,
-						null,
-						SymmetricKeyAlgorithmTag.Null,
-						rand);
-					pgpPriv = PgpSecretKeyRing.InsertSecretKey(pgpPriv, pgpKey);
-
-					// this should succeed
-					PgpPrivateKey privTmp = pgpKey.ExtractPrivateKey(null);
-				}
-			}
-		}
-
-		[Test]
-		public void PublicKeyRingWithX509Test()
-		{
-			checkPublicKeyRingWithX509(pubWithX509);
-
-			PgpPublicKeyRing pubRing = new PgpPublicKeyRing(pubWithX509);
-
-			checkPublicKeyRingWithX509(pubRing.GetEncoded());
-		}
-
-		[Test]
-		public void SecretKeyRingWithPersonalCertificateTest()
-		{
-			checkSecretKeyRingWithPersonalCertificate(secWithPersonalCertificate);
-			PgpSecretKeyRingBundle secRing = new PgpSecretKeyRingBundle(secWithPersonalCertificate);
-			checkSecretKeyRingWithPersonalCertificate(secRing.GetEncoded());
-		}
-
-		private void checkSecretKeyRingWithPersonalCertificate(
-			byte[] keyRing)
-		{
-			PgpSecretKeyRingBundle secCol = new PgpSecretKeyRingBundle(keyRing);
-
-			int count = 0;
-
-			foreach (PgpSecretKeyRing ring in secCol.GetKeyRings())
-			{
-				IEnumerator e = ring.GetExtraPublicKeys().GetEnumerator();
-				while (e.MoveNext())
-				{
-					++count;
-				}
-			}
-
-			if (count != 1)
-			{
-				Fail("personal certificate data subkey not found - count = " + count);
-			}
-		}
-
-		private void checkPublicKeyRingWithX509(
-			byte[] keyRing)
-		{
-			PgpPublicKeyRing pubRing = new PgpPublicKeyRing(keyRing);
-			IEnumerator en = pubRing.GetPublicKeys().GetEnumerator();
-
-			if (en.MoveNext())
-			{
-				PgpPublicKey key = (PgpPublicKey) en.Current;
-
-				IEnumerator sEn = key.GetSignatures().GetEnumerator();
-
-				if (sEn.MoveNext())
-				{
-					PgpSignature sig = (PgpSignature) sEn.Current;
-					if (sig.KeyAlgorithm != PublicKeyAlgorithmTag.Experimental_1)
-					{
-						Fail("experimental signature not found");
-					}
-					if (!AreEqual(sig.GetSignature(), Hex.Decode("000101")))
-					{
-						Fail("experimental encoding check failed");
-					}
-				}
-				else
-				{
-					Fail("no signature found");
-				}
-			}
-			else
-			{
-				Fail("no key found");
-			}
-		}
-
-		public override void PerformTest()
-		{
-			PerformTest1();
-			PerformTest2();
-			PerformTest3();
-			PerformTest4();
-			PerformTest5();
-			PerformTest6();
-
-			// NB: This was commented out in the original Java source
-			//PerformTest7();
-
-			PerformTest8();
-			PerformTest9();
-			PerformTest10();
-			PerformTest11();
-
-			GenerateTest();
-			GenerateSha1Test();
-			RewrapTest();
-			PublicKeyRingWithX509Test();
-			SecretKeyRingWithPersonalCertificateTest();
-			InsertMasterTest();
-		}
-
-		public override string Name
-		{
-			get { return "PgpKeyRingTest"; }
-		}
-
-		public static void Main(
-			string[] args)
-		{
-			RunTest(new PgpKeyRingTest());
-		}
-	}
+                if (keyCount != 3)
+                {
+                    Fail("wrong number of secret keys");
+                }
+            }
+
+            if (count != 1)
+            {
+                Fail("wrong number of secret keyrings");
+            }
+        }
+
+        [Test]
+        public void PerformTest10()
+        {
+            PgpSecretKeyRing secretRing = new PgpSecretKeyRing(sec10);
+
+            foreach (PgpSecretKey secretKey in secretRing.GetSecretKeys())
+            {
+                PgpPublicKey pubKey = secretKey.PublicKey;
+
+                if (pubKey.ValidDays != 28)
+                {
+                    Fail("days wrong on secret key ring");
+                }
+
+                if (pubKey.GetValidSeconds() != 28 * 24 * 60 * 60)
+                {
+                    Fail("seconds wrong on secret key ring");
+                }
+            }
+
+            PgpPublicKeyRing publicRing = new PgpPublicKeyRing(pub10);
+
+            foreach (PgpPublicKey pubKey in publicRing.GetPublicKeys())
+            {
+                if (pubKey.ValidDays != 28)
+                {
+                    Fail("days wrong on public key ring");
+                }
+
+                if (pubKey.GetValidSeconds() != 28 * 24 * 60 * 60)
+                {
+                    Fail("seconds wrong on public key ring");
+                }
+            }
+        }
+
+        [Test]
+        public void PerformTest11()
+        {
+            PgpPublicKeyRing pubRing = new PgpPublicKeyRing(subKeyBindingKey);
+
+            foreach (PgpPublicKey key in pubRing.GetPublicKeys())
+            {
+                if (key.GetValidSeconds() != 0)
+                {
+                    Fail("expiration time non-zero");
+                }
+            }
+        }
+
+        [Test]
+        public void GenerateTest()
+        {
+            char[] passPhrase = "hello".ToCharArray();
+            DsaParametersGenerator pGen = new DsaParametersGenerator();
+            pGen.Init(512, 80, new SecureRandom());
+            DsaParameters dsaParams = pGen.GenerateParameters();
+            DsaKeyGenerationParameters dsaKgp = new DsaKeyGenerationParameters(new SecureRandom(), dsaParams);
+            IAsymmetricCipherKeyPairGenerator dsaKpg = GeneratorUtilities.GetKeyPairGenerator("DSA");
+            dsaKpg.Init(dsaKgp);
+
+
+            //
+            // this takes a while as the key generator has to Generate some DSA parameters
+            // before it Generates the key.
+            //
+            AsymmetricCipherKeyPair dsaKp = dsaKpg.GenerateKeyPair();
+            IAsymmetricCipherKeyPairGenerator elgKpg = GeneratorUtilities.GetKeyPairGenerator("ELGAMAL");
+
+            BigInteger g = new BigInteger("153d5d6172adb43045b68ae8e1de1070b6137005686d29d3d73a7749199681ee5b212c9b96bfdcfa5b20cd5e3fd2044895d609cf9b410b7a0f12ca1cb9a428cc", 16);
+            BigInteger p = new BigInteger("9494fec095f3b85ee286542b3836fc81a5dd0a0349b4c239dd38744d488cf8e31db8bcb7d33b41abb9e5a33cca9144b1cef332c94bf0573bf047a3aca98cdf3b", 16);
+
+            ElGamalParameters elParams = new ElGamalParameters(p, g);
+            ElGamalKeyGenerationParameters elKgp = new ElGamalKeyGenerationParameters(new SecureRandom(), elParams);
+            elgKpg.Init(elKgp);
+
+            //
+            // this is quicker because we are using preGenerated parameters.
+            //
+            AsymmetricCipherKeyPair elgKp = elgKpg.GenerateKeyPair();
+            PgpKeyPair dsaKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.Dsa, dsaKp, DateTime.UtcNow);
+            PgpKeyPair elgKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.ElGamalEncrypt, elgKp, DateTime.UtcNow);
+
+            PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification, dsaKeyPair,
+                "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, new SecureRandom());
+
+            keyRingGen.AddSubKey(elgKeyPair);
+
+            PgpSecretKeyRing keyRing = keyRingGen.GenerateSecretKeyRing();
+
+            keyRing.GetSecretKey().ExtractPrivateKey(passPhrase);
+
+            PgpPublicKeyRing pubRing = keyRingGen.GeneratePublicKeyRing();
+
+            PgpPublicKey vKey = null;
+            PgpPublicKey sKey = null;
+
+            foreach (PgpPublicKey pk in pubRing.GetPublicKeys())
+            {
+                if (pk.IsMasterKey)
+                {
+                    vKey = pk;
+                }
+                else
+                {
+                    sKey = pk;
+                }
+            }
+
+            foreach (PgpSignature sig in sKey.GetSignatures())
+            {
+                if (sig.KeyId == vKey.KeyId
+                    && sig.SignatureType == PgpSignature.SubkeyBinding)
+                {
+                    sig.InitVerify(vKey);
+
+                    if (!sig.VerifyCertification(vKey, sKey))
+                    {
+                        Fail("failed to verify sub-key signature.");
+                    }
+                }
+            }
+        }
+
+        [Test]
+        public void InsertMasterTest()
+        {
+            SecureRandom random = new SecureRandom();
+
+            char[] passPhrase = "hello".ToCharArray();
+            IAsymmetricCipherKeyPairGenerator rsaKpg = GeneratorUtilities.GetKeyPairGenerator("RSA");
+
+            rsaKpg.Init(new KeyGenerationParameters(random, 512));
+
+            //
+            // this is quicker because we are using pregenerated parameters.
+            //
+            AsymmetricCipherKeyPair rsaKp = rsaKpg.GenerateKeyPair();
+            PgpKeyPair rsaKeyPair1 = new PgpKeyPair(PublicKeyAlgorithmTag.RsaGeneral, rsaKp, DateTime.UtcNow);
+
+            rsaKp = rsaKpg.GenerateKeyPair();
+            PgpKeyPair rsaKeyPair2 = new PgpKeyPair(PublicKeyAlgorithmTag.RsaGeneral, rsaKp, DateTime.UtcNow);
+
+            PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification,
+                rsaKeyPair1, "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, random);
+            PgpSecretKeyRing secRing1 = keyRingGen.GenerateSecretKeyRing();
+            PgpPublicKeyRing pubRing1 = keyRingGen.GeneratePublicKeyRing();
+
+            keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification,
+                rsaKeyPair2, "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, null, null, random);
+            PgpSecretKeyRing secRing2 = keyRingGen.GenerateSecretKeyRing();
+            PgpPublicKeyRing pubRing2 = keyRingGen.GeneratePublicKeyRing();
+
+            try
+            {
+                PgpPublicKeyRing.InsertPublicKey(pubRing1, pubRing2.GetPublicKey());
+                Fail("adding second master key (public) should throw an ArgumentException");
+            }
+            catch (ArgumentException e)
+            {
+                if (!e.Message.Equals("cannot add a master key to a ring that already has one"))
+                {
+                    Fail("wrong message in public test");
+                }
+            }
+
+            try
+            {
+                PgpSecretKeyRing.InsertSecretKey(secRing1, secRing2.GetSecretKey());
+                Fail("adding second master key (secret) should throw an ArgumentException");
+            }
+            catch (ArgumentException e)
+            {
+                if (!e.Message.Equals("cannot add a master key to a ring that already has one"))
+                {
+                    Fail("wrong message in secret test");
+                }
+            }
+        }
+
+        [Test]
+        public void GenerateSha1Test()
+        {
+            char[] passPhrase = "hello".ToCharArray();
+
+            IAsymmetricCipherKeyPairGenerator dsaKpg = GeneratorUtilities.GetKeyPairGenerator("DSA");
+            DsaParametersGenerator pGen = new DsaParametersGenerator();
+            pGen.Init(512, 80, new SecureRandom());
+            DsaParameters dsaParams = pGen.GenerateParameters();
+            DsaKeyGenerationParameters kgp = new DsaKeyGenerationParameters(new SecureRandom(), dsaParams);
+            dsaKpg.Init(kgp);
+
+            //
+            // this takes a while as the key generator has to generate some DSA params
+            // before it generates the key.
+            //
+            AsymmetricCipherKeyPair dsaKp = dsaKpg.GenerateKeyPair();
+
+
+            IAsymmetricCipherKeyPairGenerator elgKpg = GeneratorUtilities.GetKeyPairGenerator("ELGAMAL");
+
+            BigInteger g = new BigInteger("153d5d6172adb43045b68ae8e1de1070b6137005686d29d3d73a7749199681ee5b212c9b96bfdcfa5b20cd5e3fd2044895d609cf9b410b7a0f12ca1cb9a428cc", 16);
+            BigInteger p = new BigInteger("9494fec095f3b85ee286542b3836fc81a5dd0a0349b4c239dd38744d488cf8e31db8bcb7d33b41abb9e5a33cca9144b1cef332c94bf0573bf047a3aca98cdf3b", 16);
+
+            ElGamalParameters elParams = new ElGamalParameters(p, g);
+            ElGamalKeyGenerationParameters elKgp = new ElGamalKeyGenerationParameters(new SecureRandom(), elParams);
+            elgKpg.Init(elKgp);
+
+            //
+            // this is quicker because we are using preGenerated parameters.
+            //
+            AsymmetricCipherKeyPair elgKp = elgKpg.GenerateKeyPair();
+
+
+            PgpKeyPair dsaKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.Dsa, dsaKp, DateTime.UtcNow);
+            PgpKeyPair elgKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.ElGamalEncrypt, elgKp, DateTime.UtcNow);
+
+            PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification, dsaKeyPair,
+                "test", SymmetricKeyAlgorithmTag.Aes256, passPhrase, true, null, null, new SecureRandom());
+
+            keyRingGen.AddSubKey(elgKeyPair);
+
+            PgpSecretKeyRing keyRing = keyRingGen.GenerateSecretKeyRing();
+
+            keyRing.GetSecretKey().ExtractPrivateKey(passPhrase);
+
+            PgpPublicKeyRing pubRing = keyRingGen.GeneratePublicKeyRing();
+
+            PgpPublicKey vKey = null;
+            PgpPublicKey sKey = null;
+
+            foreach (PgpPublicKey pk in pubRing.GetPublicKeys())
+            {
+                if (pk.IsMasterKey)
+                {
+                    vKey = pk;
+                }
+                else
+                {
+                    sKey = pk;
+                }
+            }
+
+            foreach (PgpSignature sig in sKey.GetSignatures())
+            {
+                if (sig.KeyId == vKey.KeyId
+                    && sig.SignatureType == PgpSignature.SubkeyBinding)
+                {
+                    sig.InitVerify(vKey);
+
+                    if (!sig.VerifyCertification(vKey, sKey))
+                    {
+                        Fail("failed to verify sub-key signature.");
+                    }
+                }
+            }
+        }
+
+        [Test]
+        public void RewrapTest()
+        {
+            SecureRandom rand = new SecureRandom();
+
+            // Read the secret key rings
+            PgpSecretKeyRingBundle privRings = new PgpSecretKeyRingBundle(
+                new MemoryStream(rewrapKey, false));
+
+            foreach (PgpSecretKeyRing pgpPrivEnum in privRings.GetKeyRings())
+            {
+                foreach (PgpSecretKey pgpKeyEnum in pgpPrivEnum.GetSecretKeys())
+                {
+                    // re-encrypt the key with an empty password
+                    PgpSecretKeyRing pgpPriv = PgpSecretKeyRing.RemoveSecretKey(pgpPrivEnum, pgpKeyEnum);
+                    PgpSecretKey pgpKey = PgpSecretKey.CopyWithNewPassword(
+                        pgpKeyEnum,
+                        rewrapPass,
+                        null,
+                        SymmetricKeyAlgorithmTag.Null,
+                        rand);
+                    pgpPriv = PgpSecretKeyRing.InsertSecretKey(pgpPriv, pgpKey);
+
+                    // this should succeed
+                    PgpPrivateKey privTmp = pgpKey.ExtractPrivateKey(null);
+                }
+            }
+        }
+
+        [Test]
+        public void PublicKeyRingWithX509Test()
+        {
+            checkPublicKeyRingWithX509(pubWithX509);
+
+            PgpPublicKeyRing pubRing = new PgpPublicKeyRing(pubWithX509);
+
+            checkPublicKeyRingWithX509(pubRing.GetEncoded());
+        }
+
+        [Test]
+        public void SecretKeyRingWithPersonalCertificateTest()
+        {
+            checkSecretKeyRingWithPersonalCertificate(secWithPersonalCertificate);
+            PgpSecretKeyRingBundle secRing = new PgpSecretKeyRingBundle(secWithPersonalCertificate);
+            checkSecretKeyRingWithPersonalCertificate(secRing.GetEncoded());
+        }
+
+        private void checkSecretKeyRingWithPersonalCertificate(
+            byte[] keyRing)
+        {
+            PgpSecretKeyRingBundle secCol = new PgpSecretKeyRingBundle(keyRing);
+
+            int count = 0;
+
+            foreach (PgpSecretKeyRing ring in secCol.GetKeyRings())
+            {
+                IEnumerator e = ring.GetExtraPublicKeys().GetEnumerator();
+                while (e.MoveNext())
+                {
+                    ++count;
+                }
+            }
+
+            if (count != 1)
+            {
+                Fail("personal certificate data subkey not found - count = " + count);
+            }
+        }
+
+        private void checkPublicKeyRingWithX509(
+            byte[] keyRing)
+        {
+            PgpPublicKeyRing pubRing = new PgpPublicKeyRing(keyRing);
+            IEnumerator en = pubRing.GetPublicKeys().GetEnumerator();
+
+            if (en.MoveNext())
+            {
+                PgpPublicKey key = (PgpPublicKey) en.Current;
+
+                IEnumerator sEn = key.GetSignatures().GetEnumerator();
+
+                if (sEn.MoveNext())
+                {
+                    PgpSignature sig = (PgpSignature) sEn.Current;
+                    if (sig.KeyAlgorithm != PublicKeyAlgorithmTag.Experimental_1)
+                    {
+                        Fail("experimental signature not found");
+                    }
+                    if (!AreEqual(sig.GetSignature(), Hex.Decode("000101")))
+                    {
+                        Fail("experimental encoding check failed");
+                    }
+                }
+                else
+                {
+                    Fail("no signature found");
+                }
+            }
+            else
+            {
+                Fail("no key found");
+            }
+        }
+
+        public override void PerformTest()
+        {
+            PerformTest1();
+            PerformTest2();
+            PerformTest3();
+            PerformTest4();
+            PerformTest5();
+            PerformTest6();
+
+            // NB: This was commented out in the original Java source
+            //PerformTest7();
+
+            PerformTest8();
+            PerformTest9();
+            PerformTest10();
+            PerformTest11();
+
+            GenerateTest();
+            GenerateSha1Test();
+            RewrapTest();
+            PublicKeyRingWithX509Test();
+            SecretKeyRingWithPersonalCertificateTest();
+            InsertMasterTest();
+        }
+
+        public override string Name
+        {
+            get { return "PgpKeyRingTest"; }
+        }
+
+        public static void Main(
+            string[] args)
+        {
+            RunTest(new PgpKeyRingTest());
+        }
+    }
 }
diff --git a/crypto/test/src/test/BlockCipherTest.cs b/crypto/test/src/test/BlockCipherTest.cs
index d4c52ed95..2e8e8b0b8 100644
--- a/crypto/test/src/test/BlockCipherTest.cs
+++ b/crypto/test/src/test/BlockCipherTest.cs
@@ -356,13 +356,6 @@ namespace Org.BouncyCastle.Tests
             string baseAlgorithm = parts[0];
             string mode = parts.Length > 1 ? parts[1] : null;
 
-#if !INCLUDE_IDEA
-            if (baseAlgorithm.Equals("IDEA"))
-            {
-                return;
-            }
-#endif
-
             try
             {
                 keyGen = GeneratorUtilities.GetKeyGenerator(baseAlgorithm);
diff --git a/crypto/test/src/test/nist/NistCertPathTest.cs b/crypto/test/src/test/nist/NistCertPathTest.cs
index f42f64ca2..fed98a778 100644
--- a/crypto/test/src/test/nist/NistCertPathTest.cs
+++ b/crypto/test/src/test/nist/NistCertPathTest.cs
@@ -185,7 +185,7 @@ namespace Org.BouncyCastle.Tests.Nist
 				new string[] { "NegativeSerialNumberCACert", "InvalidNegativeSerialNumberTest15EE" },
 				new string[] { TRUST_ANCHOR_ROOT_CRL, "NegativeSerialNumberCACRL" },
 				0,
-				"Certificate revocation after 4/19/2001 2:57:20 PM",
+				"Certificate revocation after Thu Apr 19 14:57:20",
 				"reason: keyCompromise");
 		}
 
diff --git a/csharp.mds b/csharp.mds
deleted file mode 100644
index 7e0c099dd..000000000
--- a/csharp.mds
+++ /dev/null
@@ -1,20 +0,0 @@
-<Combine fileversion="2.0" outputpath="build/bin/">
-  <Configurations active="Release">
-    <Configuration name="Debug" ctype="CombineConfiguration">
-      <Entry build="True" name="crypto" configuration="Debug" />
-      <Entry build="True" name="crypto-test" configuration="Debug" />
-    </Configuration>
-    <Configuration name="Release" ctype="CombineConfiguration">
-      <Entry build="True" name="crypto" configuration="Release" />
-      <Entry build="True" name="crypto-test" configuration="Release" />
-    </Configuration>
-  </Configurations>
-  <StartMode startupentry="crypto-test" single="True">
-    <Execute type="None" entry="crypto" />
-    <Execute type="None" entry="crypto-test" />
-  </StartMode>
-  <Entries>
-    <Entry filename="crypto/crypto.mdp" />
-    <Entry filename="crypto-test/crypto-test.mdp" />
-  </Entries>
-</Combine>
\ No newline at end of file