public int EncryptMessage(ref MSI.IBufferOffsetSize incoming) { var buffer = new MSI.TlsBuffer(BOSWrapper.Wrap(incoming)); var retval = Context.EncryptMessage(ref buffer); incoming = BOSWrapper.Wrap(buffer.GetRemaining()); return((int)retval); }
public int DecryptMessage(ref MSI.IBufferOffsetSize incoming) { var buffer = new TlsBuffer(BOSWrapper.Wrap(incoming)); var retval = Context.DecryptMessage(ref buffer); incoming = buffer != null?BOSWrapper.Wrap(buffer.GetRemaining()) : null; return((int)retval); }
public int GenerateNextToken(MSI.IBufferOffsetSize incoming, out MSI.IBufferOffsetSize outgoing) { var input = incoming != null ? new MSI.TlsBuffer(BOSWrapper.Wrap(incoming)) : null; var output = new MSI.TlsMultiBuffer(); var retval = Context.GenerateNextToken(input, output); if (output.IsEmpty) { outgoing = null; } outgoing = BOSWrapper.Wrap(output.StealBuffer()); return((int)retval); }