Skip to content

Commit

Permalink
Add functionality for checking whether the provided thumbprint is kno…
Browse files Browse the repository at this point in the history
…wn to the soap client
  • Loading branch information
HakanSunay committed Oct 24, 2023
1 parent 244e3ac commit 19726dc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vim25/soap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,20 @@ func (c *Client) Thumbprint(host string) string {
return c.hosts[host]
}

// KnownThumbprint checks whether the provided thumbprint is known to this client.
func (c *Client) KnownThumbprint(tp string) bool {
c.hostsMu.Lock()
defer c.hostsMu.Unlock()

for _, v := range c.hosts {
if v == tp {
return true
}
}

return false
}

// LoadThumbprints from file with the give name.
// If name is empty or name does not exist this function will return nil.
func (c *Client) LoadThumbprints(file string) error {
Expand Down

0 comments on commit 19726dc

Please sign in to comment.