public static string FormatName(MonoBtlsX509Name name, X500DistinguishedNameFlags flag) { if ((flag != 0) && ((flag & AllFlags) == 0)) { throw new ArgumentException("flag"); } if (name.GetEntryCount() == 0) { return(String.Empty); } // Mono.Security reversed isn't the same as fx 2.0 (which is the reverse of 1.x) bool reversed = ((flag & X500DistinguishedNameFlags.Reversed) != 0); bool quotes = ((flag & X500DistinguishedNameFlags.DoNotUseQuotes) == 0); string separator = GetSeparator(flag); return(FormatName(name, reversed, separator, quotes)); }
public static string FormatName(MonoBtlsX509Name name, bool reversed, string separator, bool quotes) { var count = name.GetEntryCount(); StringBuilder sb = new StringBuilder(); if (reversed) { for (int i = count - 1; i >= 0; i--) { AppendEntry(sb, name, i, separator, quotes); } } else { for (int i = 0; i < count; i++) { AppendEntry(sb, name, i, separator, quotes); } } return(sb.ToString()); }
public static string FormatName (MonoBtlsX509Name name, bool reversed, string separator, bool quotes) { var count = name.GetEntryCount (); StringBuilder sb = new StringBuilder (); if (reversed) { for (int i = count - 1; i >= 0; i--) { AppendEntry (sb, name, i, separator, quotes); } } else { for (int i = 0; i < count; i++) { AppendEntry (sb, name, i, separator, quotes); } } return sb.ToString (); }
public static string FormatName (MonoBtlsX509Name name, X500DistinguishedNameFlags flag) { if ((flag != 0) && ((flag & AllFlags) == 0)) throw new ArgumentException ("flag"); if (name.GetEntryCount () == 0) return String.Empty; // Mono.Security reversed isn't the same as fx 2.0 (which is the reverse of 1.x) bool reversed = ((flag & X500DistinguishedNameFlags.Reversed) != 0); bool quotes = ((flag & X500DistinguishedNameFlags.DoNotUseQuotes) == 0); string separator = GetSeparator (flag); return FormatName (name, reversed, separator, quotes); }