1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

証明書チェーンは処理されましたが、 信頼プロバイダーが信頼していないルート証明書で強制終了しましたと表示される

Last updated at Posted at 2024-01-21

このエラーメッセージは、証明書の信頼性に関連しています。以下の手順で問題を解決できるかもしれません。

  1. 信頼されたルート証明書のエクスポート:

    • 証明書を信頼するために、まず、自己署名証明書のルート証明書をエクスポートします。

      # ルート証明書をエクスポート
      $rootCertPath = "C:\Users\ユーザ名\Desktop\共有フォルダ\CodeSigningCertificate.cer"
      $rootCert = Get-ChildItem -Path Cert:\CurrentUser\Root | Where-Object { $_.Subject -eq $subject }
      Export-Certificate -Cert $rootCert -FilePath $rootCertPath
      
  2. 信頼されたルート証明書のインポート:

    • エクスポートしたルート証明書を信頼されたルート証明書ストアにインポートします。

      # ルート証明書を信頼されたルート証明書ストアにインポート
      Import-Certificate -FilePath $rootCertPath -CertStoreLocation Cert:\CurrentUser\Root
      
  3. 再度署名:

    • インポートが完了したら、再度スクリプトに署名を試みてください。

      # 証明書を読み込み
      $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath, "YourPassword")
      
      # スクリプトにコード署名用証明書を埋め込み
      Set-AuthenticodeSignature -Certificate $cert -FilePath "C:\Users\ユーザ名\Desktop\共有フォルダ\password.ps1"
      

この手順を試してみてください。もし問題が続く場合は、証明書の信頼性や設定に関する詳細な情報が必要となります。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?