'sign a string suitable for transmission, returning the signature.
Passing the data and signature to verify will determine if the data
is unchanged.'

def sign(self, data):

    pkg_size_info = self.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES)
    sigsize = pkg_size_info['MaxSignature']
    sigbuf = win32security.PySecBufferDescType()
    sigbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA))
    sigbuf.append(win32security.PySecBufferType(sigsize, sspicon.SECBUFFER_TOKEN))
    sigbuf[0].Buffer = data
    self.ctxt.MakeSignature(0, sigbuf, self._get_next_seq_num())
    return sigbuf[1].Buffer
