Class SshPublicKey

java.lang.Object
com.azure.resourcemanager.compute.models.SshPublicKey
All Implemented Interfaces:
com.azure.json.JsonSerializable<SshPublicKey>

public final class SshPublicKey extends Object implements com.azure.json.JsonSerializable<SshPublicKey>
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
    Creates an instance of SshPublicKey class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of SshPublicKey from the JsonReader.
    Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh.
    Get the path property: Specifies the full path on the created VM where ssh public key is stored.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh.
    Set the path property: Specifies the full path on the created VM where ssh public key is stored.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • SshPublicKey

      public SshPublicKey()
      Creates an instance of SshPublicKey class.
  • Method Details

    • 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. 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. 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.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<SshPublicKey>
      Throws:
      IOException
    • fromJson

      public static SshPublicKey fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SshPublicKey from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SshPublicKey if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the SshPublicKey.