How to use the output from Invoke-KMSSigning? Trying to re-sign a CSR to obtain a codesign certificate from third party. #359
-
I am trying to workaround the need for expensive CloudHSM by using a CSR (generated by the free DigiCert Certificate Utility for Windows) that gets re-signed with a key from AWS KMS, which I then want to feed to FastSSL with the hope of being able to use the resulting codesigning certificate on a remote-continuous-integration machine without a usb hardware dongle. The re-signing of the CSR seems possible with Python and I thought it should also be possible with PowerShell. Python: This is my PowerShell code:
The output from the PowerShell IDE is
These fields seem to be properties of the System.IO.MemoryStream. How do I get my re-signed CSR into a file? I tried Out-File and -Select '*' and ToString(). All I ever get is the datatype of MemoryStream or the above list of properties. I realize this is a bit of a wild goose chase. Nonetheless, even if this way of codesigning Windows EXEs turns out to be impossible, I would appreciate finding out whether there is a way to use Invoke-KMSSigning to get the result of the signing process. Here is an example where a file is signed using the 'sign' method of AWS KMS using AWS command line: https://www.youtube.com/watch?v=8VxCDHgJOlU (Digital Signing with AWS KMS by Zeal Vora) and this makes me think I need to pipe the output of the signing process in a way that concatenates it into the original file. Here is aws cli syntax which generates a signature as shown in the video, using my key-id, same region, same algorithm, same input data:
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
MemoryStream
can be converted to a string by using the following code in PowerShell. After you have a string, you can useOut-File
to write to file