SshPublicKey Class
- java.
lang. Object - com.
azure. resourcemanager. compute. models. SshPublicKey
- com.
Implements
public final class SshPublicKey
implements JsonSerializable<SshPublicKey>
Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.
Constructor Summary
Constructor | Description |
---|---|
SshPublicKey() |
Creates an instance of Ssh |
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Ssh |
fromJson(JsonReader jsonReader)
Reads an instance of Ssh |
String |
keyData()
Get the key |
String |
path()
Get the path property: Specifies the full path on the created VM where ssh public key is stored. |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Ssh |
withKeyData(String keyData)
Set the key |
Ssh |
withPath(String path)
Set the path property: Specifies the full path on the created VM where ssh public key is stored. |
Methods inherited from java.lang.Object
Constructor Details
SshPublicKey
public SshPublicKey()
Creates an instance of SshPublicKey class.
Method Details
fromJson
public static SshPublicKey fromJson(JsonReader jsonReader)
Reads an instance of SshPublicKey from the JsonReader.
Parameters:
Returns:
Throws:
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. 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:
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:
toJson
validate
public void validate()
Validates the instance.
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. 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:
Returns:
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:
Returns:
Applies to
Azure SDK for Java