コード例 #1
0
 // Implements RopPassCallBack
 public RopPassCallBack.Ret PassCallBack(RopHandle ffi, object ctx, RopHandle key, RopHandle pgpCtx, RopHandle buf, int bufLen)
 {
     if (passProvider != null)
     {
         // create new Session and Key handlers
         RopSession ropSes = null;
         RopKey     ropKey = null;
         try {
             if (own.TryGetTarget(out RopBind bind))
             {
                 ropSes = (!ffi.IsNull()? new RopSession(bind, ffi) : null);
                 ropKey = (!key.IsNull()? new RopKey(bind, key) : null);
                 SessionPassCallBack.Ret scbRet = passProvider.PassCallBack(ropSes, ctx, ropKey, RopHandle.Str(pgpCtx), bufLen);
                 return(new RopPassCallBack.Ret(scbRet.ret, scbRet.outBuf));
             }
             throw new RopError(RopBind.ROP_ERROR_INTERNAL);
         } catch (RopError) {
         } finally {
             if (ropSes != null)
             {
                 ropSes.Detach();
             }
             if (ropKey != null)
             {
                 ropKey.Detach();
             }
         }
     }
     return(new RopPassCallBack.Ret(false, null));
 }
コード例 #2
0
ファイル: RopIO.cs プロジェクト: joke325/Dotrop
 internal void Attach(RopHandle iid)
 {
     if (iid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.iid = iid;
 }
コード例 #3
0
 internal RopIdIterator(RopBind own, RopHandle iiid)
 {
     if (iiid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.lib  = own.getLib();
     this.iiid = iiid;
 }
コード例 #4
0
ファイル: RopSign.cs プロジェクト: joke325/Dotrop
 public RopSignSignature(RopBind own, RopHandle sgid)
 {
     if (sgid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.lib  = own.getLib();
     this.sgid = sgid;
 }
コード例 #5
0
 internal RopSymEnc(RopBind own, RopHandle seid)
 {
     if (seid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own  = new WeakReference <RopBind>(own);
     this.lib  = own.getLib();
     this.seid = seid;
 }
コード例 #6
0
 internal RopRecipient(RopBind own, RopHandle rid)
 {
     if (rid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own = new WeakReference <RopBind>(own);
     this.lib = own.getLib();
     this.rid = rid;
 }
コード例 #7
0
 internal RopOpEncrypt(RopBind own, RopHandle opid)
 {
     if (opid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own  = new WeakReference <RopBind>(own);
     this.lib  = own.getLib();
     this.opid = opid;
 }
コード例 #8
0
ファイル: RopSign.cs プロジェクト: joke325/Dotrop
 public RopVeriSignature(RopBind own, RopHandle sgid)
 {
     if (sgid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own  = new WeakReference <RopBind>(own);
     this.lib  = own.getLib();
     this.sgid = sgid;
 }
コード例 #9
0
ファイル: RopIO.cs プロジェクト: joke325/Dotrop
 internal RopInput(RopBind own, RopHandle iid)
 {
     if (iid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own     = new WeakReference <RopBind>(own);
     this.lib     = own.getLib();
     this.iid     = iid;
     this.inputCB = null;
 }
コード例 #10
0
 internal RopSession(RopBind own, RopHandle sid)
 {
     if (sid.IsNull())
     {
         throw new RopError(RopBind.ROP_ERROR_NULL_HANDLE);
     }
     this.own          = new WeakReference <RopBind>(own);
     this.lib          = own.getLib();
     this.sid          = sid;
     this.passProvider = null;
     this.keyProvider  = null;
 }
コード例 #11
0
 // Implements RopKeyCallBack
 public void KeyCallBack(RopHandle ffi, object ctx, RopHandle identifierType, RopHandle identifier, bool secret)
 {
     if (keyProvider != null)
     {
         // create a new Session handler
         RopSession ropSes = null;
         try {
             if (own.TryGetTarget(out RopBind bind))
             {
                 ropSes = (!ffi.IsNull()? new RopSession(bind, ffi) : null);
                 keyProvider.KeyCallBack(ropSes, ctx, RopHandle.Str(identifierType), RopHandle.Str(identifier), secret);
             }
             throw new RopError(RopBind.ROP_ERROR_INTERNAL);
         } catch (RopError) {
         } finally {
             if (ropSes != null)
             {
                 ropSes.Detach();
             }
         }
     }
 }