/// <summary> /// <see cref="ISecure.CreateSecurityCredentialHandler"/> /// </summary> public Dvtk.Security.ICredentialHandling CreateSecurityCredentialHandler() { if (_ICredentialHandling != null) { throw new System.ApplicationException( "Existing credential handler has not been disposed yet."); } _ICredentialHandling = new Dvtk.Security.CredentialHandling(this); return(_ICredentialHandling); }
/// <summary> /// <see cref="ISecure.DisposeSecurityCredentialHandler"/> /// </summary> public void DisposeSecurityCredentialHandler() { _ICredentialHandling = null; }
/// <summary> /// <see cref="ISecure.CreateSecurityCredentialHandler"/> /// </summary> public Dvtk.Security.ICredentialHandling CreateSecurityCredentialHandler() { if (_ICredentialHandling != null) throw new System.ApplicationException( "Existing credential handler has not been disposed yet."); _ICredentialHandling = new Dvtk.Security.CredentialHandling(this); return _ICredentialHandling; }
/// <summary> /// <see cref="ISecure.DisposeSecurityCredentialHandler"/> /// </summary> public void DisposeSecurityCredentialHandler() { _ICredentialHandling = null; }
public CredentialsCertificatesForm(DvtkApplicationLayer.Session session, bool show_credentials) { // // Required for Windows Form Designer support // InitializeComponent(); if (session.Implementation is Dvtk.Sessions.ISecure) { this._show_credentials = show_credentials; this._session = session; this.ButtonRemoveCertificate.Enabled = false; if (show_credentials) { this.Text = "DVT Private Keys (credentials)"; this.ButtonChangePassword.Visible = true; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CredentialsFileName; this._cred_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCredentialHandler(); } else { this.Text = "SUT Public Keys (certificates)"; this.ButtonChangePassword.Visible = false; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CertificateFileName; this._cert_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCertificateHandler(); } FileInfo cert_file = new FileInfo(_FileContainingKeys); if (cert_file.Exists) { try { if (show_credentials) { FileInfo file; file = new FileInfo(this._cred_handling.FileName); _FileContainingKeys = this._cred_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cred_handling.Credentials); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cred_handling.Credentials.Count > 0) { this.ButtonRemoveCertificate.Enabled = true; } } else { FileInfo file; file = new FileInfo(this._cert_handling.FileName); _FileContainingKeys = this._cert_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cert_handling.Certificates); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cert_handling.Certificates.Count > 0) { this.ButtonRemoveCertificate.Enabled = true; } } } catch { this.DataGridCertificates.DataSource = null; } } } }
public CredentialsCertificatesForm(DvtkApplicationLayer.Session session, bool show_credentials) { // // Required for Windows Form Designer support // InitializeComponent(); if (session.Implementation is Dvtk.Sessions.ISecure) { this._show_credentials = show_credentials; this._session = session; this.ButtonRemoveCertificate.Enabled = false; if (show_credentials) { this.Text = "DVT Private Keys (credentials)"; this.ButtonChangePassword.Visible = true ; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CredentialsFileName; this._cred_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCredentialHandler (); } else { this.Text = "SUT Public Keys (certificates)"; this.ButtonChangePassword.Visible = false ; _FileContainingKeys = (session.Implementation as Dvtk.Sessions.ISecure).SecuritySettings.CertificateFileName; this._cert_handling = (session.Implementation as Dvtk.Sessions.ISecure).CreateSecurityCertificateHandler (); } FileInfo cert_file = new FileInfo (_FileContainingKeys); if (cert_file.Exists) { try { if (show_credentials) { FileInfo file; file = new FileInfo (this._cred_handling.FileName); _FileContainingKeys = this._cred_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cred_handling.Credentials); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cred_handling.Credentials.Count > 0) this.ButtonRemoveCertificate.Enabled = true; } else { FileInfo file; file = new FileInfo (this._cert_handling.FileName); _FileContainingKeys = this._cert_handling.FileName; if (file.Exists) { _ExceptionText = ""; _KeysInformation = ConvertToKeyInformationArrayList(_cert_handling.Certificates); DataGridCertificates.DataSource = _KeysInformation; Debug.Assert(_ExceptionText.Length == 0, "Following errors occured while filling datagrid:\n\n" + _ExceptionText); } if (this._cert_handling.Certificates.Count > 0) this.ButtonRemoveCertificate.Enabled = true; } } catch { this.DataGridCertificates.DataSource = null; } } } }