If I were to guess, enumerator.Current returns a string and not a byte[] - if this is the case you already have what you want, or at least you have string.
Apart from that, you should probably do something like:
IEnumerable collection = (IEnumerable)result.Properties["CacheCredVal"];
foreach( object element in collection )
{
string password = element.ToString();
}
It's also possible that the data is base 64 encoded, so perhaps something like this will help:
IEnumerable collection = (IEnumerable)result.Properties["CacheCredVal"];
foreach( object element in collection )
{
byte[] encodedDataAsBytes = System.Convert.FromBase64String(element.ToString());
string password = Encoding.Default.GetString(encodedDataAsBytes);
}
foreach
gets the IEnumerator from an IEnumerable object and iterates over the collection.
Best regards
Espen Harlinn