コード例 #1
0
ファイル: NativeCms.cs プロジェクト: rodcarls/Signing
        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);
        }
コード例 #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);
        }
コード例 #3
0
 internal static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     IntPtr pvData,
     ref uint pcbData);
コード例 #4
0
 public static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     byte[] pvData,
     ref uint pcbData);
コード例 #5
0
ファイル: NativeMethods.cs プロジェクト: hishamco/Signing
 public static extern bool CryptMsgGetParam(
     SafeCryptMsgHandle hCryptMsg,
     CMSG_GETPARAM_TYPE dwParamType,
     uint dwIndex,
     byte[] pvData,
     ref uint pcbData);
コード例 #6
0
ファイル: NativeCms.cs プロジェクト: hishamco/Signing
        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;
        }