Inheritance: DerStringBase
コード例 #1
0
 public override Asn1Object GetConvertedValue(DerObjectIdentifier oid, string value)
 {
     var result = base.GetConvertedValue(oid, value);
     if (result is DerUtf8String)
     {
         result = new DerPrintableString(value);
     }
     return result;
 }
コード例 #2
0
        protected override bool Asn1Equals(Asn1Object asn1Object)
        {
            DerPrintableString derPrintableString = asn1Object as DerPrintableString;

            if (derPrintableString == null)
            {
                return(false);
            }
            return(str.Equals(derPrintableString.str));
        }
コード例 #3
0
        public static DerPrintableString GetInstance(Asn1TaggedObject obj, bool isExplicit)
        {
            Asn1Object @object = obj.GetObject();

            if (isExplicit || @object is DerPrintableString)
            {
                return(DerPrintableString.GetInstance(@object));
            }
            return(new DerPrintableString(Asn1OctetString.GetInstance(@object).GetOctets()));
        }
コード例 #4
0
        protected override bool Asn1Equals(Asn1Object asn1Object)
        {
            DerPrintableString str = asn1Object as DerPrintableString;

            if (str == null)
            {
                return(false);
            }
            return(this.str.Equals(str.str));
        }
コード例 #5
0
 public DerPrintableString(string str, bool validate)
 {
     if (str == null)
     {
         throw new ArgumentNullException("str");
     }
     if (validate && !DerPrintableString.IsPrintableString(str))
     {
         throw new ArgumentException("string contains illegal characters", "str");
     }
     this.str = str;
 }
コード例 #6
0
        protected override bool Asn1Equals(
            Asn1Object obj)
        {
            DerPrintableString other = obj as DerPrintableString;

            if (other == null)
            {
                return(false);
            }

            return(this.str.Equals(other.str));
        }
コード例 #7
0
        protected override bool Asn1Equals(Asn1Object asn1Object)
        {
            DerPrintableString derPrintableString = asn1Object as DerPrintableString;

            return(derPrintableString != null && this.str.Equals(derPrintableString.str));
        }