public static string GetHumanReadableNetworkAuthenticationType(NetworkAuthenticationType networkAuthenticationType) { string type = "-/-"; switch (networkAuthenticationType) { case NetworkAuthenticationType.Open80211: type = "Open"; break; case NetworkAuthenticationType.Rsna: type = "WPA2 Enterprise"; break; case NetworkAuthenticationType.RsnaPsk: type = "WPA2 PSK"; break; case NetworkAuthenticationType.Wpa: type = "WPA Enterprise"; break; case NetworkAuthenticationType.WpaNone: type = "WPA None"; break; case NetworkAuthenticationType.WpaPsk: type = "WPA PSK"; break; case NetworkAuthenticationType.SharedKey80211: type = "WEP"; break; case NetworkAuthenticationType.Ihv: type = "IHV"; break; case NetworkAuthenticationType.Unknown: type = "Unkown"; break; case NetworkAuthenticationType.None: type = "-/-"; break; } return(type); }
private string ConvertHexToPassPhrase(NetworkAuthenticationType authType, string presharedKey) { // If this is a WPA/WPA2-PSK type network then convert the HEX STRING back to a passphrase // Note that a 64 character WPA/2 network key is expected as a 128 character HEX-ized that will be // converted back to a 64 character network key. if ((authType == NetworkAuthenticationType.WpaPsk) || (authType == NetworkAuthenticationType.RsnaPsk)) { var tempBuffer = CryptographicBuffer.DecodeFromHexString(presharedKey); var hexString = CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, tempBuffer); return(hexString); } // If this is a WEP key then it should arrive here as a 10 or 26 character hex-ized // string which will be passed straight through return(presharedKey); }
public static string GetHumanReadableNetworkAuthenticationType(NetworkAuthenticationType networkAuthenticationType) { switch (networkAuthenticationType) { case NetworkAuthenticationType.Open80211: return("Open"); case NetworkAuthenticationType.Rsna: return("WPA2 Enterprise"); case NetworkAuthenticationType.RsnaPsk: return("WPA2 PSK"); case NetworkAuthenticationType.Wpa: return("WPA Enterprise"); case NetworkAuthenticationType.WpaNone: return("WPA None"); case NetworkAuthenticationType.WpaPsk: return("WPA PSK"); case NetworkAuthenticationType.SharedKey80211: return("WEP"); case NetworkAuthenticationType.Ihv: return("IHV"); case NetworkAuthenticationType.Unknown: return("Unkown"); case NetworkAuthenticationType.None: return("-/-"); } return("-/-"); }
public static NetAuthenticationType Convert(this NetworkAuthenticationType authenticationType) { return(EnumHelpers.ToEnum <NetAuthenticationType>( EnumHelpers.ToInt(authenticationType))); }