Exemplo n.º 1
0
        private byte[] GetByteArrayAttribute(CMSG_GETPARAM_TYPE param, uint index)
        {
            // Get the length of the attribute
            uint valueLength = 0;

            NativeUtils.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                                          _handle,
                                          param,
                                          index,
                                          null,
                                          ref valueLength));

            // Now allocate some memory for it
            byte[] data = new byte[(int)valueLength];

            // Get the actual digest
            NativeUtils.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                                          _handle,
                                          param,
                                          index,
                                          data,
                                          ref valueLength));

            return(data);
        }
Exemplo n.º 2
0
        private byte[] GetByteArrayAttribute(CMSG_GETPARAM_TYPE param, uint index)
        {
            uint valueLength = 0;

            NativeUtilities.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                                              _handle,
                                              param,
                                              index,
                                              null,
                                              ref valueLength));

            var data = new byte[(int)valueLength];

            NativeUtilities.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                                              _handle,
                                              param,
                                              index,
                                              data,
                                              ref valueLength));

            return(data);
        }
Exemplo n.º 3
0
 internal static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     IntPtr pvData,
     ref uint pcbData);
Exemplo n.º 4
0
 public static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     byte[] pvData,
     ref uint pcbData);
Exemplo n.º 5
0
 public static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     byte[] pvData,
     ref uint pcbData);
Exemplo n.º 6
0
        private byte[] GetByteArrayAttribute(CMSG_GETPARAM_TYPE param, uint index)
        {
            // Get the length of the attribute
            uint valueLength = 0;
            NativeUtils.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                _handle,
                param,
                index,
                null,
                ref valueLength));

            // Now allocate some memory for it
            byte[] data = new byte[(int)valueLength];

            // Get the actual digest
            NativeUtils.ThrowIfFailed(NativeMethods.CryptMsgGetParam(
                _handle,
                param,
                index,
                data,
                ref valueLength));

            return data;
        }