Esempio n. 1
0
        // internal AND protected
        internal void WritePassword(SecureString password)
        {
            if (_process == null)
            {
                return;
            }

            if (!password.IsReadOnly())
            {
                throw new GpgApiException("The SecureString \"password\" must be readonly");
            }

            using (SecureStringToCharArrayMarshaler m = new SecureStringToCharArrayMarshaler(password))
            {
                _process.StandardInput.Write(m.Value);
                _process.StandardInput.WriteLine();
            }
        }
Esempio n. 2
0
        // internal AND protected
        internal void WritePassword(SecureString password)
        {
            if (_process == null)
                return;

            if (!password.IsReadOnly())
                throw new GpgApiException("The SecureString \"password\" must be readonly");

            using (SecureStringToCharArrayMarshaler m = new SecureStringToCharArrayMarshaler(password))
            {
                _process.StandardInput.Write(m.Value);
                _process.StandardInput.WriteLine();
            }
        }