public LoadPrivateKey ( string thumbprint, string subjectName, string password ) : |
||
thumbprint | string | |
subjectName | string | |
password | string | |
return |
/// <summary> /// Loads the private key for the certificate with an optional password. /// </summary> public async Task <X509Certificate2> LoadPrivateKey(String password) { if (this.StoreType == CertificateStoreType.Directory) { using (DirectoryCertificateStore store = new DirectoryCertificateStore()) { store.Open(this.StorePath); m_certificate = store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password); return(m_certificate); } } return(await Find(true)); }
/// <summary> /// Loads the private key for the certificate with an optional password. /// </summary> public X509Certificate2 LoadPrivateKey(System.Security.SecureString password) { #if !SILVERLIGHT if (this.StoreType == CertificateStoreType.Directory) { DirectoryCertificateStore store = new DirectoryCertificateStore(); store.Open(this.StorePath); m_certificate = store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password); return(m_certificate); } #endif return(Find(true)); }
/// <summary> /// Loads the private key for the certificate with an optional password. /// </summary> public Task <X509Certificate2> LoadPrivateKeyEx(ICertificatePasswordProvider passwordProvider) { if (this.StoreType == CertificateStoreType.Directory) { using (DirectoryCertificateStore store = new DirectoryCertificateStore()) { store.Open(this.StorePath); string password = passwordProvider?.GetPassword(this); m_certificate = store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password); return(Task.FromResult(m_certificate)); } } return(Find(true)); }
/// <summary> /// Loads the private key for the certificate with an optional password. /// </summary> public async Task<X509Certificate2> LoadPrivateKey(String password) { if (this.StoreType == CertificateStoreType.Directory) { using (DirectoryCertificateStore store = new DirectoryCertificateStore()) { store.Open(this.StorePath); m_certificate = store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password); return m_certificate; } } return await Find(true); }
/// <summary> /// Loads the private key for the certificate with an optional password. /// </summary> public X509Certificate2 LoadPrivateKey(System.Security.SecureString password) { #if !SILVERLIGHT if (this.StoreType == CertificateStoreType.Directory) { using (DirectoryCertificateStore store = new DirectoryCertificateStore()) { store.Open(this.StorePath); m_certificate = store.LoadPrivateKey(this.Thumbprint, this.SubjectName, password); return m_certificate; } } #endif return Find(true); }