From 84a1abd2bb12af82623c136243240e52a88e0bf4 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 21 Jun 2022 18:57:52 +0700 Subject: ObsoleteAttribute cleanup --- crypto/src/asn1/x509/AlgorithmIdentifier.cs | 13 ----- crypto/src/asn1/x509/AttributeTable.cs | 18 ------ crypto/src/asn1/x509/ExtendedKeyUsage.cs | 17 ------ crypto/src/asn1/x509/SubjectDirectoryAttributes.cs | 9 --- crypto/src/asn1/x509/SubjectPublicKeyInfo.cs | 13 ----- crypto/src/asn1/x509/X509Extensions.cs | 65 ---------------------- 6 files changed, 135 deletions(-) (limited to 'crypto/src/asn1/x509') 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; } - } - /// /// Return the parameters structure in the Parameters entry of this identifier. /// 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 @@ -78,19 +78,6 @@ namespace Org.BouncyCastle.Asn1.X509 return Asn1Object.FromByteArray(keyData.GetOctets()); } - /** - * 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... */ 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. - *

- * it's is assumed the table contains Oid/string pairs.

- */ - [Obsolete] - public X509Extensions( - Hashtable extensions) - : this(null, extensions) - { - } - - /** - * Constructor from a table of extensions with ordering. - *

- * It's is assumed the table contains Oid/string pairs.

- */ - [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. */ -- cgit 1.4.1