I'm looking for a way to install a PFX certificate into my azure scaleset and mark the private key as exportable.
Currently the certificate is installed on the cluster via the ARM template:
{
"certificateUrl": "https://xxx.vault.azure.net/secrets/xxx/111111",
"certificateStore": "My"
}
But the private key, which I need for local decryption, is not exportable.
I'm using bouncy castle to read create a AsymmetricCipherKeyPair:
DotNetUtilities.GetRsaKeyPair(privateKey)
(Which now throws a exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException:
at System.Security.Cryptography.CngKey.Export (System.Security.Cryptography.Cng, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
I read here that it should be defined in the policy that the key is exportable. But it is not possible to change the policy once the key is uploaded into the keyvault, but it is also not possible to set it up when you import the certificate.