Decode() public méthode

Creates the original byte stream for a PGP word list encoding.
The words argument is null /// The words argument is not a valid PGP word list encoding ///
public Decode ( string words ) : byte[]
words string The encoded byte stream
Résultat byte[]
Exemple #1
0
        private static byte[] DecodeUserInput(string userInput, PgpWordList pgpWordList)
        {
            byte[] seed;
            if (Hexadecimal.TryDecode(userInput, out seed))
                return seed;

            var splitInput = userInput.Split(new char[0], StringSplitOptions.RemoveEmptyEntries);
            if (splitInput.Length == 1)
            {
                // Hex decoding failed, but it's not a multi-word mneumonic either.
                // Assume the user intended hex.
                throw new HexadecimalEncodingException();
            }
            return pgpWordList.Decode(splitInput);
        }
Exemple #2
0
        private static byte[] DecodeUserInput(string userInput, PgpWordList pgpWordList)
        {
            byte[] seed;
            if (Hexadecimal.TryDecode(userInput, out seed))
            {
                return(seed);
            }

            var splitInput = userInput.Split(new char[0], StringSplitOptions.RemoveEmptyEntries);

            if (splitInput.Length == 1)
            {
                // Hex decoding failed, but it's not a multi-word mneumonic either.
                // Assume the user intended hex.
                throw new HexadecimalEncodingException();
            }
            return(pgpWordList.Decode(splitInput));
        }