Dart Ftp Control
DeleteCert Method
Certificate Object that is contained in the Store
Description
Removes specified certificate from the Certificate Store.
Syntax
Visual Basic
Public Sub DeleteCert( _
   ByVal Cert As Certificate _
) 
Parameters
Cert
Certificate Object that is contained in the Store
Remarks

This method is used to remove an existing certificate from a certificate store. If the certificate does not exist a certNotFound error will be thrown. If the certificate cant be deleted a certNoDelete error will be thrown. For any other error a certError will be thrown.

Error Codes

This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):

Example
Private Sub DeleteSelectedCert()
    On Error GoTo OnError
    Dim Item As ListItem
    Set Item = lvwCerts.SelectedItem
    If Item Is Nothing Then Exit Sub
    Dim Cert As Certificate
    Set Cert = Item.Tag
    If MsgBox("Are you sure you want to delete " + Cert.IssuedTo + "?", vbQuestion + vbOKCancel, "Confirm Delete") <> vbOK Then Exit Sub
    Dim Store As CertificateStore
    Set Store = New CertificateStore
    Store.Name = m_StoreName
    Store.Location = m_StoreLocation
    Store.DeleteCert Cert
    RefreshCerts
    GoTo Done
OnError:
    MsgBox Err.Description, vbCritical, "ERROR #" + CStr(Err.Number)
Done:
End Sub
See Also

CertificateStore Object  | CertificateStore Members


PowerTCP FTP for ActiveX Documentation Version 2.2
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic