diff --git a/certtostore_windows.go b/certtostore_windows.go index d82e893..7a23720 100644 --- a/certtostore_windows.go +++ b/certtostore_windows.go @@ -42,8 +42,8 @@ import ( "unsafe" "github.com/google/deck" - "golang.org/x/crypto/cryptobyte" "golang.org/x/crypto/cryptobyte/asn1" + "golang.org/x/crypto/cryptobyte" "golang.org/x/sys/windows" ) @@ -52,9 +52,11 @@ type WinCertStorage interface { CertStorage // Remove removes certificates issued by any of w.issuers from the user and/or system cert stores. - // If it is unable to remove any certificates, it returns an error. Remove(removeSystem bool) error + // RemoveByCertInfo removes certificate(s) with the given subject and serial number from the user and/or system cert stores. + RemoveByCertInfo(certinfo *windows.CertInfo, removeSystem bool) error + // Link will associate the certificate installed in the system store to the user store. Link() error @@ -98,8 +100,10 @@ const ( certStoreLocalMachineID = 2 // CERT_SYSTEM_STORE_LOCAL_MACHINE_ID infoIssuerFlag = 4 // CERT_INFO_ISSUER_FLAG compareNameStrW = 8 // CERT_COMPARE_NAME_STR_A + compareSubjectCert = 11 // CERT_COMPARE_SUBJECT_CERT compareShift = 16 // CERT_COMPARE_SHIFT findIssuerStr = compareNameStrW<