The base64encoded version of this cert needs to be embedded in a manifest file to deploy to a target env. (outside the scope of this discussion.)
In powershell I can run:
[System.Convert]::toBase64String($(Get-Content .\cert.pfx -Encoding Byte)) and get a very long encoded string. I guess this is the encryption of both private and public keys.
Most everything I do in octopus resolves to the Base64Encryption of what I presume is only the Public key.
$OctopusVariables[“Certificate.pfx”] also resolves to a differing string. I don’t know why
Hi Mark,
When you run [System.Convert]::toBase64String($(Get-Content .\cert.pfx -Encoding Byte)) in PowerShell, this will give you the base64 encoded version of the encrypted cert.pfx file, as they are usually password protected.
The equivalent of this in terms of an Octopus variable would be $OctopusParameters["Certificate.RawOriginal"].
when using $OctopusParameters[“Certificate.pfx”] this would be the certificate in PKCS#12 format including the private key.
We also have a docs page here which explains the different variables accessible on the certificate.
I hope that helps, please let me know if you have any further questions.
Yes I’ve been through all the variables on that page.
Unfortunately in my testing those 2 (Base64 encoding on my local console, and the RawOriginal) are not equivalent.
I’ll continue via another option for now, thanks for the reply.