string DecodePassword (string password, MembershipPasswordFormat passwordFormat)
{
switch (passwordFormat) {
case MembershipPasswordFormat.Clear:
return password;
case MembershipPasswordFormat.Hashed:
throw new ProviderException ("Hashed passwords cannot be decoded.");
case MembershipPasswordFormat.Encrypted:
return Encoding.Unicode.GetString (DecryptPassword (Convert.FromBase64String (password)));
default:
/* not reached.. */
return null;
}
}