41 references to NativeMethods
NuGet.Packaging (41)
Signing\Cms\NativeCms.cs (27)
39
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
48
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
87
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
101
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
131
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptDecodeObject(
133
new IntPtr(
NativeMethods
.PKCS7_SIGNER_INFO),
142
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptDecodeObject(
144
new IntPtr(
NativeMethods
.PKCS7_SIGNER_INFO),
216
var handle =
NativeMethods
.CryptMsgOpenToDecode(
229
if (!
NativeMethods
.CryptMsgUpdate(handle, input, (uint)input.Length, fFinal: true))
255
if (!
NativeMethods
.CryptMsgControl(
273
NativeUtility.ThrowIfFailed(
NativeMethods
.CryptMsgCountersign(
304
if (!
NativeMethods
.CryptMsgControl(
349
if (!
NativeMethods
.CryptEncodeObjectEx(
351
lpszStructType: new IntPtr(
NativeMethods
.PKCS7_SIGNER_INFO),
359
if (err !=
NativeMethods
.ERROR_MORE_DATA)
361
Marshal.ThrowExceptionForHR(
NativeMethods
.GetHRForWin32Error(err));
366
if (!
NativeMethods
.CryptEncodeObjectEx(
368
lpszStructType: new IntPtr(
NativeMethods
.PKCS7_SIGNER_INFO),
403
if (!
NativeMethods
.CryptMsgControl(
425
if (!
NativeMethods
.CryptMsgControl(
465
if (!
NativeMethods
.CryptEncodeObjectEx(
467
lpszStructType: new IntPtr(
NativeMethods
.PKCS_ATTRIBUTE),
475
if (err !=
NativeMethods
.ERROR_MORE_DATA)
477
Marshal.ThrowExceptionForHR(
NativeMethods
.GetHRForWin32Error(err));
482
if (!
NativeMethods
.CryptEncodeObjectEx(
484
lpszStructType: new IntPtr(
NativeMethods
.PKCS_ATTRIBUTE),
Signing\Cms\NativeMethods.cs (2)
154
return
NativeMethods
.CryptMsgClose(handle);
340
if (!hCryptProvOrhNCryptKey.Equals(IntPtr.Zero)) {
NativeMethods
.CryptReleaseContext(hCryptProvOrhNCryptKey, 0); }
Signing\Cms\NativeUtility.cs (12)
66
var hMsg =
NativeMethods
.CryptMsgOpenToEncode(
69
dwMsgType:
NativeMethods
.CMSG_SIGNED,
76
ThrowIfFailed(
NativeMethods
.CryptMsgUpdate(
84
ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
93
ThrowIfFailed(
NativeMethods
.CryptMsgGetParam(
128
certContextHandle =
NativeMethods
.CertDuplicateCertificateContext(cmsSigner.Certificate.Handle);
133
ThrowIfFailed(
NativeMethods
.CertGetCertificateContextProperty(
135
NativeMethods
.CERT_KEY_IDENTIFIER_PROP_ID,
143
ThrowIfFailed(
NativeMethods
.CertGetCertificateContextProperty(
145
NativeMethods
.CERT_KEY_IDENTIFIER_PROP_ID,
149
signerInfo.SignerId.dwIdChoice =
NativeMethods
.CERT_ID_KEY_IDENTIFIER;
158
NativeMethods
.CertFreeCertificateContext(certContextHandle);