Issue Signing MSI File with SignTool in PowerShell - Unhandled Exception - Stack Overflow

I'm trying to sign my MSI file using the following PowerShell command:& "C:Program File

I'm trying to sign my MSI file using the following PowerShell command:

& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool.exe" sign /v /fd SHA256 /tr "; /td SHA256 /dlib "C:\Users\DELL\AppData\Local\Microsoft\MicrosoftTrustedSigningClientTools\Azure.CodeSigning.Dlib.dll" /dmdf "D:\APPSign\metadata.json" "D:\Projects\App\APPWPF\Debug\APPWPF.msi"

However, I am encountering the following error:

Trusted Signing

Version: 1.0.68

"Metadata": { "Endpoint": "", // here I have added URL for my selected region "CodeSigningAccountName": "myapp",
"ExcludeCredentials": [] }

Submitting digest for signing... Unhandled managed exception System.ArgumentNullException: Value cannot be null. (Parameter 'certificateProfileName') at Azure.CodeSigning.CertificateProfileClient.StartSignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.SignAsync(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.Sign(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle) at AuthenticodeDigestSignExWithFileHandleManaged(_CRYPTOAPI_BLOB* pMetadataBlob, UInt32 digestAlgId, Byte* pbToBeSignedDigest, UInt32 cbToBeSignedDigest, Void* hFile, _CRYPTOAPI_BLOB* pSignedDigest, _CERT_CONTEXT** ppSignerCert, Void* hCertChainStore)

SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign() failed." (-2147467259/0x80004005)

Currently, my metadata.json file contains the following:

{
  "Endpoint": "", // here I have added URL for my selected region
  "CodeSigningAccountName": "myapp",
  "SigningProfileName": "myapp", // account and certificate name is same 
}

Are there any other required fields that I might be missing in the JSON file? Or I am filling wrong value here? What could be causing the System.ArgumentNullException related to certificateProfileName?

I'm trying to sign my MSI file using the following PowerShell command:

& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool.exe" sign /v /fd SHA256 /tr "http://tsa.msign.microsoft" /td SHA256 /dlib "C:\Users\DELL\AppData\Local\Microsoft\MicrosoftTrustedSigningClientTools\Azure.CodeSigning.Dlib.dll" /dmdf "D:\APPSign\metadata.json" "D:\Projects\App\APPWPF\Debug\APPWPF.msi"

However, I am encountering the following error:

Trusted Signing

Version: 1.0.68

"Metadata": { "Endpoint": "", // here I have added URL for my selected region "CodeSigningAccountName": "myapp",
"ExcludeCredentials": [] }

Submitting digest for signing... Unhandled managed exception System.ArgumentNullException: Value cannot be null. (Parameter 'certificateProfileName') at Azure.CodeSigning.CertificateProfileClient.StartSignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.SignAsync(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.Sign(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle) at AuthenticodeDigestSignExWithFileHandleManaged(_CRYPTOAPI_BLOB* pMetadataBlob, UInt32 digestAlgId, Byte* pbToBeSignedDigest, UInt32 cbToBeSignedDigest, Void* hFile, _CRYPTOAPI_BLOB* pSignedDigest, _CERT_CONTEXT** ppSignerCert, Void* hCertChainStore)

SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign() failed." (-2147467259/0x80004005)

Currently, my metadata.json file contains the following:

{
  "Endpoint": "", // here I have added URL for my selected region
  "CodeSigningAccountName": "myapp",
  "SigningProfileName": "myapp", // account and certificate name is same 
}

Are there any other required fields that I might be missing in the JSON file? Or I am filling wrong value here? What could be causing the System.ArgumentNullException related to certificateProfileName?

Share Improve this question asked Mar 21 at 9:13 MANSIMANSI 593 silver badges8 bronze badges 1
  • Maybe an authentication issue? Is the Azure CLI installed and configured for your account? – Emmanuel Bourg Commented Mar 21 at 15:51
Add a comment  | 

1 Answer 1

Reset to default 0

The issue resolved when i made changes in metadata.josn file:

{
    "Endpoint": "",
    "CodeSigningAccountName": "myapp",
    "CertificateProfileName": "myapp"
}

Here i replace SigningProfileName with CertificateProfileName and it worked

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744364119a4570613.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信