Class SshPublicKey
- java.lang.Object
-
- com.azure.resourcemanager.compute.models.SshPublicKey
-
public final class SshPublicKey extends Object
Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.
-
-
Constructor Summary
Constructors Constructor Description SshPublicKey()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringkeyData()Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh.Stringpath()Get the path property: Specifies the full path on the created VM where ssh public key is stored.voidvalidate()Validates the instance.SshPublicKeywithKeyData(String keyData)Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh.SshPublicKeywithPath(String path)Set the path property: Specifies the full path on the created VM where ssh public key is stored.
-
-
-
Method Detail
-
path
public String path()
Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys.- Returns:
- the path value.
-
withPath
public SshPublicKey withPath(String path)
Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys.- Parameters:
path- the path value to set.- Returns:
- the SshPublicKey object itself.
-
keyData
public String keyData()
Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).- Returns:
- the keyData value.
-
withKeyData
public SshPublicKey withKeyData(String keyData)
Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).- Parameters:
keyData- the keyData value to set.- Returns:
- the SshPublicKey object itself.
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-