SSH keys are public keys you provide to the cloud system. They can be injected into Servers at creation time. We highly recommend that you use keys instead of passwords to manage your Servers.
Get all SSH keys
Returns all SSH key objects.
HetznerCloudClient hetznerCloudClient =newHetznerCloudClient("ApiKey");List<SshKey> list =awaithetznerCloudClient.SshKey.Get();
Creates a new SSH key with the given name and public_key. Once an SSH key is created, it can be used in other calls such as creating Servers.
HetznerCloudClient hetznerCloudClient =newHetznerCloudClient("ApiKey");// We rely on the 'SshKeyGenerator' library to generate SSH credentials.SshKeyGenerator.SshKeyGenerator sshKeyGenerator =newSshKeyGenerator.SshKeyGenerator(2048);string name =$"name";string pub =sshKeyGenerator.ToRfcPublicKey($"{Guid.NewGuid()}");SshKey sshKey =awaithetznerCloudClient.SshKey.Create(name, pub);
Update an SSH key
Updates an SSH key. You can update an SSH key name and an SSH key labels.
Deletes a volume. All Volume data is irreversibly destroyed. The Volume must not be attached to a Server and it must not have delete protection enabled.
HetznerCloudClient hetznerCloudClient =newHetznerCloudClient("ApiKey");// GetSshKey sshKey =awaithetznerCloudClient.SshKey.Get(16725981);// You can delete it by passing the object as a parameterawaithetznerCloudClient.SshKey.Delete(sshKey);// You can also delete it by passing the ID as a parameter.awaithetznerCloudClient.SshKey.Delete(16725981);