public unsafe void CheckHash()
 {
     int size = Marshal.SizeOf(typeof(System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA));
     System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA cmsg_ctrl_verify_signature_ex_para = new System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA(size) {
         dwSignerType = 4,
         dwSignerIndex = (uint) PkcsUtils.GetSignerIndex(this.m_signedCms.GetCryptMsgHandle(), this, 0)
     };
     if (!System.Security.Cryptography.CAPI.CryptMsgControl(this.m_signedCms.GetCryptMsgHandle(), 0, 0x13, new IntPtr((void*) &cmsg_ctrl_verify_signature_ex_para)))
     {
         throw new CryptographicException(Marshal.GetLastWin32Error());
     }
 }
Esempio n. 2
0
        public unsafe void CheckHash()
        {
            int size = Marshal.SizeOf(typeof(System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA));

            System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA cmsg_ctrl_verify_signature_ex_para = new System.Security.Cryptography.CAPI.CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA(size)
            {
                dwSignerType  = 4,
                dwSignerIndex = (uint)PkcsUtils.GetSignerIndex(this.m_signedCms.GetCryptMsgHandle(), this, 0)
            };
            if (!System.Security.Cryptography.CAPI.CryptMsgControl(this.m_signedCms.GetCryptMsgHandle(), 0, 0x13, new IntPtr((void *)&cmsg_ctrl_verify_signature_ex_para)))
            {
                throw new CryptographicException(Marshal.GetLastWin32Error());
            }
        }