Esempio n. 1
0
 public void ClearPassphraseFunction()
 {
     EnsureValid();
     lock (CtxLock) {
         if (_passphrase_delegate != null)
         {
             libgpgme.NativeMethods.gpgme_set_passphrase_cb(CtxPtr, null, IntPtr.Zero);
             _passphrase_delegate = null;
             _passphrase_callback = null;
         }
     }
 }
Esempio n. 2
0
        public void SetPassphraseFunction(PassphraseDelegate func, IntPtr hook)
        {
            EnsureValid();
            lock (CtxLock) {
                if (_passphrase_delegate == null)
                {
                    _passphrase_callback = PassphraseCb;
                    libgpgme.NativeMethods.gpgme_set_passphrase_cb(CtxPtr, _passphrase_callback, hook);

                    _passphrase_delegate = func;
                }
                else
                {
                    throw new GpgmeException("Passphrase function is already set.");
                }
            }
        }
Esempio n. 3
0
 public void ClearPassphraseFunction()
 {
     if (IsValid)
     {
         lock (CtxLock) {
             if (_passphrase_delegate != null)
             {
                 libgpgme.gpgme_set_passphrase_cb(CtxPtr, null, IntPtr.Zero);
                 _passphrase_delegate = null;
                 _passphrase_callback = null;
             }
         }
     }
     else
     {
         throw new InvalidContextException();
     }
 }
 public void ClearPassphraseFunction()
 {
     if (IsValid)
     {
         lock (CtxLock)
         {
             if (passphraseFunc != null)
             {
                 libgpgme.gpgme_set_passphrase_cb(CtxPtr, null, (IntPtr)0);
                 passphraseFunc = null;
                 passphrase_cb  = null;
             }
         }
     }
     else
     {
         throw new InvalidContextException();
     }
 }
Esempio n. 5
0
        public void SetPassphraseFunction(PassphraseDelegate func, IntPtr hook)
        {
            if (IsValid)
            {
                lock (CtxLock) {
                    if (_passphrase_delegate == null)
                    {
                        _passphrase_callback = PassphraseCb;
                        libgpgme.gpgme_set_passphrase_cb(CtxPtr, _passphrase_callback, hook);

                        _passphrase_delegate = func;
                    }
                    else
                    {
                        throw new GpgmeException("Passphrase function is already set.");
                    }
                }
            }
            else
            {
                throw new InvalidContextException();
            }
        }
        public void SetPassphraseFunction(PassphraseDelegate func, IntPtr Hook)
        {
            if (IsValid)
            {
                lock (CtxLock)
                {
                    if (passphraseFunc == null)
                    {
                        passphrase_cb = new gpgme_passphrase_cb_t(_passphrase_cb);
                        libgpgme.gpgme_set_passphrase_cb(CtxPtr, passphrase_cb, Hook);

                        passphraseFunc = func;
                    }
                    else
                    {
                        throw new GpgmeException("Passphrase function is already set.");
                    }
                }
            }
            else
            {
                throw new InvalidContextException();
            }
        }
 public void SetPassphraseFunction(PassphraseDelegate func)
 {
     SetPassphraseFunction(func, IntPtr.Zero);
 }