/// <summary>
        /// Creates the signature of a message
        /// </summary>
        public byte[] CreateSignature(SecurityContext context, byte[] message)
        {
            // parameters validation
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            // prepare buffers
            SecurityBuffers inputBuffers = new SecurityBuffers(2);

            inputBuffers.SetBuffer(0, (int)SSPINative.SECBUFFER_DATA, message);
            inputBuffers.SetBuffer(1, (int)SSPINative.SECBUFFER_TOKEN, context.MaxSignature);

            // create signature
            Int64 contextHandle = context.Handle;
            int   error         = SSPINative.MakeSignature(
                ref contextHandle,
                0,
                inputBuffers,
                0);

            if (error < 0)
            {
                throw new SSPIException(error, "Could not create signature");
            }

            // get signature
            byte[] signature = inputBuffers.GetBuffer(1);
            inputBuffers.Dispose();

            return(signature);
        }