none
managing root certificates RRS feed

  • Question

  • I would like to uninstall one trusted root cert and install another one.

     

    When I try to use the add/remove metho9ds for an x509 store on the root authority (code below) I get confirmation dialogs.

    Is there any way to avoid those dialogs??

    I was able to manage personal certificates without the dialogs previously but this is my first attempt at managing root certs.

    Thanks,

    Shawn

     

     

    Try
          Dim namedCert As New X509Certificate2("c:/temp/test.cer")
          Dim store As X509Store = New X509Store(StoreName.Root, StoreLocation.CurrentUser)
          store.Open(OpenFlags.MaxAllowed)
    
          Console.WriteLine("Store name: {0}", store.Name)
          Console.WriteLine("Store location: {0}", store.Location)
    
          For Each x509 As X509Certificate2 In store.Certificates
            If (x509.IssuerName.Name.ToUpper.IndexOf("ORGANIZATION") > -1) Then
              If Date.Compare(Date.Parse("8/1/2010"), x509.NotAfter.Date) = 0 Then
                store.Remove(x509)
                store.Add(namedCert)
                store.Close()
              End If
            End If
          Next x509
        Catch ex As Exception
          Console.WriteLine(ex.Message)
    End Try
    

     

    Wednesday, January 19, 2011 2:31 PM

All replies

  • I would guess being an administrator would help but not for sure what your trying to accomplish. If you are still around to answer then post more information else the forum moderators can lock within two days if their is no post.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/

    Thursday, July 12, 2012 6:28 PM