Introducing KubernetesClientConfiguration.ClientCertificateKeyStoreFl… (#237)

* Introducing KubernetesClientConfiguration.ClientCertificateKeyStoreFlags to specify how private key is imported

* Type-o
This commit is contained in:
maganvill
2019-02-07 07:58:08 +01:00
committed by Kubernetes Prow Robot
parent 4d193e4c1c
commit 9bbe42201f
2 changed files with 14 additions and 1 deletions

View File

@@ -90,7 +90,15 @@ namespace k8s
using (var pkcs = new MemoryStream())
{
store.Save(pkcs, new char[0], new SecureRandom());
return new X509Certificate2(pkcs.ToArray());
if (config.ClientCertificateKeyStoreFlags.HasValue)
{
return new X509Certificate2(pkcs.ToArray(), "", config.ClientCertificateKeyStoreFlags.Value);
}
else
{
return new X509Certificate2(pkcs.ToArray());
}
}
}
}

View File

@@ -37,6 +37,11 @@ namespace k8s
/// </summary>
public string ClientCertificateFilePath { get; set; }
/// <summary>
/// Gets or sets the ClientCertificate KeyStoreFlags to specify where and how to import the certificate private key
/// </summary>
public X509KeyStorageFlags? ClientCertificateKeyStoreFlags { get; set; }
/// <summary>
/// Gets ClientCertificate Key filename
/// </summary>