diff options
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/x509/qualified/SemanticsInformation.cs | 19 | ||||
-rw-r--r-- | crypto/test/src/asn1/test/SemanticsInformationUnitTest.cs | 2 |
2 files changed, 16 insertions, 5 deletions
diff --git a/crypto/src/asn1/x509/qualified/SemanticsInformation.cs b/crypto/src/asn1/x509/qualified/SemanticsInformation.cs index c82e5f1a1..bb660fe63 100644 --- a/crypto/src/asn1/x509/qualified/SemanticsInformation.cs +++ b/crypto/src/asn1/x509/qualified/SemanticsInformation.cs @@ -25,18 +25,29 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return null; if (obj is SemanticsInformation semanticsInformation) return semanticsInformation; +#pragma warning disable CS0618 // Type or member is obsolete return new SemanticsInformation(Asn1Sequence.GetInstance(obj)); +#pragma warning restore CS0618 // Type or member is obsolete } - public static SemanticsInformation GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) => - new SemanticsInformation(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); + public static SemanticsInformation GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { +#pragma warning disable CS0618 // Type or member is obsolete + return new SemanticsInformation(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); +#pragma warning restore CS0618 // Type or member is obsolete + } - public static SemanticsInformation GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit) => - new SemanticsInformation(Asn1Sequence.GetTagged(taggedObject, declaredExplicit)); + public static SemanticsInformation GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit) + { +#pragma warning disable CS0618 // Type or member is obsolete + return new SemanticsInformation(Asn1Sequence.GetTagged(taggedObject, declaredExplicit)); +#pragma warning restore CS0618 // Type or member is obsolete + } private readonly DerObjectIdentifier m_semanticsIdentifier; private readonly GeneralName[] m_nameRegistrationAuthorities; + [Obsolete("Use 'GetInstance' instead")] public SemanticsInformation(Asn1Sequence seq) { int count = seq.Count, pos = 0; diff --git a/crypto/test/src/asn1/test/SemanticsInformationUnitTest.cs b/crypto/test/src/asn1/test/SemanticsInformationUnitTest.cs index 8fb29d9ad..ed73cceca 100644 --- a/crypto/test/src/asn1/test/SemanticsInformationUnitTest.cs +++ b/crypto/test/src/asn1/test/SemanticsInformationUnitTest.cs @@ -58,7 +58,7 @@ namespace Org.BouncyCastle.Asn1.Tests try { - new SemanticsInformation(DerSequence.Empty); + SemanticsInformation.GetInstance(DerSequence.Empty); Fail("constructor failed to detect empty sequence."); } |