Class DeviceKey

    • Method Detail

      • deviceKeyId

        public DeviceKeyId deviceKeyId()
        Returns the device key identifier of the device key.
        Returns:
        device key identifier
      • label

        public java.lang.String label()
        Returns the label of device key.
        Returns:
        label
      • type

        public DeviceKey.Type type()
        Returns the type of the device key.
        Returns:
        type
      • createDeviceKeyUsingCommunityName

        public static DeviceKey createDeviceKeyUsingCommunityName​(DeviceKeyId id,
                                                                  java.lang.String label,
                                                                  java.lang.String name)
        Method to create a device key of type CommunityName.
        Parameters:
        id - device key identifier
        label - optional label for this device key
        name - community name for this device key
        Returns:
        device key
      • asCommunityName

        public CommunityName asCommunityName()
        Returns a community name object from the device key.
        Returns:
        community name
      • createDeviceKeyUsingUsernamePassword

        public static DeviceKey createDeviceKeyUsingUsernamePassword​(DeviceKeyId id,
                                                                     java.lang.String label,
                                                                     java.lang.String username,
                                                                     java.lang.String password)
        Method to create a device key of type USERNAME_PASSWORD.
        Parameters:
        id - device key identifier
        label - optional label for this device key
        username - username for accessing this device
        password - password for accessing this device
        Returns:
        device key
      • createDeviceKeyUsingSshKey

        public static DeviceKey createDeviceKeyUsingSshKey​(DeviceKeyId id,
                                                           java.lang.String label,
                                                           java.lang.String username,
                                                           java.lang.String password,
                                                           java.lang.String sshkey)
        Method to create a device key of type SSL_KEY.
        Parameters:
        id - device key identifier
        label - optional label for this device key
        username - username for accessing this device
        password - password for accessing this device SSH key
        sshkey - SSH key for accessing this device
        Returns:
        device key
      • asUsernamePassword

        public UsernamePassword asUsernamePassword()
        Returns a username and password object from the device key.
        Returns:
        username and password