diff options
114 files changed, 35 insertions, 2330 deletions
diff --git a/crypto/BouncyCastle.Android.csproj b/crypto/BouncyCastle.Android.csproj index 9f584cd3b..7fb3e434d 100644 --- a/crypto/BouncyCastle.Android.csproj +++ b/crypto/BouncyCastle.Android.csproj @@ -96,9 +96,7 @@ <Compile Include="src\asn1\BerApplicationSpecific.cs" /> <Compile Include="src\asn1\BerApplicationSpecificParser.cs" /> <Compile Include="src\asn1\BerBitStringParser.cs" /> - <Compile Include="src\asn1\BerNull.cs" /> <Compile Include="src\asn1\BerOctetString.cs" /> - <Compile Include="src\asn1\BerOutputStream.cs" /> <Compile Include="src\asn1\BerSequence.cs" /> <Compile Include="src\asn1\BerSet.cs" /> <Compile Include="src\asn1\BerTaggedObject.cs" /> @@ -315,8 +313,6 @@ <Compile Include="src\asn1\ess\ContentIdentifier.cs" /> <Compile Include="src\asn1\ess\ESSCertID.cs" /> <Compile Include="src\asn1\ess\ESSCertIDv2.cs" /> - <Compile Include="src\asn1\ess\OtherCertID.cs" /> - <Compile Include="src\asn1\ess\OtherSigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificateV2.cs" /> <Compile Include="src\asn1\gm\GMNamedCurves.cs" /> @@ -421,7 +417,6 @@ <Compile Include="src\asn1\ua\UAObjectIdentifiers.cs" /> <Compile Include="src\asn1\util\Asn1Dump.cs" /> <Compile Include="src\asn1\util\Dump.cs" /> - <Compile Include="src\asn1\util\FilterStream.cs" /> <Compile Include="src\asn1\x500\AttributeTypeAndValue.cs" /> <Compile Include="src\asn1\x500\DirectoryString.cs" /> <Compile Include="src\asn1\x500\Rdn.cs" /> @@ -975,7 +970,6 @@ <Compile Include="src\crypto\paddings\X923Padding.cs" /> <Compile Include="src\crypto\paddings\ZeroBytePadding.cs" /> <Compile Include="src\crypto\parameters\AEADParameters.cs" /> - <Compile Include="src\crypto\parameters\CcmParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyGenerationParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyParameters.cs" /> <Compile Include="src\crypto\parameters\DHParameters.cs" /> @@ -1404,27 +1398,19 @@ <Compile Include="src\math\ec\endo\GlvTypeBParameters.cs" /> <Compile Include="src\math\ec\endo\ScalarSplitParameters.cs" /> <Compile Include="src\math\ec\multiplier\AbstractECMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\DoubleAddMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ECMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointCombMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointUtilities.cs" /> <Compile Include="src\math\ec\multiplier\GlvMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\IPreCompCallback.cs" /> - <Compile Include="src\math\ec\multiplier\MixedNafR2LMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\MontgomeryLadderMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafR2LMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\PreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ReferenceMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ValidityPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafL2RMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WNafPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafUtilities.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafPreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitR2LMultiplier.cs" /> <Compile Include="src\math\ec\rfc7748\X25519.cs" /> <Compile Include="src\math\ec\rfc7748\X25519Field.cs" /> <Compile Include="src\math\ec\rfc7748\X448.cs" /> @@ -1569,7 +1555,6 @@ <Compile Include="src\security\InvalidParameterException.cs" /> <Compile Include="src\security\KeyException.cs" /> <Compile Include="src\security\MacUtilities.cs" /> - <Compile Include="src\security\NoSuchAlgorithmException.cs" /> <Compile Include="src\security\ParameterUtilities.cs" /> <Compile Include="src\security\PbeUtilities.cs" /> <Compile Include="src\security\PrivateKeyFactory.cs" /> @@ -1932,8 +1917,6 @@ <Compile Include="src\util\zlib\JZlib.cs" /> <Compile Include="src\util\zlib\StaticTree.cs" /> <Compile Include="src\util\zlib\Tree.cs" /> - <Compile Include="src\util\zlib\ZDeflaterOutputStream.cs" /> - <Compile Include="src\util\zlib\ZInflaterInputStream.cs" /> <Compile Include="src\util\zlib\ZInputStream.cs" /> <Compile Include="src\util\zlib\ZOutputStream.cs" /> <Compile Include="src\util\zlib\ZStream.cs" /> diff --git a/crypto/BouncyCastle.csproj b/crypto/BouncyCastle.csproj index 82ea19337..dec6bf267 100644 --- a/crypto/BouncyCastle.csproj +++ b/crypto/BouncyCastle.csproj @@ -90,9 +90,7 @@ <Compile Include="src\asn1\BerApplicationSpecific.cs" /> <Compile Include="src\asn1\BerApplicationSpecificParser.cs" /> <Compile Include="src\asn1\BerBitStringParser.cs" /> - <Compile Include="src\asn1\BerNull.cs" /> <Compile Include="src\asn1\BerOctetString.cs" /> - <Compile Include="src\asn1\BerOutputStream.cs" /> <Compile Include="src\asn1\BerSequence.cs" /> <Compile Include="src\asn1\BerSet.cs" /> <Compile Include="src\asn1\BerTaggedObject.cs" /> @@ -309,8 +307,6 @@ <Compile Include="src\asn1\ess\ContentIdentifier.cs" /> <Compile Include="src\asn1\ess\ESSCertID.cs" /> <Compile Include="src\asn1\ess\ESSCertIDv2.cs" /> - <Compile Include="src\asn1\ess\OtherCertID.cs" /> - <Compile Include="src\asn1\ess\OtherSigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificateV2.cs" /> <Compile Include="src\asn1\gm\GMNamedCurves.cs" /> @@ -415,7 +411,6 @@ <Compile Include="src\asn1\ua\UAObjectIdentifiers.cs" /> <Compile Include="src\asn1\util\Asn1Dump.cs" /> <Compile Include="src\asn1\util\Dump.cs" /> - <Compile Include="src\asn1\util\FilterStream.cs" /> <Compile Include="src\asn1\x500\AttributeTypeAndValue.cs" /> <Compile Include="src\asn1\x500\DirectoryString.cs" /> <Compile Include="src\asn1\x500\Rdn.cs" /> @@ -969,7 +964,6 @@ <Compile Include="src\crypto\paddings\X923Padding.cs" /> <Compile Include="src\crypto\paddings\ZeroBytePadding.cs" /> <Compile Include="src\crypto\parameters\AEADParameters.cs" /> - <Compile Include="src\crypto\parameters\CcmParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyGenerationParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyParameters.cs" /> <Compile Include="src\crypto\parameters\DHParameters.cs" /> @@ -1398,27 +1392,19 @@ <Compile Include="src\math\ec\endo\GlvTypeBParameters.cs" /> <Compile Include="src\math\ec\endo\ScalarSplitParameters.cs" /> <Compile Include="src\math\ec\multiplier\AbstractECMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\DoubleAddMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ECMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointCombMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointUtilities.cs" /> <Compile Include="src\math\ec\multiplier\GlvMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\IPreCompCallback.cs" /> - <Compile Include="src\math\ec\multiplier\MixedNafR2LMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\MontgomeryLadderMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafR2LMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\PreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ReferenceMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ValidityPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafL2RMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WNafPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafUtilities.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafPreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitR2LMultiplier.cs" /> <Compile Include="src\math\ec\rfc7748\X25519.cs" /> <Compile Include="src\math\ec\rfc7748\X25519Field.cs" /> <Compile Include="src\math\ec\rfc7748\X448.cs" /> @@ -1563,7 +1549,6 @@ <Compile Include="src\security\InvalidParameterException.cs" /> <Compile Include="src\security\KeyException.cs" /> <Compile Include="src\security\MacUtilities.cs" /> - <Compile Include="src\security\NoSuchAlgorithmException.cs" /> <Compile Include="src\security\ParameterUtilities.cs" /> <Compile Include="src\security\PbeUtilities.cs" /> <Compile Include="src\security\PrivateKeyFactory.cs" /> @@ -1926,8 +1911,6 @@ <Compile Include="src\util\zlib\JZlib.cs" /> <Compile Include="src\util\zlib\StaticTree.cs" /> <Compile Include="src\util\zlib\Tree.cs" /> - <Compile Include="src\util\zlib\ZDeflaterOutputStream.cs" /> - <Compile Include="src\util\zlib\ZInflaterInputStream.cs" /> <Compile Include="src\util\zlib\ZInputStream.cs" /> <Compile Include="src\util\zlib\ZOutputStream.cs" /> <Compile Include="src\util\zlib\ZStream.cs" /> diff --git a/crypto/BouncyCastle.iOS.csproj b/crypto/BouncyCastle.iOS.csproj index 31ac62f93..7c497314e 100644 --- a/crypto/BouncyCastle.iOS.csproj +++ b/crypto/BouncyCastle.iOS.csproj @@ -91,9 +91,7 @@ <Compile Include="src\asn1\BerApplicationSpecific.cs" /> <Compile Include="src\asn1\BerApplicationSpecificParser.cs" /> <Compile Include="src\asn1\BerBitStringParser.cs" /> - <Compile Include="src\asn1\BerNull.cs" /> <Compile Include="src\asn1\BerOctetString.cs" /> - <Compile Include="src\asn1\BerOutputStream.cs" /> <Compile Include="src\asn1\BerSequence.cs" /> <Compile Include="src\asn1\BerSet.cs" /> <Compile Include="src\asn1\BerTaggedObject.cs" /> @@ -310,8 +308,6 @@ <Compile Include="src\asn1\ess\ContentIdentifier.cs" /> <Compile Include="src\asn1\ess\ESSCertID.cs" /> <Compile Include="src\asn1\ess\ESSCertIDv2.cs" /> - <Compile Include="src\asn1\ess\OtherCertID.cs" /> - <Compile Include="src\asn1\ess\OtherSigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificate.cs" /> <Compile Include="src\asn1\ess\SigningCertificateV2.cs" /> <Compile Include="src\asn1\gm\GMNamedCurves.cs" /> @@ -416,7 +412,6 @@ <Compile Include="src\asn1\ua\UAObjectIdentifiers.cs" /> <Compile Include="src\asn1\util\Asn1Dump.cs" /> <Compile Include="src\asn1\util\Dump.cs" /> - <Compile Include="src\asn1\util\FilterStream.cs" /> <Compile Include="src\asn1\x500\AttributeTypeAndValue.cs" /> <Compile Include="src\asn1\x500\DirectoryString.cs" /> <Compile Include="src\asn1\x500\Rdn.cs" /> @@ -970,7 +965,6 @@ <Compile Include="src\crypto\paddings\X923Padding.cs" /> <Compile Include="src\crypto\paddings\ZeroBytePadding.cs" /> <Compile Include="src\crypto\parameters\AEADParameters.cs" /> - <Compile Include="src\crypto\parameters\CcmParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyGenerationParameters.cs" /> <Compile Include="src\crypto\parameters\DHKeyParameters.cs" /> <Compile Include="src\crypto\parameters\DHParameters.cs" /> @@ -1399,27 +1393,19 @@ <Compile Include="src\math\ec\endo\GlvTypeBParameters.cs" /> <Compile Include="src\math\ec\endo\ScalarSplitParameters.cs" /> <Compile Include="src\math\ec\multiplier\AbstractECMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\DoubleAddMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ECMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointCombMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\FixedPointUtilities.cs" /> <Compile Include="src\math\ec\multiplier\GlvMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\IPreCompCallback.cs" /> - <Compile Include="src\math\ec\multiplier\MixedNafR2LMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\MontgomeryLadderMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\NafR2LMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\PreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ReferenceMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\ValidityPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafL2RMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WNafPreCompInfo.cs" /> <Compile Include="src\math\ec\multiplier\WNafUtilities.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafMultiplier.cs" /> <Compile Include="src\math\ec\multiplier\WTauNafPreCompInfo.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitL2RMultiplier.cs" /> - <Compile Include="src\math\ec\multiplier\ZSignedDigitR2LMultiplier.cs" /> <Compile Include="src\math\ec\rfc7748\X25519.cs" /> <Compile Include="src\math\ec\rfc7748\X25519Field.cs" /> <Compile Include="src\math\ec\rfc7748\X448.cs" /> @@ -1564,7 +1550,6 @@ <Compile Include="src\security\InvalidParameterException.cs" /> <Compile Include="src\security\KeyException.cs" /> <Compile Include="src\security\MacUtilities.cs" /> - <Compile Include="src\security\NoSuchAlgorithmException.cs" /> <Compile Include="src\security\ParameterUtilities.cs" /> <Compile Include="src\security\PbeUtilities.cs" /> <Compile Include="src\security\PrivateKeyFactory.cs" /> @@ -1927,8 +1912,6 @@ <Compile Include="src\util\zlib\JZlib.cs" /> <Compile Include="src\util\zlib\StaticTree.cs" /> <Compile Include="src\util\zlib\Tree.cs" /> - <Compile Include="src\util\zlib\ZDeflaterOutputStream.cs" /> - <Compile Include="src\util\zlib\ZInflaterInputStream.cs" /> <Compile Include="src\util\zlib\ZInputStream.cs" /> <Compile Include="src\util\zlib\ZOutputStream.cs" /> <Compile Include="src\util\zlib\ZStream.cs" /> diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index 1529174f1..121abe2a5 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -304,11 +304,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\asn1\BERNull.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\asn1\BEROctetString.cs" SubType = "Code" BuildAction = "Compile" @@ -324,11 +319,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\asn1\BEROutputStream.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\asn1\BERSequence.cs" SubType = "Code" BuildAction = "Compile" @@ -1434,16 +1424,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\asn1\ess\OtherCertID.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\asn1\ess\OtherSigningCertificate.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\asn1\ess\SigningCertificate.cs" SubType = "Code" BuildAction = "Compile" @@ -1964,11 +1944,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\asn1\util\FilterStream.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\asn1\x500\AttributeTypeAndValue.cs" SubType = "Code" BuildAction = "Compile" @@ -4729,11 +4704,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\crypto\parameters\CCMParameters.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\crypto\parameters\DESedeParameters.cs" SubType = "Code" BuildAction = "Compile" @@ -6879,11 +6849,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\math\ec\multiplier\DoubleAddMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\multiplier\ECMultiplier.cs" SubType = "Code" BuildAction = "Compile" @@ -6914,36 +6879,11 @@ BuildAction = "Compile" /> <File - RelPath = "src\math\ec\multiplier\MixedNafR2LMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\multiplier\MontgomeryLadderMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\multiplier\NafL2RMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\multiplier\NafR2LMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\multiplier\PreCompInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File - RelPath = "src\math\ec\multiplier\ReferenceMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\multiplier\ValidityPreCompInfo.cs" SubType = "Code" BuildAction = "Compile" @@ -6974,16 +6914,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\math\ec\multiplier\ZSignedDigitL2RMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\multiplier\ZSignedDigitR2LMultiplier.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\rfc7748\X25519.cs" SubType = "Code" BuildAction = "Compile" @@ -7704,11 +7634,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\security\NoSuchAlgorithmException.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\security\ParameterUtilities.cs" SubType = "Code" BuildAction = "Compile" @@ -9519,16 +9444,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\util\zlib\ZDeflaterOutputStream.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\util\zlib\ZInflaterInputStream.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\util\zlib\ZInputStream.cs" SubType = "Code" BuildAction = "Compile" diff --git a/crypto/src/asn1/Asn1OutputStream.cs b/crypto/src/asn1/Asn1OutputStream.cs index 096b569e3..1a69d7c2c 100644 --- a/crypto/src/asn1/Asn1OutputStream.cs +++ b/crypto/src/asn1/Asn1OutputStream.cs @@ -1,10 +1,12 @@ using System; using System.IO; +using Org.BouncyCastle.Utilities.IO; + namespace Org.BouncyCastle.Asn1 { public class Asn1OutputStream - : DerOutputStream + : FilterStream { internal const int EncodingBer = 1; internal const int EncodingDer = 2; @@ -18,7 +20,7 @@ namespace Org.BouncyCastle.Asn1 { if (Asn1Encodable.Der.Equals(encoding)) { - return new DerOutputStreamNew(output); + return new DerOutputStream(output); } else { @@ -26,13 +28,12 @@ namespace Org.BouncyCastle.Asn1 } } - [Obsolete("Use static Create method(s)")] - public Asn1OutputStream(Stream os) + internal Asn1OutputStream(Stream os) : base(os) { } - public override void WriteObject(Asn1Encodable asn1Encodable) + public virtual void WriteObject(Asn1Encodable asn1Encodable) { if (null == asn1Encodable) throw new ArgumentNullException("asn1Encodable"); @@ -41,7 +42,7 @@ namespace Org.BouncyCastle.Asn1 FlushInternal(); } - public override void WriteObject(Asn1Object asn1Object) + public virtual void WriteObject(Asn1Object asn1Object) { if (null == asn1Object) throw new ArgumentNullException("asn1Object"); diff --git a/crypto/src/asn1/Asn1TaggedObject.cs b/crypto/src/asn1/Asn1TaggedObject.cs index ce5e9e3f2..3bc339c83 100644 --- a/crypto/src/asn1/Asn1TaggedObject.cs +++ b/crypto/src/asn1/Asn1TaggedObject.cs @@ -159,12 +159,6 @@ namespace Org.BouncyCastle.Asn1 return this.tagClass == tagClass && this.tagNo == tagNo; } - [Obsolete("Will be removed. Replace with constant return value of 'false'")] - public bool IsEmpty() - { - return false; - } - /** * return whether or not the object may be explicitly tagged. * <p> diff --git a/crypto/src/asn1/Asn1Tags.cs b/crypto/src/asn1/Asn1Tags.cs index 670fb7d96..f962e4e86 100644 --- a/crypto/src/asn1/Asn1Tags.cs +++ b/crypto/src/asn1/Asn1Tags.cs @@ -41,8 +41,6 @@ namespace Org.BouncyCastle.Asn1 public const int Universal = 0x00; public const int Application = 0x40; - [Obsolete("Use 'ContextSpecific' instead")] - public const int Tagged = 0x80; public const int ContextSpecific = 0x80; public const int Private = 0xC0; diff --git a/crypto/src/asn1/BERTaggedObjectParser.cs b/crypto/src/asn1/BERTaggedObjectParser.cs index c87f6cf9a..8fee8977f 100644 --- a/crypto/src/asn1/BERTaggedObjectParser.cs +++ b/crypto/src/asn1/BERTaggedObjectParser.cs @@ -3,8 +3,7 @@ using System.IO; namespace Org.BouncyCastle.Asn1 { - [Obsolete("Will be made non-public. Test for and use only Asn1TaggedObjectParser.")] - public class BerTaggedObjectParser + internal class BerTaggedObjectParser : Asn1TaggedObjectParser { internal readonly int m_tagClass; diff --git a/crypto/src/asn1/BerApplicationSpecificParser.cs b/crypto/src/asn1/BerApplicationSpecificParser.cs index 75b7e7632..343dc5d68 100644 --- a/crypto/src/asn1/BerApplicationSpecificParser.cs +++ b/crypto/src/asn1/BerApplicationSpecificParser.cs @@ -2,7 +2,7 @@ using System; namespace Org.BouncyCastle.Asn1 { - public class BerApplicationSpecificParser + internal class BerApplicationSpecificParser : BerTaggedObjectParser, IAsn1ApplicationSpecificParser { internal BerApplicationSpecificParser(int tagNo, Asn1StreamParser parser) diff --git a/crypto/src/asn1/BerNull.cs b/crypto/src/asn1/BerNull.cs deleted file mode 100644 index 90067d4cd..000000000 --- a/crypto/src/asn1/BerNull.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Asn1 -{ - /** - * A BER Null object. - */ - [Obsolete("Use 'DerNull' instead")] - public class BerNull - : DerNull - { - [Obsolete("Use 'DerNull.Instance' instead")] - public static new readonly BerNull Instance = new BerNull(); - - private BerNull() - : base() - { - } - } -} diff --git a/crypto/src/asn1/BerOctetString.cs b/crypto/src/asn1/BerOctetString.cs index 8e51f8bca..2ee508b34 100644 --- a/crypto/src/asn1/BerOctetString.cs +++ b/crypto/src/asn1/BerOctetString.cs @@ -70,12 +70,6 @@ namespace Org.BouncyCastle.Asn1 private readonly int segmentLimit; private readonly Asn1OctetString[] elements; - [Obsolete("Will be removed")] - public BerOctetString(IEnumerable e) - : this(ToOctetStringArray(e)) - { - } - public BerOctetString(byte[] contents) : this(contents, DefaultSegmentLimit) { @@ -114,12 +108,6 @@ namespace Org.BouncyCastle.Asn1 return elements.GetEnumerator(); } - [Obsolete("Use GetEnumerator() instead")] - public IEnumerator GetObjects() - { - return GetEnumerator(); - } - internal override IAsn1Encoding GetEncoding(int encoding) { if (Asn1OutputStream.EncodingBer != encoding) diff --git a/crypto/src/asn1/BerOutputStream.cs b/crypto/src/asn1/BerOutputStream.cs deleted file mode 100644 index 1486368e0..000000000 --- a/crypto/src/asn1/BerOutputStream.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.IO; - -namespace Org.BouncyCastle.Asn1 -{ - [Obsolete("Use 'Asn1OutputStream' instead")] - public class BerOutputStream - : DerOutputStream - { - [Obsolete("Use 'Asn1OutputStream.Create' instead")] - public BerOutputStream(Stream os) - : base(os) - { - } - - public override void WriteObject(Asn1Encodable encodable) - { - Asn1OutputStream.Create(s).WriteObject(encodable); - } - - public override void WriteObject(Asn1Object primitive) - { - Asn1OutputStream.Create(s).WriteObject(primitive); - } - } -} diff --git a/crypto/src/asn1/BerTaggedObject.cs b/crypto/src/asn1/BerTaggedObject.cs index e613d98d9..4970b76f9 100644 --- a/crypto/src/asn1/BerTaggedObject.cs +++ b/crypto/src/asn1/BerTaggedObject.cs @@ -11,16 +11,6 @@ namespace Org.BouncyCastle.Asn1 : DerTaggedObject { /** - * create an implicitly tagged object that contains a zero - * length sequence. - */ - [Obsolete("Will be removed")] - public BerTaggedObject(int tagNo) - : base(false, tagNo, BerSequence.Empty) - { - } - - /** * @param tagNo the tag number for this object. * @param obj the tagged object. */ diff --git a/crypto/src/asn1/DERExternal.cs b/crypto/src/asn1/DERExternal.cs index b8987d53e..cc3d2435f 100644 --- a/crypto/src/asn1/DERExternal.cs +++ b/crypto/src/asn1/DERExternal.cs @@ -100,13 +100,6 @@ namespace Org.BouncyCastle.Asn1 this.externalContent = GetExternalContent(obj); } - [Obsolete("Use constructor with dataValueDescriptor of type Asn1ObjectDescriptor")] - public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, - Asn1Object dataValueDescriptor, DerTaggedObject externalData) - : this(directReference, indirectReference, CheckDataValueDescriptor(dataValueDescriptor), externalData) - { - } - /** * Creates a new instance of DerExternal * See X.690 for more informations about the meaning of these parameters @@ -125,14 +118,6 @@ namespace Org.BouncyCastle.Asn1 this.externalContent = GetExternalContent(externalData); } - [Obsolete("Use constructor with dataValueDescriptor of type Asn1ObjectDescriptor")] - public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, - Asn1Object dataValueDescriptor, int encoding, Asn1Object externalData) - : this(directReference, indirectReference, CheckDataValueDescriptor(dataValueDescriptor), encoding, - externalData) - { - } - /** * Creates a new instance of DerExternal. * See X.690 for more informations about the meaning of these parameters diff --git a/crypto/src/asn1/DerOutputStream.cs b/crypto/src/asn1/DerOutputStream.cs index 4c7dd1fd7..6304ca852 100644 --- a/crypto/src/asn1/DerOutputStream.cs +++ b/crypto/src/asn1/DerOutputStream.cs @@ -1,35 +1,12 @@ using System; using System.IO; -using Org.BouncyCastle.Utilities.IO; - namespace Org.BouncyCastle.Asn1 { - [Obsolete("Use 'Asn1OutputStream' instead")] - public class DerOutputStream - : FilterStream - { - [Obsolete("Use 'Asn1OutputStream.Create' instead")] - public DerOutputStream(Stream os) - : base(os) - { - } - - public virtual void WriteObject(Asn1Encodable encodable) - { - Asn1OutputStream.Create(s, Asn1Encodable.Der).WriteObject(encodable); - } - - public virtual void WriteObject(Asn1Object primitive) - { - Asn1OutputStream.Create(s, Asn1Encodable.Der).WriteObject(primitive); - } - } - - internal class DerOutputStreamNew + internal class DerOutputStream : Asn1OutputStream { - internal DerOutputStreamNew(Stream os) + internal DerOutputStream(Stream os) : base(os) { } diff --git a/crypto/src/asn1/DerTaggedObject.cs b/crypto/src/asn1/DerTaggedObject.cs index 68a32e435..9d9997dc6 100644 --- a/crypto/src/asn1/DerTaggedObject.cs +++ b/crypto/src/asn1/DerTaggedObject.cs @@ -10,16 +10,6 @@ namespace Org.BouncyCastle.Asn1 public class DerTaggedObject : Asn1TaggedObject { - /** - * create an implicitly tagged object that contains a zero - * length sequence. - */ - [Obsolete("Will be removed")] - public DerTaggedObject(int tagNo) - : base(false, tagNo, DerSequence.Empty) - { - } - public DerTaggedObject(int tagNo, Asn1Encodable obj) : base(true, tagNo, obj) { diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs index cb3f13353..3b4b247bd 100644 --- a/crypto/src/asn1/DerUTCTime.cs +++ b/crypto/src/asn1/DerUTCTime.cs @@ -223,12 +223,6 @@ namespace Org.BouncyCastle.Asn1 } } - [Obsolete("Use 'AdjustedTimeString' property instead")] - public string AdjustedTime - { - get { return AdjustedTimeString; } - } - /// <summary> /// Return a time string as an adjusted date with a 4 digit year. /// This goes in the range of 1950 - 2049. diff --git a/crypto/src/asn1/cmp/PKIFreeText.cs b/crypto/src/asn1/cmp/PKIFreeText.cs index fef525465..006930320 100644 --- a/crypto/src/asn1/cmp/PKIFreeText.cs +++ b/crypto/src/asn1/cmp/PKIFreeText.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using Org.BouncyCastle.Utilities; @@ -52,17 +51,6 @@ namespace Org.BouncyCastle.Asn1.Cmp strings = new DerSequence(p); } - /** - * Return the number of string elements present. - * - * @return number of elements present. - */ - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return strings.Count; } - } - public int Count { get { return strings.Count; } @@ -79,13 +67,6 @@ namespace Org.BouncyCastle.Asn1.Cmp get { return (DerUtf8String) strings[index]; } } - [Obsolete("Use 'object[index]' syntax instead")] - public DerUtf8String GetStringAt( - int index) - { - return this[index]; - } - /** * <pre> * PkiFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String diff --git a/crypto/src/asn1/cms/AttributeTable.cs b/crypto/src/asn1/cms/AttributeTable.cs index 8d357f1a6..e20e6e9b2 100644 --- a/crypto/src/asn1/cms/AttributeTable.cs +++ b/crypto/src/asn1/cms/AttributeTable.cs @@ -1,7 +1,6 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms @@ -10,15 +9,6 @@ namespace Org.BouncyCastle.Asn1.Cms { private readonly IDictionary attributes; -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public AttributeTable( - Hashtable attrs) - { - this.attributes = Platform.CreateHashtable(attrs); - } -#endif - public AttributeTable( IDictionary attrs) { @@ -105,13 +95,6 @@ namespace Org.BouncyCastle.Asn1.Cms } } - [Obsolete("Use 'object[oid]' syntax instead")] - public Attribute Get( - DerObjectIdentifier oid) - { - return this[oid]; - } - /** * Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be * empty if there are no attributes of the required type present. @@ -168,14 +151,6 @@ namespace Org.BouncyCastle.Asn1.Cms return Platform.CreateHashtable(attributes); } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete("Use 'ToDictionary' instead")] - public Hashtable ToHashtable() - { - return new Hashtable(attributes); - } -#endif - public Asn1EncodableVector ToAsn1EncodableVector() { Asn1EncodableVector v = new Asn1EncodableVector(); diff --git a/crypto/src/asn1/cms/EnvelopedData.cs b/crypto/src/asn1/cms/EnvelopedData.cs index 8897fe380..45e9c5c76 100644 --- a/crypto/src/asn1/cms/EnvelopedData.cs +++ b/crypto/src/asn1/cms/EnvelopedData.cs @@ -1,7 +1,4 @@ using System; -using System.Collections; - -using Org.BouncyCastle.Asn1; namespace Org.BouncyCastle.Asn1.Cms { @@ -40,9 +37,7 @@ namespace Org.BouncyCastle.Asn1.Cms this.unprotectedAttrs = Asn1Set.GetInstance(unprotectedAttrs); } - [Obsolete("Use 'GetInstance' instead")] - public EnvelopedData( - Asn1Sequence seq) + private EnvelopedData(Asn1Sequence seq) { int index = 0; diff --git a/crypto/src/asn1/cms/IssuerAndSerialNumber.cs b/crypto/src/asn1/cms/IssuerAndSerialNumber.cs index b509e7e19..8e31eb0e4 100644 --- a/crypto/src/asn1/cms/IssuerAndSerialNumber.cs +++ b/crypto/src/asn1/cms/IssuerAndSerialNumber.cs @@ -1,6 +1,5 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; @@ -22,9 +21,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new IssuerAndSerialNumber(Asn1Sequence.GetInstance(obj)); } - [Obsolete("Use GetInstance() instead")] - public IssuerAndSerialNumber( - Asn1Sequence seq) + private IssuerAndSerialNumber(Asn1Sequence seq) { this.name = X509Name.GetInstance(seq[0]); this.serialNumber = (DerInteger) seq[1]; diff --git a/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs b/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs index f197fe965..296cadf94 100644 --- a/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs +++ b/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs @@ -8,42 +8,24 @@ namespace Org.BouncyCastle.Asn1.Cms public class OriginatorIdentifierOrKey : Asn1Encodable, IAsn1Choice { - private Asn1Encodable id; + private readonly Asn1Encodable id; - public OriginatorIdentifierOrKey( - IssuerAndSerialNumber id) + public OriginatorIdentifierOrKey(IssuerAndSerialNumber id) { this.id = id; } - [Obsolete("Use version taking a 'SubjectKeyIdentifier'")] - public OriginatorIdentifierOrKey( - Asn1OctetString id) - : this(new SubjectKeyIdentifier(id)) - { - } - - public OriginatorIdentifierOrKey( - SubjectKeyIdentifier id) + public OriginatorIdentifierOrKey(SubjectKeyIdentifier id) { this.id = new DerTaggedObject(false, 0, id); } - public OriginatorIdentifierOrKey( - OriginatorPublicKey id) + public OriginatorIdentifierOrKey(OriginatorPublicKey id) { this.id = new DerTaggedObject(false, 1, id); } - [Obsolete("Use more specific version")] - public OriginatorIdentifierOrKey( - Asn1Object id) - { - this.id = id; - } - - private OriginatorIdentifierOrKey( - Asn1TaggedObject id) + private OriginatorIdentifierOrKey(Asn1TaggedObject id) { // TODO Add validation this.id = id; @@ -129,12 +111,6 @@ namespace Org.BouncyCastle.Asn1.Cms } } - [Obsolete("Use 'OriginatorPublicKey' property")] - public OriginatorPublicKey OriginatorKey - { - get { return OriginatorPublicKey; } - } - public OriginatorPublicKey OriginatorPublicKey { get diff --git a/crypto/src/asn1/cms/OriginatorPublicKey.cs b/crypto/src/asn1/cms/OriginatorPublicKey.cs index 9f29c6242..83db619ea 100644 --- a/crypto/src/asn1/cms/OriginatorPublicKey.cs +++ b/crypto/src/asn1/cms/OriginatorPublicKey.cs @@ -19,9 +19,7 @@ namespace Org.BouncyCastle.Asn1.Cms this.mPublicKey = new DerBitString(publicKey); } - [Obsolete("Use 'GetInstance' instead")] - public OriginatorPublicKey( - Asn1Sequence seq) + private OriginatorPublicKey(Asn1Sequence seq) { this.mAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); this.mPublicKey = DerBitString.GetInstance(seq[1]); diff --git a/crypto/src/asn1/cms/OtherRecipientInfo.cs b/crypto/src/asn1/cms/OtherRecipientInfo.cs index 80dd68e7c..eb5f6202e 100644 --- a/crypto/src/asn1/cms/OtherRecipientInfo.cs +++ b/crypto/src/asn1/cms/OtherRecipientInfo.cs @@ -16,9 +16,7 @@ namespace Org.BouncyCastle.Asn1.Cms this.oriValue = oriValue; } - [Obsolete("Use GetInstance() instead")] - public OtherRecipientInfo( - Asn1Sequence seq) + private OtherRecipientInfo(Asn1Sequence seq) { oriType = DerObjectIdentifier.GetInstance(seq[0]); oriValue = seq[1]; diff --git a/crypto/src/asn1/cms/SignerInfo.cs b/crypto/src/asn1/cms/SignerInfo.cs index 44d4dcfb2..82ed04082 100644 --- a/crypto/src/asn1/cms/SignerInfo.cs +++ b/crypto/src/asn1/cms/SignerInfo.cs @@ -63,9 +63,7 @@ namespace Org.BouncyCastle.Asn1.Cms this.unauthenticatedAttributes = Asn1Set.GetInstance(unauthenticatedAttributes); } - [Obsolete("Use 'GetInstance' instead")] - public SignerInfo( - Asn1Sequence seq) + private SignerInfo(Asn1Sequence seq) { IEnumerator e = seq.GetEnumerator(); diff --git a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs index c32025ef6..c6ea26204 100644 --- a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs +++ b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs @@ -49,9 +49,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro this.encryptionParamSet = encryptionParamSet; } - [Obsolete("Use 'GetInstance' instead")] - public Gost3410PublicKeyAlgParameters( - Asn1Sequence seq) + private Gost3410PublicKeyAlgParameters(Asn1Sequence seq) { this.publicKeyParamSet = (DerObjectIdentifier) seq[0]; this.digestParamSet = (DerObjectIdentifier) seq[1]; diff --git a/crypto/src/asn1/ess/OtherCertID.cs b/crypto/src/asn1/ess/OtherCertID.cs deleted file mode 100644 index 183055e56..000000000 --- a/crypto/src/asn1/ess/OtherCertID.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; - -using Org.BouncyCastle.Asn1.Oiw; -using Org.BouncyCastle.Asn1.X509; -using Org.BouncyCastle.Utilities; - -namespace Org.BouncyCastle.Asn1.Ess -{ - [Obsolete("Use version in Asn1.Esf instead")] - public class OtherCertID - : Asn1Encodable - { - private Asn1Encodable otherCertHash; - private IssuerSerial issuerSerial; - - public static OtherCertID GetInstance( - object o) - { - if (o == null || o is OtherCertID) - { - return (OtherCertID) o; - } - - if (o is Asn1Sequence) - { - return new OtherCertID((Asn1Sequence) o); - } - - throw new ArgumentException( - "unknown object in 'OtherCertID' factory : " - + Platform.GetTypeName(o) + "."); - } - - /** - * constructor - */ - public OtherCertID( - Asn1Sequence seq) - { - if (seq.Count < 1 || seq.Count > 2) - { - throw new ArgumentException("Bad sequence size: " + seq.Count); - } - - if (seq[0].ToAsn1Object() is Asn1OctetString) - { - otherCertHash = Asn1OctetString.GetInstance(seq[0]); - } - else - { - otherCertHash = DigestInfo.GetInstance(seq[0]); - } - - if (seq.Count > 1) - { - issuerSerial = IssuerSerial.GetInstance(Asn1Sequence.GetInstance(seq[1])); - } - } - - public OtherCertID( - AlgorithmIdentifier algId, - byte[] digest) - { - this.otherCertHash = new DigestInfo(algId, digest); - } - - public OtherCertID( - AlgorithmIdentifier algId, - byte[] digest, - IssuerSerial issuerSerial) - { - this.otherCertHash = new DigestInfo(algId, digest); - this.issuerSerial = issuerSerial; - } - - public AlgorithmIdentifier AlgorithmHash - { - get - { - if (otherCertHash.ToAsn1Object() is Asn1OctetString) - { - // SHA-1 - return new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1); - } - - return DigestInfo.GetInstance(otherCertHash).AlgorithmID; - } - } - - public byte[] GetCertHash() - { - if (otherCertHash.ToAsn1Object() is Asn1OctetString) - { - // SHA-1 - return ((Asn1OctetString) otherCertHash.ToAsn1Object()).GetOctets(); - } - - return DigestInfo.GetInstance(otherCertHash).GetDigest(); - } - - public IssuerSerial IssuerSerial - { - get { return issuerSerial; } - } - - /** - * <pre> - * OtherCertID ::= SEQUENCE { - * otherCertHash OtherHash, - * issuerSerial IssuerSerial OPTIONAL } - * - * OtherHash ::= CHOICE { - * sha1Hash OCTET STRING, - * otherHash OtherHashAlgAndValue } - * - * OtherHashAlgAndValue ::= SEQUENCE { - * hashAlgorithm AlgorithmIdentifier, - * hashValue OCTET STRING } - * - * </pre> - */ - public override Asn1Object ToAsn1Object() - { - Asn1EncodableVector v = new Asn1EncodableVector(otherCertHash); - v.AddOptional(issuerSerial); - return new DerSequence(v); - } - } -} diff --git a/crypto/src/asn1/ess/OtherSigningCertificate.cs b/crypto/src/asn1/ess/OtherSigningCertificate.cs deleted file mode 100644 index 65152b675..000000000 --- a/crypto/src/asn1/ess/OtherSigningCertificate.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; - -using Org.BouncyCastle.Asn1.X509; -using Org.BouncyCastle.Utilities; - -namespace Org.BouncyCastle.Asn1.Ess -{ - [Obsolete("Use version in Asn1.Esf instead")] - public class OtherSigningCertificate - : Asn1Encodable - { - private Asn1Sequence certs, policies; - - public static OtherSigningCertificate GetInstance( - object o) - { - if (o == null || o is OtherSigningCertificate) - { - return (OtherSigningCertificate) o; - } - - if (o is Asn1Sequence) - { - return new OtherSigningCertificate((Asn1Sequence) o); - } - - throw new ArgumentException( - "unknown object in 'OtherSigningCertificate' factory : " - + Platform.GetTypeName(o) + "."); - } - - /** - * constructors - */ - public OtherSigningCertificate( - Asn1Sequence seq) - { - if (seq.Count < 1 || seq.Count > 2) - { - throw new ArgumentException("Bad sequence size: " + seq.Count); - } - - this.certs = Asn1Sequence.GetInstance(seq[0]); - - if (seq.Count > 1) - { - this.policies = Asn1Sequence.GetInstance(seq[1]); - } - } - - public OtherSigningCertificate( - OtherCertID otherCertID) - { - certs = new DerSequence(otherCertID); - } - - public OtherCertID[] GetCerts() - { - OtherCertID[] cs = new OtherCertID[certs.Count]; - - for (int i = 0; i != certs.Count; ++i) - { - cs[i] = OtherCertID.GetInstance(certs[i]); - } - - return cs; - } - - public PolicyInformation[] GetPolicies() - { - if (policies == null) - { - return null; - } - - PolicyInformation[] ps = new PolicyInformation[policies.Count]; - - for (int i = 0; i != policies.Count; i++) - { - ps[i] = PolicyInformation.GetInstance(policies[i]); - } - - return ps; - } - - /** - * The definition of OtherSigningCertificate is - * <pre> - * OtherSigningCertificate ::= SEQUENCE { - * certs SEQUENCE OF OtherCertID, - * policies SEQUENCE OF PolicyInformation OPTIONAL - * } - * </pre> - * id-aa-ets-otherSigCert OBJECT IDENTIFIER ::= { iso(1) - * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) - * smime(16) id-aa(2) 19 } - */ - public override Asn1Object ToAsn1Object() - { - Asn1EncodableVector v = new Asn1EncodableVector(certs); - v.AddOptional(policies); - return new DerSequence(v); - } - } -} diff --git a/crypto/src/asn1/ocsp/BasicOCSPResponse.cs b/crypto/src/asn1/ocsp/BasicOCSPResponse.cs index 45dadba4f..2637d36bc 100644 --- a/crypto/src/asn1/ocsp/BasicOCSPResponse.cs +++ b/crypto/src/asn1/ocsp/BasicOCSPResponse.cs @@ -62,34 +62,16 @@ namespace Org.BouncyCastle.Asn1.Ocsp } } - [Obsolete("Use TbsResponseData property instead")] - public ResponseData GetTbsResponseData() - { - return tbsResponseData; - } - public ResponseData TbsResponseData { get { return tbsResponseData; } } - [Obsolete("Use SignatureAlgorithm property instead")] - public AlgorithmIdentifier GetSignatureAlgorithm() - { - return signatureAlgorithm; - } - public AlgorithmIdentifier SignatureAlgorithm { get { return signatureAlgorithm; } } - [Obsolete("Use Signature property instead")] - public DerBitString GetSignature() - { - return signature; - } - public DerBitString Signature { get { return signature; } @@ -100,12 +82,6 @@ namespace Org.BouncyCastle.Asn1.Ocsp return signature.GetOctets(); } - [Obsolete("Use Certs property instead")] - public Asn1Sequence GetCerts() - { - return certs; - } - public Asn1Sequence Certs { get { return certs; } diff --git a/crypto/src/asn1/pkcs/CertificationRequest.cs b/crypto/src/asn1/pkcs/CertificationRequest.cs index 98caa2268..8c4248d36 100644 --- a/crypto/src/asn1/pkcs/CertificationRequest.cs +++ b/crypto/src/asn1/pkcs/CertificationRequest.cs @@ -24,13 +24,11 @@ namespace Org.BouncyCastle.Asn1.Pkcs public static CertificationRequest GetInstance( object obj) { - if (obj is CertificationRequest) + if (obj == null) + return null; + if (obj is CertificationRequest) return (CertificationRequest)obj; - - if (obj != null) - return new CertificationRequest((Asn1Sequence)obj); - - return null; + return new CertificationRequest(Asn1Sequence.GetInstance(obj)); } protected CertificationRequest() @@ -47,9 +45,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs this.sigBits = signature; } - [Obsolete("Use 'GetInstance' instead")] - public CertificationRequest( - Asn1Sequence seq) + internal CertificationRequest(Asn1Sequence seq) { if (seq.Count != 3) throw new ArgumentException("Wrong number of elements in sequence", "seq"); diff --git a/crypto/src/asn1/pkcs/PBES2Parameters.cs b/crypto/src/asn1/pkcs/PBES2Parameters.cs index fc6904eed..66e4755c8 100644 --- a/crypto/src/asn1/pkcs/PBES2Parameters.cs +++ b/crypto/src/asn1/pkcs/PBES2Parameters.cs @@ -24,9 +24,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs this.scheme = encScheme; } - [Obsolete("Use GetInstance() instead")] - public PbeS2Parameters( - Asn1Sequence seq) + private PbeS2Parameters(Asn1Sequence seq) { if (seq.Count != 2) throw new ArgumentException("Wrong number of elements in sequence", "seq"); diff --git a/crypto/src/asn1/pkcs/PKCSObjectIdentifiers.cs b/crypto/src/asn1/pkcs/PKCSObjectIdentifiers.cs index 6c7fed442..8b74e8099 100644 --- a/crypto/src/asn1/pkcs/PKCSObjectIdentifiers.cs +++ b/crypto/src/asn1/pkcs/PKCSObjectIdentifiers.cs @@ -129,9 +129,6 @@ namespace Org.BouncyCastle.Asn1.Pkcs public static readonly DerObjectIdentifier Pkcs9AtFriendlyName = new DerObjectIdentifier(Pkcs9 + ".20"); public static readonly DerObjectIdentifier Pkcs9AtLocalKeyID = new DerObjectIdentifier(Pkcs9 + ".21"); - [Obsolete("Use X509Certificate instead")] - public static readonly DerObjectIdentifier X509CertType = new DerObjectIdentifier(Pkcs9 + ".22.1"); - public const string CertTypes = Pkcs9 + ".22"; public static readonly DerObjectIdentifier X509Certificate = new DerObjectIdentifier(CertTypes + ".1"); public static readonly DerObjectIdentifier SdsiCertificate = new DerObjectIdentifier(CertTypes + ".2"); @@ -261,15 +258,6 @@ namespace Org.BouncyCastle.Asn1.Pkcs /** PKCS#9: 1.2.840.113549.1.9.16.2.40 <a href="https://tools.ietf.org/html/rfc7030">RFC7030</a>*/ public static readonly DerObjectIdentifier IdAACommunityIdentifiers = IdAAOid.Branch("40"); - [Obsolete("Use 'IdAAEtsSigPolicyID' instead")] - public static readonly DerObjectIdentifier IdAASigPolicyID = IdAAEtsSigPolicyID; - [Obsolete("Use 'IdAAEtsCommitmentType' instead")] - public static readonly DerObjectIdentifier IdAACommitmentType = IdAAEtsCommitmentType; - [Obsolete("Use 'IdAAEtsSignerLocation' instead")] - public static readonly DerObjectIdentifier IdAASignerLocation = IdAAEtsSignerLocation; - [Obsolete("Use 'IdAAEtsOtherSigCert' instead")] - public static readonly DerObjectIdentifier IdAAOtherSigCert = IdAAEtsOtherSigCert; - // // id-spq OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-spq(5)} diff --git a/crypto/src/asn1/pkcs/RSAPrivateKeyStructure.cs b/crypto/src/asn1/pkcs/RSAPrivateKeyStructure.cs index 738a97eb4..119ee98de 100644 --- a/crypto/src/asn1/pkcs/RSAPrivateKeyStructure.cs +++ b/crypto/src/asn1/pkcs/RSAPrivateKeyStructure.cs @@ -52,9 +52,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs this.coefficient = coefficient; } - [Obsolete("Use 'GetInstance' method(s) instead")] - public RsaPrivateKeyStructure( - Asn1Sequence seq) + private RsaPrivateKeyStructure(Asn1Sequence seq) { BigInteger version = ((DerInteger)seq[0]).Value; if (version.IntValue != 0) diff --git a/crypto/src/asn1/sec/ECPrivateKeyStructure.cs b/crypto/src/asn1/sec/ECPrivateKeyStructure.cs index aec8e0af0..769ab2970 100644 --- a/crypto/src/asn1/sec/ECPrivateKeyStructure.cs +++ b/crypto/src/asn1/sec/ECPrivateKeyStructure.cs @@ -23,9 +23,7 @@ namespace Org.BouncyCastle.Asn1.Sec return new ECPrivateKeyStructure(Asn1Sequence.GetInstance(obj)); } - [Obsolete("Use 'GetInstance' instead")] - public ECPrivateKeyStructure( - Asn1Sequence seq) + private ECPrivateKeyStructure(Asn1Sequence seq) { if (seq == null) throw new ArgumentNullException("seq"); @@ -33,18 +31,6 @@ namespace Org.BouncyCastle.Asn1.Sec this.seq = seq; } - [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] - public ECPrivateKeyStructure( - BigInteger key) - { - if (key == null) - throw new ArgumentNullException("key"); - - this.seq = new DerSequence( - new DerInteger(1), - new DerOctetString(key.ToByteArrayUnsigned())); - } - public ECPrivateKeyStructure( int orderBitLength, BigInteger key) @@ -52,40 +38,6 @@ namespace Org.BouncyCastle.Asn1.Sec { } - [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] - public ECPrivateKeyStructure( - BigInteger key, - Asn1Encodable parameters) - : this(key, null, parameters) - { - } - - [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] - public ECPrivateKeyStructure( - BigInteger key, - DerBitString publicKey, - Asn1Encodable parameters) - { - if (key == null) - throw new ArgumentNullException("key"); - - Asn1EncodableVector v = new Asn1EncodableVector( - new DerInteger(1), - new DerOctetString(key.ToByteArrayUnsigned())); - - if (parameters != null) - { - v.Add(new DerTaggedObject(true, 0, parameters)); - } - - if (publicKey != null) - { - v.Add(new DerTaggedObject(true, 1, publicKey)); - } - - this.seq = new DerSequence(v); - } - public ECPrivateKeyStructure( int orderBitLength, BigInteger key, diff --git a/crypto/src/asn1/smime/SMIMECapabilities.cs b/crypto/src/asn1/smime/SMIMECapabilities.cs index 5bf48f321..0bfa05034 100644 --- a/crypto/src/asn1/smime/SMIMECapabilities.cs +++ b/crypto/src/asn1/smime/SMIMECapabilities.cs @@ -71,17 +71,6 @@ namespace Org.BouncyCastle.Asn1.Smime capabilities = seq; } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete("Use 'GetCapabilitiesForOid' instead")] - public ArrayList GetCapabilities( - DerObjectIdentifier capability) - { - ArrayList list = new ArrayList(); - DoGetCapabilitiesForOid(capability, list); - return list; - } -#endif - /** * returns an ArrayList with 0 or more objects of all the capabilities * matching the passed in capability Oid. If the Oid passed is null the diff --git a/crypto/src/asn1/util/FilterStream.cs b/crypto/src/asn1/util/FilterStream.cs deleted file mode 100644 index 0c38c5b6e..000000000 --- a/crypto/src/asn1/util/FilterStream.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.IO; - -using Org.BouncyCastle.Utilities; - -namespace Org.BouncyCastle.Asn1.Utilities -{ - [Obsolete("Use Org.BouncyCastle.Utilities.IO.FilterStream")] - public class FilterStream : Stream - { - [Obsolete("Use Org.BouncyCastle.Utilities.IO.FilterStream")] - public FilterStream(Stream s) - { - this.s = s; - } - public override bool CanRead - { - get { return s.CanRead; } - } - public override bool CanSeek - { - get { return s.CanSeek; } - } - public override bool CanWrite - { - get { return s.CanWrite; } - } - public override long Length - { - get { return s.Length; } - } - public override long Position - { - get { return s.Position; } - set { s.Position = value; } - } -#if PORTABLE - protected override void Dispose(bool disposing) - { - if (disposing) - { - Platform.Dispose(s); - } - base.Dispose(disposing); - } -#else - public override void Close() - { - Platform.Dispose(s); - base.Close(); - } -#endif - public override void Flush() - { - s.Flush(); - } - public override long Seek(long offset, SeekOrigin origin) - { - return s.Seek(offset, origin); - } - public override void SetLength(long value) - { - s.SetLength(value); - } - public override int Read(byte[] buffer, int offset, int count) - { - return s.Read(buffer, offset, count); - } - public override int ReadByte() - { - return s.ReadByte(); - } - public override void Write(byte[] buffer, int offset, int count) - { - s.Write(buffer, offset, count); - } - public override void WriteByte(byte value) - { - s.WriteByte(value); - } - protected readonly Stream s; - } -} diff --git a/crypto/src/asn1/x509/AlgorithmIdentifier.cs b/crypto/src/asn1/x509/AlgorithmIdentifier.cs index 00e7ad8bc..169a95c0a 100644 --- a/crypto/src/asn1/x509/AlgorithmIdentifier.cs +++ b/crypto/src/asn1/x509/AlgorithmIdentifier.cs @@ -31,13 +31,6 @@ namespace Org.BouncyCastle.Asn1.X509 this.algorithm = algorithm; } - [Obsolete("Use version taking a DerObjectIdentifier")] - public AlgorithmIdentifier( - string algorithm) - { - this.algorithm = new DerObjectIdentifier(algorithm); - } - public AlgorithmIdentifier( DerObjectIdentifier algorithm, Asn1Encodable parameters) @@ -64,12 +57,6 @@ namespace Org.BouncyCastle.Asn1.X509 get { return algorithm; } } - [Obsolete("Use 'Algorithm' property instead")] - public virtual DerObjectIdentifier ObjectID - { - get { return algorithm; } - } - /// <summary> /// Return the parameters structure in the Parameters entry of this identifier. /// </summary> diff --git a/crypto/src/asn1/x509/AttributeTable.cs b/crypto/src/asn1/x509/AttributeTable.cs index 33faad64a..71c42872e 100644 --- a/crypto/src/asn1/x509/AttributeTable.cs +++ b/crypto/src/asn1/x509/AttributeTable.cs @@ -1,7 +1,6 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 @@ -16,15 +15,6 @@ namespace Org.BouncyCastle.Asn1.X509 this.attributes = Platform.CreateHashtable(attrs); } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public AttributeTable( - Hashtable attrs) - { - this.attributes = Platform.CreateHashtable(attrs); - } -#endif - public AttributeTable( Asn1EncodableVector v) { @@ -57,14 +47,6 @@ namespace Org.BouncyCastle.Asn1.X509 return (AttributeX509) attributes[oid]; } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete("Use 'ToDictionary' instead")] - public Hashtable ToHashtable() - { - return new Hashtable(attributes); - } -#endif - public IDictionary ToDictionary() { return Platform.CreateHashtable(attributes); diff --git a/crypto/src/asn1/x509/ExtendedKeyUsage.cs b/crypto/src/asn1/x509/ExtendedKeyUsage.cs index 7e8c7a37c..1e7d4d642 100644 --- a/crypto/src/asn1/x509/ExtendedKeyUsage.cs +++ b/crypto/src/asn1/x509/ExtendedKeyUsage.cs @@ -65,15 +65,6 @@ namespace Org.BouncyCastle.Asn1.X509 } } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public ExtendedKeyUsage( - ArrayList usages) - : this((IEnumerable)usages) - { - } -#endif - public ExtendedKeyUsage( IEnumerable usages) { @@ -96,14 +87,6 @@ namespace Org.BouncyCastle.Asn1.X509 return usageTable.Contains(keyPurposeId); } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete("Use 'GetAllUsages'")] - public ArrayList GetUsages() - { - return new ArrayList(usageTable.Values); - } -#endif - /** * Returns all extended key usages. * The returned ArrayList contains DerObjectIdentifier instances. diff --git a/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs b/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs index 77923e0d2..00db90042 100644 --- a/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs +++ b/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs @@ -78,15 +78,6 @@ namespace Org.BouncyCastle.Asn1.X509 } } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public SubjectDirectoryAttributes( - ArrayList attributes) - : this((IList)attributes) - { - } -#endif - /** * Constructor from an ArrayList of attributes. * diff --git a/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs b/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs index ae44a451f..474493dcf 100644 --- a/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs +++ b/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs @@ -79,19 +79,6 @@ namespace Org.BouncyCastle.Asn1.X509 } /** - * for when the public key is an encoded object - if the bitstring - * can't be decoded this routine raises an IOException. - * - * @exception IOException - if the bit string doesn't represent a Der - * encoded object. - */ - [Obsolete("Use 'ParsePublicKey' instead")] - public Asn1Object GetPublicKey() - { - return Asn1Object.FromByteArray(keyData.GetOctets()); - } - - /** * for when the public key is raw bits... */ public DerBitString PublicKeyData diff --git a/crypto/src/asn1/x509/X509Extensions.cs b/crypto/src/asn1/x509/X509Extensions.cs index 42121fa60..b01db1fb5 100644 --- a/crypto/src/asn1/x509/X509Extensions.cs +++ b/crypto/src/asn1/x509/X509Extensions.cs @@ -296,71 +296,6 @@ namespace Org.BouncyCastle.Asn1.X509 } } -#if !(SILVERLIGHT || PORTABLE) - /** - * constructor from a table of extensions. - * <p> - * it's is assumed the table contains Oid/string pairs.</p> - */ - [Obsolete] - public X509Extensions( - Hashtable extensions) - : this(null, extensions) - { - } - - /** - * Constructor from a table of extensions with ordering. - * <p> - * It's is assumed the table contains Oid/string pairs.</p> - */ - [Obsolete] - public X509Extensions( - ArrayList ordering, - Hashtable extensions) - { - if (ordering == null) - { - this.ordering = Platform.CreateArrayList(extensions.Keys); - } - else - { - this.ordering = Platform.CreateArrayList(ordering); - } - - foreach (DerObjectIdentifier oid in this.ordering) - { - this.extensions.Add(oid, (X509Extension) extensions[oid]); - } - } - - /** - * Constructor from two vectors - * - * @param objectIDs an ArrayList of the object identifiers. - * @param values an ArrayList of the extension values. - */ - [Obsolete] - public X509Extensions( - ArrayList oids, - ArrayList values) - { - this.ordering = Platform.CreateArrayList(oids); - - int count = 0; - foreach (DerObjectIdentifier oid in this.ordering) - { - this.extensions.Add(oid, (X509Extension) values[count++]); - } - } -#endif - - [Obsolete("Use ExtensionOids IEnumerable property")] - public IEnumerator Oids() - { - return ExtensionOids.GetEnumerator(); - } - /** * return an Enumeration of the extension field's object ids. */ diff --git a/crypto/src/asn1/x9/X962Parameters.cs b/crypto/src/asn1/x9/X962Parameters.cs index 5bdabc647..b863f4bfd 100644 --- a/crypto/src/asn1/x9/X962Parameters.cs +++ b/crypto/src/asn1/x9/X962Parameters.cs @@ -55,9 +55,7 @@ namespace Org.BouncyCastle.Asn1.X9 this._params = obj; } - [Obsolete("Use 'GetInstance' instead")] - public X962Parameters( - Asn1Object obj) + private X962Parameters(Asn1Object obj) { this._params = obj; } diff --git a/crypto/src/asn1/x9/X9Curve.cs b/crypto/src/asn1/x9/X9Curve.cs index 0be9bf935..88198335f 100644 --- a/crypto/src/asn1/x9/X9Curve.cs +++ b/crypto/src/asn1/x9/X9Curve.cs @@ -47,14 +47,6 @@ namespace Org.BouncyCastle.Asn1.X9 } } - [Obsolete("Use constructor including order/cofactor")] - public X9Curve( - X9FieldID fieldID, - Asn1Sequence seq) - : this(fieldID, null, null, seq) - { - } - public X9Curve( X9FieldID fieldID, BigInteger order, diff --git a/crypto/src/asn1/x9/X9FieldElement.cs b/crypto/src/asn1/x9/X9FieldElement.cs index 222b4cfc8..1143bf757 100644 --- a/crypto/src/asn1/x9/X9FieldElement.cs +++ b/crypto/src/asn1/x9/X9FieldElement.cs @@ -19,25 +19,6 @@ namespace Org.BouncyCastle.Asn1.X9 this.f = f; } - [Obsolete("Will be removed")] - public X9FieldElement( - BigInteger p, - Asn1OctetString s) - : this(new FpFieldElement(p, new BigInteger(1, s.GetOctets()))) - { - } - - [Obsolete("Will be removed")] - public X9FieldElement( - int m, - int k1, - int k2, - int k3, - Asn1OctetString s) - : this(new F2mFieldElement(m, k1, k2, k3, new BigInteger(1, s.GetOctets()))) - { - } - public ECFieldElement Value { get { return f; } diff --git a/crypto/src/asn1/x9/X9ObjectIdentifiers.cs b/crypto/src/asn1/x9/X9ObjectIdentifiers.cs index 9d7ecae6e..11b94e8d6 100644 --- a/crypto/src/asn1/x9/X9ObjectIdentifiers.cs +++ b/crypto/src/asn1/x9/X9ObjectIdentifiers.cs @@ -11,9 +11,7 @@ namespace Org.BouncyCastle.Asn1.X9 // us(840) ansi-x962(10045) } // - internal const string AnsiX962 = "1.2.840.10045"; - - public static readonly DerObjectIdentifier ansi_X9_62 = new DerObjectIdentifier(AnsiX962); + public static readonly DerObjectIdentifier ansi_X9_62 = new DerObjectIdentifier("1.2.840.10045"); public static readonly DerObjectIdentifier IdFieldType = ansi_X9_62.Branch("1"); @@ -24,14 +22,10 @@ namespace Org.BouncyCastle.Asn1.X9 public static readonly DerObjectIdentifier TPBasis = CharacteristicTwoField.Branch("3.2"); public static readonly DerObjectIdentifier PPBasis = CharacteristicTwoField.Branch("3.3"); - [Obsolete("Use 'id_ecSigType' instead")] - public const string IdECSigType = AnsiX962 + ".4"; public static readonly DerObjectIdentifier id_ecSigType = ansi_X9_62.Branch("4"); public static readonly DerObjectIdentifier ECDsaWithSha1 = id_ecSigType.Branch("1"); - [Obsolete("Use 'id_publicKeyType' instead")] - public const string IdPublicKeyType = AnsiX962 + ".2"; public static readonly DerObjectIdentifier id_publicKeyType = ansi_X9_62.Branch("2"); public static readonly DerObjectIdentifier IdECPublicKey = id_publicKeyType.Branch("1"); diff --git a/crypto/src/bcpg/Crc24.cs b/crypto/src/bcpg/Crc24.cs index 97846f4fb..5521bbb64 100644 --- a/crypto/src/bcpg/Crc24.cs +++ b/crypto/src/bcpg/Crc24.cs @@ -27,12 +27,6 @@ namespace Org.BouncyCastle.Bcpg } } - [Obsolete("Use 'Value' property instead")] - public int GetValue() - { - return crc; - } - public int Value { get { return crc; } diff --git a/crypto/src/bcpg/PublicKeyAlgorithmTags.cs b/crypto/src/bcpg/PublicKeyAlgorithmTags.cs index 7c93964f2..1dd041a5f 100644 --- a/crypto/src/bcpg/PublicKeyAlgorithmTags.cs +++ b/crypto/src/bcpg/PublicKeyAlgorithmTags.cs @@ -10,8 +10,6 @@ namespace Org.BouncyCastle.Bcpg RsaSign = 3, // RSA Sign-Only ElGamalEncrypt = 16, // Elgamal (Encrypt-Only), see [ELGAMAL] Dsa = 17, // DSA (Digital Signature Standard) - [Obsolete("Use 'ECDH' instead")] - EC = 18, // Reserved for Elliptic Curve ECDH = 18, // Reserved for Elliptic Curve (actual algorithm name) ECDsa = 19, // Reserved for ECDSA ElGamalGeneral = 20, // Elgamal (Encrypt or Sign) diff --git a/crypto/src/bcpg/S2k.cs b/crypto/src/bcpg/S2k.cs index 33fd792fe..8446fd1ec 100644 --- a/crypto/src/bcpg/S2k.cs +++ b/crypto/src/bcpg/S2k.cs @@ -101,12 +101,6 @@ namespace Org.BouncyCastle.Bcpg return Arrays.Clone(iv); } - [Obsolete("Use 'IterationCount' property instead")] - public long GetIterationCount() - { - return IterationCount; - } - /// <summary>The iteration count</summary> public virtual long IterationCount { diff --git a/crypto/src/cms/CMSPBEKey.cs b/crypto/src/cms/CMSPBEKey.cs index e03307e57..78360c2cd 100644 --- a/crypto/src/cms/CMSPBEKey.cs +++ b/crypto/src/cms/CMSPBEKey.cs @@ -19,23 +19,6 @@ namespace Org.BouncyCastle.Cms internal readonly byte[] salt; internal readonly int iterationCount; - [Obsolete("Use version taking 'char[]' instead")] - public CmsPbeKey( - string password, - byte[] salt, - int iterationCount) - : this(password.ToCharArray(), salt, iterationCount) - { - } - - [Obsolete("Use version taking 'char[]' instead")] - public CmsPbeKey( - string password, - AlgorithmIdentifier keyDerivationAlgorithm) - : this(password.ToCharArray(), keyDerivationAlgorithm) - { - } - public CmsPbeKey( char[] password, byte[] salt, @@ -67,23 +50,11 @@ namespace Org.BouncyCastle.Cms Array.Clear(this.password, 0, this.password.Length); } - [Obsolete("Will be removed")] - public string Password - { - get { return new string(password); } - } - public byte[] Salt { get { return Arrays.Clone(salt); } } - [Obsolete("Use 'Salt' property instead")] - public byte[] GetSalt() - { - return Salt; - } - public int IterationCount { get { return iterationCount; } diff --git a/crypto/src/cms/CMSProcessable.cs b/crypto/src/cms/CMSProcessable.cs index 41018d12b..4aadfa131 100644 --- a/crypto/src/cms/CMSProcessable.cs +++ b/crypto/src/cms/CMSProcessable.cs @@ -12,8 +12,5 @@ namespace Org.BouncyCastle.Cms /// This routine may be called multiple times. /// </remarks> void Write(Stream outStream); - - [Obsolete] - object GetContent(); } } diff --git a/crypto/src/cms/CMSProcessableByteArray.cs b/crypto/src/cms/CMSProcessableByteArray.cs index b09935dd8..c0dd661f2 100644 --- a/crypto/src/cms/CMSProcessableByteArray.cs +++ b/crypto/src/cms/CMSProcessableByteArray.cs @@ -40,12 +40,5 @@ namespace Org.BouncyCastle.Cms { zOut.Write(bytes, 0, bytes.Length); } - - /// <returns>A clone of the byte array</returns> - [Obsolete] - public virtual object GetContent() - { - return bytes.Clone(); - } } } diff --git a/crypto/src/cms/CMSProcessableFile.cs b/crypto/src/cms/CMSProcessableFile.cs index 486df1960..9444f885d 100644 --- a/crypto/src/cms/CMSProcessableFile.cs +++ b/crypto/src/cms/CMSProcessableFile.cs @@ -40,13 +40,6 @@ namespace Org.BouncyCastle.Cms Streams.PipeAll(inStr, zOut, _bufSize); Platform.Dispose(inStr); } - - /// <returns>The file handle</returns> - [Obsolete] - public virtual object GetContent() - { - return _file; - } } } #endif diff --git a/crypto/src/cms/CMSProcessableInputStream.cs b/crypto/src/cms/CMSProcessableInputStream.cs index b2abd6f71..8fb3adbff 100644 --- a/crypto/src/cms/CMSProcessableInputStream.cs +++ b/crypto/src/cms/CMSProcessableInputStream.cs @@ -33,12 +33,6 @@ namespace Org.BouncyCastle.Cms Platform.Dispose(input); } - [Obsolete] - public virtual object GetContent() - { - return GetInputStream(); - } - protected virtual void CheckSingleUsage() { lock (this) diff --git a/crypto/src/cms/CMSSignedData.cs b/crypto/src/cms/CMSSignedData.cs index 6028de709..d43cdc4f3 100644 --- a/crypto/src/cms/CMSSignedData.cs +++ b/crypto/src/cms/CMSSignedData.cs @@ -249,12 +249,6 @@ namespace Org.BouncyCastle.Cms return crlStore; } - [Obsolete("Use 'SignedContentType' property instead.")] - public string SignedContentTypeOid - { - get { return signedData.EncapContentInfo.ContentType.Id; } - } - /// <summary> /// Return the <c>DerObjectIdentifier</c> associated with the encapsulated /// content info structure carried in the signed data. diff --git a/crypto/src/cms/PKCS5Scheme2PBEKey.cs b/crypto/src/cms/PKCS5Scheme2PBEKey.cs index 08b8518a1..6606d5c45 100644 --- a/crypto/src/cms/PKCS5Scheme2PBEKey.cs +++ b/crypto/src/cms/PKCS5Scheme2PBEKey.cs @@ -14,23 +14,6 @@ namespace Org.BouncyCastle.Cms public class Pkcs5Scheme2PbeKey : CmsPbeKey { - [Obsolete("Use version taking 'char[]' instead")] - public Pkcs5Scheme2PbeKey( - string password, - byte[] salt, - int iterationCount) - : this(password.ToCharArray(), salt, iterationCount) - { - } - - [Obsolete("Use version taking 'char[]' instead")] - public Pkcs5Scheme2PbeKey( - string password, - AlgorithmIdentifier keyDerivationAlgorithm) - : this(password.ToCharArray(), keyDerivationAlgorithm) - { - } - public Pkcs5Scheme2PbeKey( char[] password, byte[] salt, diff --git a/crypto/src/cms/PKCS5Scheme2UTF8PBEKey.cs b/crypto/src/cms/PKCS5Scheme2UTF8PBEKey.cs index 7aecc2978..e2a09b760 100644 --- a/crypto/src/cms/PKCS5Scheme2UTF8PBEKey.cs +++ b/crypto/src/cms/PKCS5Scheme2UTF8PBEKey.cs @@ -14,23 +14,6 @@ namespace Org.BouncyCastle.Cms public class Pkcs5Scheme2Utf8PbeKey : CmsPbeKey { - [Obsolete("Use version taking 'char[]' instead")] - public Pkcs5Scheme2Utf8PbeKey( - string password, - byte[] salt, - int iterationCount) - : this(password.ToCharArray(), salt, iterationCount) - { - } - - [Obsolete("Use version taking 'char[]' instead")] - public Pkcs5Scheme2Utf8PbeKey( - string password, - AlgorithmIdentifier keyDerivationAlgorithm) - : this(password.ToCharArray(), keyDerivationAlgorithm) - { - } - public Pkcs5Scheme2Utf8PbeKey( char[] password, byte[] salt, diff --git a/crypto/src/crypto/PbeParametersGenerator.cs b/crypto/src/crypto/PbeParametersGenerator.cs index 97d23df90..d317fe9bb 100644 --- a/crypto/src/crypto/PbeParametersGenerator.cs +++ b/crypto/src/crypto/PbeParametersGenerator.cs @@ -49,34 +49,12 @@ namespace Org.BouncyCastle.Crypto get { return Arrays.Clone(mPassword); } } - /** - * return the password byte array. - * - * @return the password byte array. - */ - [Obsolete("Use 'Password' property")] - public byte[] GetPassword() - { - return Password; - } - public virtual byte[] Salt { get { return Arrays.Clone(mSalt); } } /** - * return the salt byte array. - * - * @return the salt byte array. - */ - [Obsolete("Use 'Salt' property")] - public byte[] GetSalt() - { - return Salt; - } - - /** * return the iteration count. * * @return the iteration count. @@ -133,16 +111,6 @@ namespace Org.BouncyCastle.Crypto return Strings.ToByteArray(password); } - [Obsolete("Use version taking 'char[]' instead")] - public static byte[] Pkcs5PasswordToBytes( - string password) - { - if (password == null) - return new byte[0]; - - return Strings.ToByteArray(password); - } - /** * converts a password to a byte array according to the scheme in * PKCS5 (UTF-8, no padding) @@ -159,16 +127,6 @@ namespace Org.BouncyCastle.Crypto return Encoding.UTF8.GetBytes(password); } - [Obsolete("Use version taking 'char[]' instead")] - public static byte[] Pkcs5PasswordToUtf8Bytes( - string password) - { - if (password == null) - return new byte[0]; - - return Encoding.UTF8.GetBytes(password); - } - /** * converts a password to a byte array according to the scheme in * Pkcs12 (unicode, big endian, 2 zero pad bytes at the end). diff --git a/crypto/src/crypto/engines/NaccacheSternEngine.cs b/crypto/src/crypto/engines/NaccacheSternEngine.cs index fe2d78da6..713ed9472 100644 --- a/crypto/src/crypto/engines/NaccacheSternEngine.cs +++ b/crypto/src/crypto/engines/NaccacheSternEngine.cs @@ -72,12 +72,6 @@ namespace Org.BouncyCastle.Crypto.Engines } } - [Obsolete("Remove: no longer used")] - public virtual bool Debug - { - set {} - } - /** * Returns the input block size of this algorithm. * diff --git a/crypto/src/crypto/engines/Salsa20Engine.cs b/crypto/src/crypto/engines/Salsa20Engine.cs index 056fc09eb..a8170d173 100644 --- a/crypto/src/crypto/engines/Salsa20Engine.cs +++ b/crypto/src/crypto/engines/Salsa20Engine.cs @@ -29,11 +29,6 @@ namespace Org.BouncyCastle.Crypto.Engines state[stateOffset + 3] = TAU_SIGMA[tsOff + 3]; } - [Obsolete] - protected readonly static byte[] - sigma = Strings.ToAsciiByteArray("expand 32-byte k"), - tau = Strings.ToAsciiByteArray("expand 16-byte k"); - protected int rounds; /* diff --git a/crypto/src/crypto/parameters/CcmParameters.cs b/crypto/src/crypto/parameters/CcmParameters.cs deleted file mode 100644 index d4459081c..000000000 --- a/crypto/src/crypto/parameters/CcmParameters.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Crypto.Parameters -{ - [Obsolete("Use AeadParameters")] - public class CcmParameters - : AeadParameters - { - /** - * Base constructor. - * - * @param key key to be used by underlying cipher - * @param macSize macSize in bits - * @param nonce nonce to be used - * @param associatedText associated text, if any - */ - public CcmParameters( - KeyParameter key, - int macSize, - byte[] nonce, - byte[] associatedText) - : base(key, macSize, nonce, associatedText) - { - } - } -} diff --git a/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs b/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs index 47e53ef2d..652249286 100644 --- a/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs +++ b/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs @@ -18,15 +18,6 @@ namespace Org.BouncyCastle.Crypto.Parameters { } - [Obsolete("Use version with explicit 'algorithm' parameter")] - public ECPrivateKeyParameters( - BigInteger d, - DerObjectIdentifier publicKeyParamSet) - : base("ECGOST3410", true, publicKeyParamSet) - { - this.d = Parameters.ValidatePrivateScalar(d); - } - public ECPrivateKeyParameters( string algorithm, BigInteger d, diff --git a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs index d43ac7e0e..64e0afea1 100644 --- a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs +++ b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs @@ -18,15 +18,6 @@ namespace Org.BouncyCastle.Crypto.Parameters { } - [Obsolete("Use version with explicit 'algorithm' parameter")] - public ECPublicKeyParameters( - ECPoint q, - DerObjectIdentifier publicKeyParamSet) - : base("ECGOST3410", false, publicKeyParamSet) - { - this.q = ECDomainParameters.ValidatePublicPoint(Parameters.Curve, q); - } - public ECPublicKeyParameters( string algorithm, ECPoint q, diff --git a/crypto/src/crypto/parameters/Ed25519PrivateKeyParameters.cs b/crypto/src/crypto/parameters/Ed25519PrivateKeyParameters.cs index 4e61a0f8d..56ca19ed2 100644 --- a/crypto/src/crypto/parameters/Ed25519PrivateKeyParameters.cs +++ b/crypto/src/crypto/parameters/Ed25519PrivateKeyParameters.cs @@ -67,13 +67,6 @@ namespace Org.BouncyCastle.Crypto.Parameters } } - [Obsolete("Use overload that doesn't take a public key")] - public void Sign(Ed25519.Algorithm algorithm, Ed25519PublicKeyParameters publicKey, byte[] ctx, byte[] msg, int msgOff, int msgLen, - byte[] sig, int sigOff) - { - Sign(algorithm, ctx, msg, msgOff, msgLen, sig, sigOff); - } - public void Sign(Ed25519.Algorithm algorithm, byte[] ctx, byte[] msg, int msgOff, int msgLen, byte[] sig, int sigOff) { diff --git a/crypto/src/crypto/parameters/Ed448PrivateKeyParameters.cs b/crypto/src/crypto/parameters/Ed448PrivateKeyParameters.cs index 705ad8c53..a6a1b72a1 100644 --- a/crypto/src/crypto/parameters/Ed448PrivateKeyParameters.cs +++ b/crypto/src/crypto/parameters/Ed448PrivateKeyParameters.cs @@ -67,13 +67,6 @@ namespace Org.BouncyCastle.Crypto.Parameters } } - [Obsolete("Use overload that doesn't take a public key")] - public void Sign(Ed448.Algorithm algorithm, Ed448PublicKeyParameters publicKey, byte[] ctx, byte[] msg, int msgOff, int msgLen, - byte[] sig, int sigOff) - { - Sign(algorithm, ctx, msg, msgOff, msgLen, sig, sigOff); - } - public void Sign(Ed448.Algorithm algorithm, byte[] ctx, byte[] msg, int msgOff, int msgLen, byte[] sig, int sigOff) { diff --git a/crypto/src/crypto/parameters/NaccacheSternKeyGenerationParameters.cs b/crypto/src/crypto/parameters/NaccacheSternKeyGenerationParameters.cs index 44fc906b5..d29d3c568 100644 --- a/crypto/src/crypto/parameters/NaccacheSternKeyGenerationParameters.cs +++ b/crypto/src/crypto/parameters/NaccacheSternKeyGenerationParameters.cs @@ -48,32 +48,6 @@ namespace Org.BouncyCastle.Crypto.Parameters } /** - * Parameters for a NaccacheStern KeyPair. - * - * @param random - * The source of randomness - * @param strength - * The desired strength of the Key in Bits - * @param certainty - * the probability that the generated primes are not really prime - * as integer: 2^(-certainty) is then the probability - * @param cntSmallPrimes - * How many small key factors are desired - * @param debug - * Ignored - */ - [Obsolete("Use version without 'debug' parameter")] - public NaccacheSternKeyGenerationParameters( - SecureRandom random, - int strength, - int certainty, - int countSmallPrimes, - bool debug) - : this(random, strength, certainty, countSmallPrimes) - { - } - - /** * @return Returns the certainty. */ public int Certainty @@ -88,11 +62,5 @@ namespace Org.BouncyCastle.Crypto.Parameters { get { return countSmallPrimes; } } - - [Obsolete("Remove: always false")] - public bool IsDebug - { - get { return false; } - } } } diff --git a/crypto/src/crypto/parameters/NaccacheSternPrivateKeyParameters.cs b/crypto/src/crypto/parameters/NaccacheSternPrivateKeyParameters.cs index 42a0454a1..5b0917bd2 100644 --- a/crypto/src/crypto/parameters/NaccacheSternPrivateKeyParameters.cs +++ b/crypto/src/crypto/parameters/NaccacheSternPrivateKeyParameters.cs @@ -16,21 +16,6 @@ namespace Org.BouncyCastle.Crypto.Parameters private readonly BigInteger phiN; private readonly IList smallPrimes; -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public NaccacheSternPrivateKeyParameters( - BigInteger g, - BigInteger n, - int lowerSigmaBound, - ArrayList smallPrimes, - BigInteger phiN) - : base(true, g, n, lowerSigmaBound) - { - this.smallPrimes = smallPrimes; - this.phiN = phiN; - } -#endif - /** * Constructs a NaccacheSternPrivateKey * @@ -63,14 +48,6 @@ namespace Org.BouncyCastle.Crypto.Parameters get { return phiN; } } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete("Use 'SmallPrimesList' instead")] - public ArrayList SmallPrimes - { - get { return new ArrayList(smallPrimes); } - } -#endif - public IList SmallPrimesList { get { return smallPrimes; } diff --git a/crypto/src/crypto/parameters/ParametersWithRandom.cs b/crypto/src/crypto/parameters/ParametersWithRandom.cs index 276dc2666..e19c9125f 100644 --- a/crypto/src/crypto/parameters/ParametersWithRandom.cs +++ b/crypto/src/crypto/parameters/ParametersWithRandom.cs @@ -29,12 +29,6 @@ namespace Org.BouncyCastle.Crypto.Parameters { } - [Obsolete("Use Random property instead")] - public SecureRandom GetRandom() - { - return Random; - } - public SecureRandom Random { get { return random; } diff --git a/crypto/src/crypto/signers/Iso9796d2PssSigner.cs b/crypto/src/crypto/signers/Iso9796d2PssSigner.cs index 6b8037095..9a2ec4fa9 100644 --- a/crypto/src/crypto/signers/Iso9796d2PssSigner.cs +++ b/crypto/src/crypto/signers/Iso9796d2PssSigner.cs @@ -26,23 +26,6 @@ namespace Org.BouncyCastle.Crypto.Signers return recoveredMessage; } - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerImplicit = 0xBC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerRipeMD160 = 0x31CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerRipeMD128 = 0x32CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha1 = 0x33CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha256 = 0x34CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha512 = 0x35CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha384 = 0x36CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerWhirlpool = 0x37CC; - private IDigest digest; private IAsymmetricBlockCipher cipher; diff --git a/crypto/src/crypto/signers/Iso9796d2Signer.cs b/crypto/src/crypto/signers/Iso9796d2Signer.cs index 303913068..fc3c275c5 100644 --- a/crypto/src/crypto/signers/Iso9796d2Signer.cs +++ b/crypto/src/crypto/signers/Iso9796d2Signer.cs @@ -21,23 +21,6 @@ namespace Org.BouncyCastle.Crypto.Signers return recoveredMessage; } - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerImplicit = 0xBC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerRipeMD160 = 0x31CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerRipeMD128 = 0x32CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha1 = 0x33CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha256 = 0x34CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha512 = 0x35CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerSha384 = 0x36CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TrailerWhirlpool = 0x37CC; - private IDigest digest; private IAsymmetricBlockCipher cipher; diff --git a/crypto/src/crypto/signers/X931Signer.cs b/crypto/src/crypto/signers/X931Signer.cs index 6aeff87ad..411d3b9e8 100644 --- a/crypto/src/crypto/signers/X931Signer.cs +++ b/crypto/src/crypto/signers/X931Signer.cs @@ -20,25 +20,6 @@ namespace Org.BouncyCastle.Crypto.Signers public class X931Signer : ISigner { - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_IMPLICIT = 0xBC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_RIPEMD160 = 0x31CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_RIPEMD128 = 0x32CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_SHA1 = 0x33CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_SHA256 = 0x34CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_SHA512 = 0x35CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_SHA384 = 0x36CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_WHIRLPOOL = 0x37CC; - [Obsolete("Use 'IsoTrailers' instead")] - public const int TRAILER_SHA224 = 0x38CC; - private IDigest digest; private IAsymmetricBlockCipher cipher; private RsaKeyParameters kParam; diff --git a/crypto/src/math/ec/ECPoint.cs b/crypto/src/math/ec/ECPoint.cs index efec49c63..2a9d0832a 100644 --- a/crypto/src/math/ec/ECPoint.cs +++ b/crypto/src/math/ec/ECPoint.cs @@ -662,19 +662,6 @@ namespace Org.BouncyCastle.Math.EC : AbstractFpPoint { /** - * Create a point which encodes without point compression. - * - * @param curve the curve to use - * @param x affine x co-ordinate - * @param y affine y co-ordinate - */ - [Obsolete("Use ECCurve.CreatePoint to construct points")] - public FpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) - { - } - - /** * Create a point that encodes with or without point compression. * * @param curve the curve to use @@ -1650,20 +1637,6 @@ namespace Org.BouncyCastle.Math.EC * @param curve base curve * @param x x point * @param y y point - */ - [Obsolete("Use ECCurve.CreatePoint to construct points")] - public F2mPoint( - ECCurve curve, - ECFieldElement x, - ECFieldElement y) - : this(curve, x, y, false) - { - } - - /** - * @param curve base curve - * @param x x point - * @param y y point * @param withCompression true if encode with point compression. */ [Obsolete("Per-point compression property will be removed, see GetEncoded(bool)")] diff --git a/crypto/src/math/ec/endo/GlvTypeBParameters.cs b/crypto/src/math/ec/endo/GlvTypeBParameters.cs index 5e2937be8..fa2fd4c45 100644 --- a/crypto/src/math/ec/endo/GlvTypeBParameters.cs +++ b/crypto/src/math/ec/endo/GlvTypeBParameters.cs @@ -7,15 +7,6 @@ namespace Org.BouncyCastle.Math.EC.Endo protected readonly BigInteger m_beta, m_lambda; protected readonly ScalarSplitParameters m_splitParams; - [Obsolete("Use constructor taking a ScalarSplitParameters instead")] - public GlvTypeBParameters(BigInteger beta, BigInteger lambda, BigInteger[] v1, BigInteger[] v2, - BigInteger g1, BigInteger g2, int bits) - { - this.m_beta = beta; - this.m_lambda = lambda; - this.m_splitParams = new ScalarSplitParameters(v1, v2, g1, g2, bits); - } - public GlvTypeBParameters(BigInteger beta, BigInteger lambda, ScalarSplitParameters splitParams) { this.m_beta = beta; @@ -37,35 +28,5 @@ namespace Org.BouncyCastle.Math.EC.Endo { get { return m_splitParams; } } - - [Obsolete("Access via SplitParams instead")] - public virtual BigInteger[] V1 - { - get { return new BigInteger[] { m_splitParams.V1A, m_splitParams.V1B }; } - } - - [Obsolete("Access via SplitParams instead")] - public virtual BigInteger[] V2 - { - get { return new BigInteger[] { m_splitParams.V2A, m_splitParams.V2B }; } - } - - [Obsolete("Access via SplitParams instead")] - public virtual BigInteger G1 - { - get { return m_splitParams.G1; } - } - - [Obsolete("Access via SplitParams instead")] - public virtual BigInteger G2 - { - get { return m_splitParams.G2; } - } - - [Obsolete("Access via SplitParams instead")] - public virtual int Bits - { - get { return m_splitParams.Bits; } - } } } diff --git a/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs b/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs deleted file mode 100644 index 6648727f9..000000000 --- a/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - [Obsolete("Will be removed")] - public class DoubleAddMultiplier - : AbstractECMultiplier - { - /** - * Joye's double-add algorithm. - */ - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p }; - - int n = k.BitLength; - for (int i = 0; i < n; ++i) - { - int b = k.TestBit(i) ? 1 : 0; - int bp = 1 - b; - R[bp] = R[bp].TwicePlus(R[b]); - } - - return R[0]; - } - } -} diff --git a/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs b/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs deleted file mode 100644 index 2bed8920c..000000000 --- a/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - /** - * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left) using - * mixed coordinates. - */ - [Obsolete("Will be removed")] - public class MixedNafR2LMultiplier - : AbstractECMultiplier - { - protected readonly int additionCoord, doublingCoord; - - /** - * By default, addition will be done in Jacobian coordinates, and doubling will be done in - * Modified Jacobian coordinates (independent of the original coordinate system of each point). - */ - public MixedNafR2LMultiplier() - : this(ECCurve.COORD_JACOBIAN, ECCurve.COORD_JACOBIAN_MODIFIED) - { - } - - public MixedNafR2LMultiplier(int additionCoord, int doublingCoord) - { - this.additionCoord = additionCoord; - this.doublingCoord = doublingCoord; - } - - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - ECCurve curveOrig = p.Curve; - - ECCurve curveAdd = ConfigureCurve(curveOrig, additionCoord); - ECCurve curveDouble = ConfigureCurve(curveOrig, doublingCoord); - - int[] naf = WNafUtilities.GenerateCompactNaf(k); - - ECPoint Ra = curveAdd.Infinity; - ECPoint Td = curveDouble.ImportPoint(p); - - int zeroes = 0; - for (int i = 0; i < naf.Length; ++i) - { - int ni = naf[i]; - int digit = ni >> 16; - zeroes += ni & 0xFFFF; - - Td = Td.TimesPow2(zeroes); - - ECPoint Tj = curveAdd.ImportPoint(Td); - if (digit < 0) - { - Tj = Tj.Negate(); - } - - Ra = Ra.Add(Tj); - - zeroes = 1; - } - - return curveOrig.ImportPoint(Ra); - } - - protected virtual ECCurve ConfigureCurve(ECCurve c, int coord) - { - if (c.CoordinateSystem == coord) - return c; - - if (!c.SupportsCoordinateSystem(coord)) - throw new ArgumentException("Coordinate system " + coord + " not supported by this curve", "coord"); - - return c.Configure().SetCoordinateSystem(coord).Create(); - } - } -} diff --git a/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs b/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs deleted file mode 100644 index 45df2fdae..000000000 --- a/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - [Obsolete("Will be removed")] - public class MontgomeryLadderMultiplier - : AbstractECMultiplier - { - /** - * Montgomery ladder. - */ - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p }; - - int n = k.BitLength; - int i = n; - while (--i >= 0) - { - int b = k.TestBit(i) ? 1 : 0; - int bp = 1 - b; - R[bp] = R[bp].Add(R[b]); - R[b] = R[b].Twice(); - } - return R[0]; - } - } -} diff --git a/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs b/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs deleted file mode 100644 index d41a0d651..000000000 --- a/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - /** - * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (left-to-right). - */ - [Obsolete("Will be removed")] - public class NafL2RMultiplier - : AbstractECMultiplier - { - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - int[] naf = WNafUtilities.GenerateCompactNaf(k); - - ECPoint addP = p.Normalize(), subP = addP.Negate(); - - ECPoint R = p.Curve.Infinity; - - int i = naf.Length; - while (--i >= 0) - { - int ni = naf[i]; - int digit = ni >> 16, zeroes = ni & 0xFFFF; - - R = R.TwicePlus(digit < 0 ? subP : addP); - R = R.TimesPow2(zeroes); - } - - return R; - } - } -} diff --git a/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs b/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs deleted file mode 100644 index 8157cf05e..000000000 --- a/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - /** - * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left). - */ - [Obsolete("Will be removed")] - public class NafR2LMultiplier - : AbstractECMultiplier - { - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - int[] naf = WNafUtilities.GenerateCompactNaf(k); - - ECPoint R0 = p.Curve.Infinity, R1 = p; - - int zeroes = 0; - for (int i = 0; i < naf.Length; ++i) - { - int ni = naf[i]; - int digit = ni >> 16; - zeroes += ni & 0xFFFF; - - R1 = R1.TimesPow2(zeroes); - R0 = R0.Add(digit < 0 ? R1.Negate() : R1); - - zeroes = 1; - } - - return R0; - } - } -} diff --git a/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs b/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs deleted file mode 100644 index 40563cdc7..000000000 --- a/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - [Obsolete("Will be removed")] - public class ReferenceMultiplier - : AbstractECMultiplier - { - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - return ECAlgorithms.ReferenceMultiply(p, k); - } - } -} diff --git a/crypto/src/math/ec/multiplier/WNafUtilities.cs b/crypto/src/math/ec/multiplier/WNafUtilities.cs index 42265b2d6..0e69c2785 100644 --- a/crypto/src/math/ec/multiplier/WNafUtilities.cs +++ b/crypto/src/math/ec/multiplier/WNafUtilities.cs @@ -361,18 +361,6 @@ namespace Org.BouncyCastle.Math.EC.Multiplier return System.Math.Max(2, System.Math.Min(maxWidth, w + 2)); } - [Obsolete] - public static ECPoint MapPointWithPrecomp(ECPoint p, int minWidth, bool includeNegated, - ECPointMap pointMap) - { - ECCurve c = p.Curve; - WNafPreCompInfo infoP = Precompute(p, minWidth, includeNegated); - - ECPoint q = pointMap.Map(p); - c.Precompute(q, PRECOMP_NAME, new MapPointCallback(infoP, includeNegated, pointMap)); - return q; - } - public static WNafPreCompInfo Precompute(ECPoint p, int minWidth, bool includeNegated) { return (WNafPreCompInfo)p.Curve.Precompute(p, PRECOMP_NAME, diff --git a/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs b/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs deleted file mode 100644 index 1c7a5d104..000000000 --- a/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - [Obsolete("Will be removed")] - public class ZSignedDigitL2RMultiplier - : AbstractECMultiplier - { - /** - * 'Zeroless' Signed Digit Left-to-Right. - */ - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - ECPoint addP = p.Normalize(), subP = addP.Negate(); - - ECPoint R0 = addP; - - int n = k.BitLength; - int s = k.GetLowestSetBit(); - - int i = n; - while (--i > s) - { - R0 = R0.TwicePlus(k.TestBit(i) ? addP : subP); - } - - R0 = R0.TimesPow2(s); - - return R0; - } - } -} diff --git a/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs b/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs deleted file mode 100644 index 46d234c37..000000000 --- a/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Math.EC.Multiplier -{ - [Obsolete("Will be removed")] - public class ZSignedDigitR2LMultiplier - : AbstractECMultiplier - { - /** - * 'Zeroless' Signed Digit Right-to-Left. - */ - protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) - { - ECPoint R0 = p.Curve.Infinity, R1 = p; - - int n = k.BitLength; - int s = k.GetLowestSetBit(); - - R1 = R1.TimesPow2(s); - - int i = s; - while (++i < n) - { - R0 = R0.Add(k.TestBit(i) ? R1 : R1.Negate()); - R1 = R1.Twice(); - } - - R0 = R0.Add(R1); - - return R0; - } - } -} diff --git a/crypto/src/math/raw/Nat.cs b/crypto/src/math/raw/Nat.cs index effe46454..8e5b7a04c 100644 --- a/crypto/src/math/raw/Nat.cs +++ b/crypto/src/math/raw/Nat.cs @@ -1128,37 +1128,6 @@ namespace Org.BouncyCastle.Math.Raw ShiftUpBit(extLen, zz, zzOff, x[xOff] << 31); } - [Obsolete("Use 'SquareWordAddTo' instead")] - public static uint SquareWordAdd(uint[] x, int xPos, uint[] z) - { - ulong c = 0, xVal = (ulong)x[xPos]; - int i = 0; - do - { - c += xVal * x[i] + z[xPos + i]; - z[xPos + i] = (uint)c; - c >>= 32; - } - while (++i < xPos); - return (uint)c; - } - - [Obsolete("Use 'SquareWordAddTo' instead")] - public static uint SquareWordAdd(uint[] x, int xOff, int xPos, uint[] z, int zOff) - { - ulong c = 0, xVal = (ulong)x[xOff + xPos]; - int i = 0; - do - { - c += xVal * (x[xOff + i] & M) + (z[xPos + zOff] & M); - z[xPos + zOff] = (uint)c; - c >>= 32; - ++zOff; - } - while (++i < xPos); - return (uint)c; - } - public static uint SquareWordAddTo(uint[] x, int xPos, uint[] z) { ulong c = 0, xVal = (ulong)x[xPos]; diff --git a/crypto/src/ocsp/BasicOCSPResp.cs b/crypto/src/ocsp/BasicOCSPResp.cs index e79d556bd..2f6d68b48 100644 --- a/crypto/src/ocsp/BasicOCSPResp.cs +++ b/crypto/src/ocsp/BasicOCSPResp.cs @@ -103,12 +103,6 @@ namespace Org.BouncyCastle.Ocsp get { return resp.SignatureAlgorithm.Algorithm.Id; } } - [Obsolete("RespData class is no longer required as all functionality is available on this class")] - public RespData GetResponseData() - { - return new RespData(data); - } - public byte[] GetSignature() { return resp.GetSignatureOctets(); diff --git a/crypto/src/ocsp/OCSPRespStatus.cs b/crypto/src/ocsp/OCSPRespStatus.cs index 9c00c7035..42629a2dc 100644 --- a/crypto/src/ocsp/OCSPRespStatus.cs +++ b/crypto/src/ocsp/OCSPRespStatus.cs @@ -2,11 +2,6 @@ using System; namespace Org.BouncyCastle.Ocsp { - [Obsolete("Use version with correct spelling 'OcspRespStatus'")] - public abstract class OcscpRespStatus : OcspRespStatus - { - } - public abstract class OcspRespStatus { /** diff --git a/crypto/src/openpgp/PgpEncryptedDataGenerator.cs b/crypto/src/openpgp/PgpEncryptedDataGenerator.cs index 336baf00d..6ba77a37e 100644 --- a/crypto/src/openpgp/PgpEncryptedDataGenerator.cs +++ b/crypto/src/openpgp/PgpEncryptedDataGenerator.cs @@ -270,19 +270,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp this.oldFormat = oldFormat; } - /// <summary> - /// Add a PBE encryption method to the encrypted object using the default algorithm (S2K_SHA1). - /// </summary> - /// <remarks> - /// Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is - /// the historical behaviour of the library (1.7 and earlier). - /// </remarks> - [Obsolete("Use version that takes an explicit s2kDigest parameter")] - public void AddMethod(char[] passPhrase) - { - AddMethod(passPhrase, HashAlgorithmTag.Sha1); - } - /// <summary>Add a PBE encryption method to the encrypted object.</summary> /// <remarks> /// Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is diff --git a/crypto/src/openpgp/PgpEncryptedDataList.cs b/crypto/src/openpgp/PgpEncryptedDataList.cs index 1f605dab5..33e7eee2c 100644 --- a/crypto/src/openpgp/PgpEncryptedDataList.cs +++ b/crypto/src/openpgp/PgpEncryptedDataList.cs @@ -47,18 +47,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp get { return (PgpEncryptedData) list[index]; } } - [Obsolete("Use 'object[index]' syntax instead")] - public object Get(int index) - { - return this[index]; - } - - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return list.Count; } - } - public int Count { get { return list.Count; } diff --git a/crypto/src/openpgp/PgpException.cs b/crypto/src/openpgp/PgpException.cs index 230dab86e..e2cce982a 100644 --- a/crypto/src/openpgp/PgpException.cs +++ b/crypto/src/openpgp/PgpException.cs @@ -12,11 +12,5 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp public PgpException() : base() {} public PgpException(string message) : base(message) {} public PgpException(string message, Exception exception) : base(message, exception) {} - - [Obsolete("Use InnerException property")] - public Exception UnderlyingException - { - get { return InnerException; } - } } } diff --git a/crypto/src/openpgp/PgpKeyRingGenerator.cs b/crypto/src/openpgp/PgpKeyRingGenerator.cs index 352575b0b..abd2030dc 100644 --- a/crypto/src/openpgp/PgpKeyRingGenerator.cs +++ b/crypto/src/openpgp/PgpKeyRingGenerator.cs @@ -24,36 +24,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp private SecureRandom rand; /// <summary> - /// Create a new key ring generator using old style checksumming. It is recommended to use - /// SHA1 checksumming where possible. - /// </summary> - /// <remarks> - /// Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is - /// the historical behaviour of the library (1.7 and earlier). - /// </remarks> - /// <param name="certificationLevel">The certification level for keys on this ring.</param> - /// <param name="masterKey">The master key pair.</param> - /// <param name="id">The id to be associated with the ring.</param> - /// <param name="encAlgorithm">The algorithm to be used to protect secret keys.</param> - /// <param name="passPhrase">The passPhrase to be used to protect secret keys.</param> - /// <param name="hashedPackets">Packets to be included in the certification hash.</param> - /// <param name="unhashedPackets">Packets to be attached unhashed to the certification.</param> - /// <param name="rand">input secured random.</param> - [Obsolete("Use version taking an explicit 'useSha1' parameter instead")] - public PgpKeyRingGenerator( - int certificationLevel, - PgpKeyPair masterKey, - string id, - SymmetricKeyAlgorithmTag encAlgorithm, - char[] passPhrase, - PgpSignatureSubpacketVector hashedPackets, - PgpSignatureSubpacketVector unhashedPackets, - SecureRandom rand) - : this(certificationLevel, masterKey, id, encAlgorithm, passPhrase, false, hashedPackets, unhashedPackets, rand) - { - } - - /// <summary> /// Create a new key ring generator. /// </summary> /// <remarks> diff --git a/crypto/src/openpgp/PgpObjectFactory.cs b/crypto/src/openpgp/PgpObjectFactory.cs index c67c7ccd1..8614d1e63 100644 --- a/crypto/src/openpgp/PgpObjectFactory.cs +++ b/crypto/src/openpgp/PgpObjectFactory.cs @@ -125,12 +125,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp throw new IOException("unknown object in stream " + bcpgIn.NextPacketTag()); } - [Obsolete("Use NextPgpObject() instead")] - public object NextObject() - { - return NextPgpObject(); - } - /// <summary> /// Return all available objects in a list. /// </summary> diff --git a/crypto/src/openpgp/PgpOnePassSignatureList.cs b/crypto/src/openpgp/PgpOnePassSignatureList.cs index 37c4288e3..c49750810 100644 --- a/crypto/src/openpgp/PgpOnePassSignatureList.cs +++ b/crypto/src/openpgp/PgpOnePassSignatureList.cs @@ -25,19 +25,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp get { return sigs[index]; } } - [Obsolete("Use 'object[index]' syntax instead")] - public PgpOnePassSignature Get( - int index) - { - return this[index]; - } - - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return sigs.Length; } - } - public int Count { get { return sigs.Length; } diff --git a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs index 08d0aa0a1..23194d2d1 100644 --- a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs @@ -62,12 +62,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp } } - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return order.Count; } - } - /// <summary>Return the number of key rings in this collection.</summary> public int Count { diff --git a/crypto/src/openpgp/PgpSecretKey.cs b/crypto/src/openpgp/PgpSecretKey.cs index a3ffd4a4a..2462db4e4 100644 --- a/crypto/src/openpgp/PgpSecretKey.cs +++ b/crypto/src/openpgp/PgpSecretKey.cs @@ -132,24 +132,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp /// Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is /// the historical behaviour of the library (1.7 and earlier). /// </remarks> - [Obsolete("Use the constructor taking an explicit 'useSha1' parameter instead")] - public PgpSecretKey( - int certificationLevel, - PgpKeyPair keyPair, - string id, - SymmetricKeyAlgorithmTag encAlgorithm, - char[] passPhrase, - PgpSignatureSubpacketVector hashedPackets, - PgpSignatureSubpacketVector unhashedPackets, - SecureRandom rand) - : this(certificationLevel, keyPair, id, encAlgorithm, passPhrase, false, hashedPackets, unhashedPackets, rand) - { - } - - /// <remarks> - /// Conversion of the passphrase characters to bytes is performed using Convert.ToByte(), which is - /// the historical behaviour of the library (1.7 and earlier). - /// </remarks> public PgpSecretKey( int certificationLevel, PgpKeyPair keyPair, diff --git a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs index 26be9c10b..f367d17d0 100644 --- a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs @@ -62,12 +62,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp } } - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return order.Count; } - } - /// <summary>Return the number of rings in this collection.</summary> public int Count { diff --git a/crypto/src/openpgp/PgpSignature.cs b/crypto/src/openpgp/PgpSignature.cs index fb6244725..aabe964b1 100644 --- a/crypto/src/openpgp/PgpSignature.cs +++ b/crypto/src/openpgp/PgpSignature.cs @@ -320,12 +320,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp get { return sigPck.KeyId; } } - [Obsolete("Use 'CreationTime' property instead")] - public DateTime GetCreationTime() - { - return CreationTime; - } - /// <summary>The creation time of this signature.</summary> public DateTime CreationTime { diff --git a/crypto/src/openpgp/PgpSignatureList.cs b/crypto/src/openpgp/PgpSignatureList.cs index 61976fc4f..a2a23c70b 100644 --- a/crypto/src/openpgp/PgpSignatureList.cs +++ b/crypto/src/openpgp/PgpSignatureList.cs @@ -6,7 +6,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp public class PgpSignatureList : PgpObject { - private PgpSignature[] sigs; + private readonly PgpSignature[] sigs; public PgpSignatureList( PgpSignature[] sigs) @@ -25,19 +25,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp get { return sigs[index]; } } - [Obsolete("Use 'object[index]' syntax instead")] - public PgpSignature Get( - int index) - { - return this[index]; - } - - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return sigs.Length; } - } - public int Count { get { return sigs.Length; } diff --git a/crypto/src/openpgp/PgpSignatureSubpacketVector.cs b/crypto/src/openpgp/PgpSignatureSubpacketVector.cs index 810f49c3e..332cefbfc 100644 --- a/crypto/src/openpgp/PgpSignatureSubpacketVector.cs +++ b/crypto/src/openpgp/PgpSignatureSubpacketVector.cs @@ -96,12 +96,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return vals; } - [Obsolete("Use 'GetNotationDataOccurrences' instead")] - public NotationData[] GetNotationDataOccurences() - { - return GetNotationDataOccurrences(); - } - public long GetIssuerKeyId() { SignatureSubpacket p = GetSubpacket(SignatureSubpacketTag.IssuerKeyId); @@ -254,12 +248,6 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return new Features(p.IsCritical(), p.IsLongLength(), p.GetData()); } - [Obsolete("Use 'Count' property instead")] - public int Size - { - get { return packets.Length; } - } - /// <summary>Return the number of packets this vector contains.</summary> public int Count { diff --git a/crypto/src/pkcs/AsymmetricKeyEntry.cs b/crypto/src/pkcs/AsymmetricKeyEntry.cs index 6da3ade3e..8158bc9fc 100644 --- a/crypto/src/pkcs/AsymmetricKeyEntry.cs +++ b/crypto/src/pkcs/AsymmetricKeyEntry.cs @@ -18,17 +18,6 @@ namespace Org.BouncyCastle.Pkcs this.key = key; } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public AsymmetricKeyEntry( - AsymmetricKeyParameter key, - Hashtable attributes) - : base(attributes) - { - this.key = key; - } -#endif - public AsymmetricKeyEntry( AsymmetricKeyParameter key, IDictionary attributes) diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs index c4624bfdc..7f409bcf8 100644 --- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs +++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs @@ -249,25 +249,6 @@ namespace Org.BouncyCastle.Pkcs /// <param name="subject">X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" </param> /// <param name="publicKey">Public Key to be included in cert reqest.</param> /// <param name="attributes">ASN1Set of Attributes.</param> - /// <param name="signingKey">Ignored.</param> - [Obsolete("Use constructor without 'signingKey' parameter (ignored here)")] - public Pkcs10CertificationRequest( - ISignatureFactory signatureFactory, - X509Name subject, - AsymmetricKeyParameter publicKey, - Asn1Set attributes, - AsymmetricKeyParameter signingKey) - : this(signatureFactory, subject, publicKey, attributes) - { - } - - /// <summary> - /// Instantiate a Pkcs10CertificationRequest object with the necessary credentials. - /// </summary> - ///<param name="signatureFactory">The factory for signature calculators to sign the PKCS#10 request with.</param> - /// <param name="subject">X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" </param> - /// <param name="publicKey">Public Key to be included in cert reqest.</param> - /// <param name="attributes">ASN1Set of Attributes.</param> public Pkcs10CertificationRequest( ISignatureFactory signatureFactory, X509Name subject, diff --git a/crypto/src/pkcs/Pkcs12Entry.cs b/crypto/src/pkcs/Pkcs12Entry.cs index 5dcc94e88..6546f9eee 100644 --- a/crypto/src/pkcs/Pkcs12Entry.cs +++ b/crypto/src/pkcs/Pkcs12Entry.cs @@ -24,26 +24,6 @@ namespace Org.BouncyCastle.Pkcs } } - [Obsolete("Use 'object[index]' syntax instead")] - public Asn1Encodable GetBagAttribute( - DerObjectIdentifier oid) - { - return (Asn1Encodable)this.attributes[oid.Id]; - } - - [Obsolete("Use 'object[index]' syntax instead")] - public Asn1Encodable GetBagAttribute( - string oid) - { - return (Asn1Encodable)this.attributes[oid]; - } - - [Obsolete("Use 'BagAttributeKeys' property")] - public IEnumerator GetBagAttributeKeys() - { - return this.attributes.Keys.GetEnumerator(); - } - public Asn1Encodable this[ DerObjectIdentifier oid] { diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs index 832367e6b..1e951ace5 100644 --- a/crypto/src/pkcs/Pkcs12Store.cs +++ b/crypto/src/pkcs/Pkcs12Store.cs @@ -732,12 +732,6 @@ namespace Org.BouncyCastle.Pkcs return false; } - [Obsolete("Use 'Count' property instead")] - public int Size() - { - return Count; - } - public int Count { // TODO Seems a little inefficient diff --git a/crypto/src/pkcs/X509CertificateEntry.cs b/crypto/src/pkcs/X509CertificateEntry.cs index 2f81dd87b..9d850f885 100644 --- a/crypto/src/pkcs/X509CertificateEntry.cs +++ b/crypto/src/pkcs/X509CertificateEntry.cs @@ -18,17 +18,6 @@ namespace Org.BouncyCastle.Pkcs this.cert = cert; } -#if !(SILVERLIGHT || PORTABLE) - [Obsolete] - public X509CertificateEntry( - X509Certificate cert, - Hashtable attributes) - : base(attributes) - { - this.cert = cert; - } -#endif - public X509CertificateEntry( X509Certificate cert, IDictionary attributes) diff --git a/crypto/src/pkix/PkixNameConstraintValidator.cs b/crypto/src/pkix/PkixNameConstraintValidator.cs index dbf7625c6..5b032152a 100644 --- a/crypto/src/pkix/PkixNameConstraintValidator.cs +++ b/crypto/src/pkix/PkixNameConstraintValidator.cs @@ -1692,12 +1692,6 @@ namespace Org.BouncyCastle.Pkix return temp; } - [Obsolete("Use GetHashCode instead")] - public int HashCode() - { - return GetHashCode(); - } - public override int GetHashCode() { return HashCollection(excludedSubtreesDN) diff --git a/crypto/src/security/NoSuchAlgorithmException.cs b/crypto/src/security/NoSuchAlgorithmException.cs deleted file mode 100644 index c56ec651e..000000000 --- a/crypto/src/security/NoSuchAlgorithmException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Org.BouncyCastle.Security -{ - [Obsolete("Never thrown")] -#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE) - [Serializable] -#endif - public class NoSuchAlgorithmException : GeneralSecurityException - { - public NoSuchAlgorithmException() : base() {} - public NoSuchAlgorithmException(string message) : base(message) {} - public NoSuchAlgorithmException(string message, Exception exception) : base(message, exception) {} - } -} diff --git a/crypto/src/security/SecureRandom.cs b/crypto/src/security/SecureRandom.cs index 982fbf3a0..5019eaf63 100644 --- a/crypto/src/security/SecureRandom.cs +++ b/crypto/src/security/SecureRandom.cs @@ -112,12 +112,6 @@ namespace Org.BouncyCastle.Security throw new ArgumentException("Unrecognised PRNG algorithm: " + algorithm, "algorithm"); } - [Obsolete("Call GenerateSeed() on a SecureRandom instance instead")] - public static byte[] GetSeed(int length) - { - return GetNextBytes(Master, length); - } - protected readonly IRandomGenerator generator; public SecureRandom() diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs index 72ff92271..f0c8ba194 100644 --- a/crypto/src/tls/TlsUtilities.cs +++ b/crypto/src/tls/TlsUtilities.cs @@ -938,19 +938,6 @@ namespace Org.BouncyCastle.Tls } /// <exception cref="IOException"/> - [Obsolete("Will be removed. Use ReadAsn1Object in combination with RequireDerEncoding instead")] - 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); - RequireDerEncoding(result, encoding); - return result; - } - - /// <exception cref="IOException"/> public static void RequireDerEncoding(Asn1Encodable asn1, byte[] encoding) { /* @@ -1083,13 +1070,6 @@ namespace Org.BouncyCastle.Tls return result; } - [Obsolete("Will be removed")] - public static SignatureAndHashAlgorithm GetSignatureAndHashAlgorithm(TlsContext context, - TlsCredentialedSigner signerCredentials) - { - return GetSignatureAndHashAlgorithm(context.ServerVersion, signerCredentials); - } - internal static SignatureAndHashAlgorithm GetSignatureAndHashAlgorithm(ProtocolVersion negotiatedVersion, TlsCredentialedSigner credentialedSigner) { diff --git a/crypto/src/tsp/TimeStampRequestGenerator.cs b/crypto/src/tsp/TimeStampRequestGenerator.cs index 2c698e476..f4462659b 100644 --- a/crypto/src/tsp/TimeStampRequestGenerator.cs +++ b/crypto/src/tsp/TimeStampRequestGenerator.cs @@ -38,35 +38,6 @@ namespace Org.BouncyCastle.Tsp * add a given extension field for the standard extensions tag (tag 3) * @throws IOException */ - [Obsolete("Use method taking DerObjectIdentifier")] - public void AddExtension( - string oid, - bool critical, - Asn1Encodable value) - { - this.AddExtension(oid, critical, value.GetEncoded()); - } - - /** - * add a given extension field for the standard extensions tag - * The value parameter becomes the contents of the octet string associated - * with the extension. - */ - [Obsolete("Use method taking DerObjectIdentifier")] - public void AddExtension( - string oid, - bool critical, - byte[] value) - { - DerObjectIdentifier derOid = new DerObjectIdentifier(oid); - extensions[derOid] = new X509Extension(critical, new DerOctetString(value)); - extOrdering.Add(derOid); - } - - /** - * add a given extension field for the standard extensions tag (tag 3) - * @throws IOException - */ public virtual void AddExtension( DerObjectIdentifier oid, bool critical, diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs index 86848af8d..b206d3144 100644 --- a/crypto/src/util/Arrays.cs +++ b/crypto/src/util/Arrays.cs @@ -81,14 +81,6 @@ namespace Org.BouncyCastle.Utilities return true; } - [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. diff --git a/crypto/src/util/zlib/ZDeflaterOutputStream.cs b/crypto/src/util/zlib/ZDeflaterOutputStream.cs deleted file mode 100644 index d0978942a..000000000 --- a/crypto/src/util/zlib/ZDeflaterOutputStream.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.IO; - -namespace Org.BouncyCastle.Utilities.Zlib { - /// <summary> - /// Summary description for DeflaterOutputStream. - /// </summary> - [Obsolete("Use 'ZOutputStream' instead")] - public class ZDeflaterOutputStream : Stream { - protected ZStream z=new ZStream(); - protected int flushLevel=JZlib.Z_NO_FLUSH; - private const int BUFSIZE = 4192; - protected byte[] buf=new byte[BUFSIZE]; - private byte[] buf1=new byte[1]; - - protected Stream outp; - - public ZDeflaterOutputStream(Stream outp) : this(outp, 6, false) { - } - - public ZDeflaterOutputStream(Stream outp, int level) : this(outp, level, false) { - } - - public ZDeflaterOutputStream(Stream outp, int level, bool nowrap) { - this.outp=outp; - z.deflateInit(level, nowrap); - } - - - public override bool CanRead { - get { - // TODO: Add DeflaterOutputStream.CanRead getter implementation - return false; - } - } - - public override bool CanSeek { - get { - // TODO: Add DeflaterOutputStream.CanSeek getter implementation - return false; - } - } - - public override bool CanWrite { - get { - // TODO: Add DeflaterOutputStream.CanWrite getter implementation - return true; - } - } - - public override long Length { - get { - // TODO: Add DeflaterOutputStream.Length getter implementation - return 0; - } - } - - public override long Position { - get { - // TODO: Add DeflaterOutputStream.Position getter implementation - return 0; - } - set { - // TODO: Add DeflaterOutputStream.Position setter implementation - } - } - - public override void Write(byte[] b, int off, int len) { - if(len==0) - return; - int err; - z.next_in=b; - z.next_in_index=off; - z.avail_in=len; - do{ - z.next_out=buf; - z.next_out_index=0; - z.avail_out=BUFSIZE; - err=z.deflate(flushLevel); - if(err!=JZlib.Z_OK) - throw new IOException("deflating: "+z.msg); - if (z.avail_out < BUFSIZE) - { - outp.Write(buf, 0, BUFSIZE-z.avail_out); - } - } - while(z.avail_in>0 || z.avail_out==0); - } - - public override long Seek(long offset, SeekOrigin origin) { - // TODO: Add DeflaterOutputStream.Seek implementation - return 0; - } - - public override void SetLength(long value) { - // TODO: Add DeflaterOutputStream.SetLength implementation - - } - - public override int Read(byte[] buffer, int offset, int count) { - // TODO: Add DeflaterOutputStream.Read implementation - return 0; - } - - public override void Flush() { - outp.Flush(); - } - - public override void WriteByte(byte b) { - buf1[0]=(byte)b; - Write(buf1, 0, 1); - } - - public void Finish() { - int err; - do{ - z.next_out=buf; - z.next_out_index=0; - z.avail_out=BUFSIZE; - err=z.deflate(JZlib.Z_FINISH); - if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK) - throw new IOException("deflating: "+z.msg); - if(BUFSIZE-z.avail_out>0){ - outp.Write(buf, 0, BUFSIZE-z.avail_out); - } - } - while(z.avail_in>0 || z.avail_out==0); - Flush(); - } - - public void End() { - if(z==null) - return; - z.deflateEnd(); - z.free(); - z=null; - } - -#if PORTABLE - protected override void Dispose(bool disposing) - { - if (disposing) - { - try{ - try{Finish();} - catch (IOException) {} - } - finally{ - End(); - Platform.Dispose(outp); - outp=null; - } - } - base.Dispose(disposing); - } -#else - public override void Close() { - try{ - try{Finish();} - catch (IOException) {} - } - finally{ - End(); - Platform.Dispose(outp); - outp=null; - } - base.Close(); - } -#endif - } -} diff --git a/crypto/src/util/zlib/ZInflaterInputStream.cs b/crypto/src/util/zlib/ZInflaterInputStream.cs deleted file mode 100644 index ef742bb00..000000000 --- a/crypto/src/util/zlib/ZInflaterInputStream.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.IO; - -namespace Org.BouncyCastle.Utilities.Zlib { - /// <summary> - /// Summary description for DeflaterOutputStream. - /// </summary> - [Obsolete("Use 'ZInputStream' instead")] - public class ZInflaterInputStream : Stream { - protected ZStream z=new ZStream(); - protected int flushLevel=JZlib.Z_NO_FLUSH; - private const int BUFSIZE = 4192; - protected byte[] buf=new byte[BUFSIZE]; - private byte[] buf1=new byte[1]; - - protected Stream inp=null; - private bool nomoreinput=false; - - public ZInflaterInputStream(Stream inp) : this(inp, false) { - } - - public ZInflaterInputStream(Stream inp, bool nowrap) { - this.inp=inp; - z.inflateInit(nowrap); - z.next_in=buf; - z.next_in_index=0; - z.avail_in=0; - } - - public override bool CanRead { - get { - // TODO: Add DeflaterOutputStream.CanRead getter implementation - return true; - } - } - - public override bool CanSeek { - get { - // TODO: Add DeflaterOutputStream.CanSeek getter implementation - return false; - } - } - - public override bool CanWrite { - get { - // TODO: Add DeflaterOutputStream.CanWrite getter implementation - return false; - } - } - - public override long Length { - get { - // TODO: Add DeflaterOutputStream.Length getter implementation - return 0; - } - } - - public override long Position { - get { - // TODO: Add DeflaterOutputStream.Position getter implementation - return 0; - } - set { - // TODO: Add DeflaterOutputStream.Position setter implementation - } - } - - public override void Write(byte[] b, int off, int len) { - } - - public override long Seek(long offset, SeekOrigin origin) { - // TODO: Add DeflaterOutputStream.Seek implementation - return 0; - } - - public override void SetLength(long value) { - // TODO: Add DeflaterOutputStream.SetLength implementation - - } - - public override int Read(byte[] b, int off, int len) { - if(len==0) - return(0); - int err; - z.next_out=b; - z.next_out_index=off; - z.avail_out=len; - do { - if((z.avail_in==0)&&(!nomoreinput)) { // if buffer is empty and more input is avaiable, refill it - z.next_in_index=0; - z.avail_in=inp.Read(buf, 0, BUFSIZE);//(BUFSIZE<z.avail_out ? BUFSIZE : z.avail_out)); - if(z.avail_in<=0) { - z.avail_in=0; - nomoreinput=true; - } - } - err=z.inflate(flushLevel); - if(nomoreinput&&(err==JZlib.Z_BUF_ERROR)) - return(0); - if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END) - throw new IOException("inflating: "+z.msg); - if((nomoreinput||err==JZlib.Z_STREAM_END)&&(z.avail_out==len)) - return(0); - } - while(z.avail_out==len&&err==JZlib.Z_OK); - //System.err.print("("+(len-z.avail_out)+")"); - return(len-z.avail_out); - } - - public override void Flush() { - inp.Flush(); - } - - public override void WriteByte(byte b) { - } - -#if PORTABLE - protected override void Dispose(bool disposing) - { - if (disposing) - { - Platform.Dispose(inp); - } - base.Dispose(disposing); - } -#else - public override void Close() - { - Platform.Dispose(inp); - base.Close(); - } -#endif - - public override int ReadByte() { - if(Read(buf1, 0, 1)<=0) - return -1; - return(buf1[0]&0xFF); - } - } -} diff --git a/crypto/src/x509/IX509Extension.cs b/crypto/src/x509/IX509Extension.cs index e861e8736..a08f5e052 100644 --- a/crypto/src/x509/IX509Extension.cs +++ b/crypto/src/x509/IX509Extension.cs @@ -19,9 +19,6 @@ namespace Org.BouncyCastle.X509 /// <returns>IDictionary with string (OID) keys and Asn1OctetString values</returns> ISet GetNonCriticalExtensionOids(); - [Obsolete("Use version taking a DerObjectIdentifier instead")] - Asn1OctetString GetExtensionValue(string oid); - Asn1OctetString GetExtensionValue(DerObjectIdentifier oid); } } diff --git a/crypto/src/x509/X509ExtensionBase.cs b/crypto/src/x509/X509ExtensionBase.cs index aaf6695c0..af3907773 100644 --- a/crypto/src/x509/X509ExtensionBase.cs +++ b/crypto/src/x509/X509ExtensionBase.cs @@ -51,20 +51,7 @@ namespace Org.BouncyCastle.X509 return GetExtensionOids(true); } - /// <summary> - /// Get the value of a given extension. - /// </summary> - /// <param name="oid">The object ID of the extension. </param> - /// <returns>An Asn1OctetString object if that extension is found or null if not.</returns> - [Obsolete("Use version taking a DerObjectIdentifier instead")] - public Asn1OctetString GetExtensionValue( - string oid) - { - return GetExtensionValue(new DerObjectIdentifier(oid)); - } - - public virtual Asn1OctetString GetExtensionValue( - DerObjectIdentifier oid) + public virtual Asn1OctetString GetExtensionValue(DerObjectIdentifier oid) { X509Extensions exts = GetX509Extensions(); if (exts != null) diff --git a/crypto/src/x509/store/X509CertStoreSelector.cs b/crypto/src/x509/store/X509CertStoreSelector.cs index f92a4ac03..6ab610762 100644 --- a/crypto/src/x509/store/X509CertStoreSelector.cs +++ b/crypto/src/x509/store/X509CertStoreSelector.cs @@ -109,12 +109,6 @@ namespace Org.BouncyCastle.X509.Store set { issuer = value; } } - [Obsolete("Avoid working with X509Name objects in string form")] - public string IssuerAsString - { - get { return issuer != null ? issuer.ToString() : null; } - } - public bool[] KeyUsage { get { return CopyBoolArray(keyUsage); } diff --git a/crypto/test/src/asn1/test/PKCS10Test.cs b/crypto/test/src/asn1/test/PKCS10Test.cs index 28736b816..8bb6ccf0e 100644 --- a/crypto/test/src/asn1/test/PKCS10Test.cs +++ b/crypto/test/src/asn1/test/PKCS10Test.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using NUnit.Framework; @@ -46,8 +45,7 @@ namespace Org.BouncyCastle.Asn1.Tests { try { - CertificationRequest r = new CertificationRequest( - (Asn1Sequence)Asn1Object.FromByteArray(req)); + CertificationRequest r = CertificationRequest.GetInstance(req); byte[] bytes = r.GetDerEncoded(); if (!Arrays.AreEqual(bytes, req)) |