diff options
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/x500/DirectoryString.cs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/crypto/src/asn1/x500/DirectoryString.cs b/crypto/src/asn1/x500/DirectoryString.cs index c622113d4..aefb56512 100644 --- a/crypto/src/asn1/x500/DirectoryString.cs +++ b/crypto/src/asn1/x500/DirectoryString.cs @@ -4,11 +4,9 @@ using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X500 { - public class DirectoryString + public class DirectoryString : Asn1Encodable, IAsn1Choice, IAsn1String { - private readonly DerStringBase str; - public static DirectoryString GetInstance(object obj) { if (obj == null) @@ -55,23 +53,20 @@ namespace Org.BouncyCastle.Asn1.X500 ?? (DerStringBase)null; } - private DirectoryString( - DerStringBase str) - { - this.str = str; - } + private readonly DerStringBase m_str; - public DirectoryString( - string str) + private DirectoryString(DerStringBase str) { - this.str = new DerUtf8String(str); + m_str = str; } - public string GetString() + public DirectoryString(string str) { - return str.GetString(); + m_str = new DerUtf8String(str); } + public string GetString() => m_str.GetString(); + /** * <pre> * DirectoryString ::= CHOICE { @@ -82,9 +77,6 @@ namespace Org.BouncyCastle.Asn1.X500 * bmpString BMPString (SIZE (1..MAX)) } * </pre> */ - public override Asn1Object ToAsn1Object() - { - return str.ToAsn1Object(); - } + public override Asn1Object ToAsn1Object() => m_str.ToAsn1Object(); } } |