@Beta public class DeviceKey extends AbstractAnnotated
Modifier and Type | Class and Description |
---|---|
static class |
DeviceKey.Type
type of the device key.
|
Modifier and Type | Method and Description |
---|---|
CommunityName |
asCommunityName()
Returns a community name object from the device key.
|
UsernamePassword |
asUsernamePassword()
Returns a username and password object from the device key.
|
static DeviceKey |
createDeviceKeyUsingCommunityName(DeviceKeyId id,
String label,
String name)
Method to create a device key of type CommunityName.
|
static DeviceKey |
createDeviceKeyUsingSshKey(DeviceKeyId id,
String label,
String username,
String password,
String sshkey)
Method to create a device key of type SSL_KEY.
|
static DeviceKey |
createDeviceKeyUsingUsernamePassword(DeviceKeyId id,
String label,
String username,
String password)
Method to create a device key of type USERNAME_PASSWORD.
|
DeviceKeyId |
deviceKeyId()
Returns the device key identifier of the device key.
|
String |
label()
Returns the label of device key.
|
DeviceKey.Type |
type()
Returns the type of the device key.
|
annotations
public DeviceKeyId deviceKeyId()
public String label()
public DeviceKey.Type type()
public static DeviceKey createDeviceKeyUsingCommunityName(DeviceKeyId id, String label, String name)
id
- device key identifierlabel
- optional label for this device keyname
- community name for this device keypublic CommunityName asCommunityName()
public static DeviceKey createDeviceKeyUsingUsernamePassword(DeviceKeyId id, String label, String username, String password)
id
- device key identifierlabel
- optional label for this device keyusername
- username for accessing this devicepassword
- password for accessing this devicepublic static DeviceKey createDeviceKeyUsingSshKey(DeviceKeyId id, String label, String username, String password, String sshkey)
id
- device key identifierlabel
- optional label for this device keyusername
- username for accessing this devicepassword
- password for accessing this device SSH keysshkey
- SSH key for accessing this devicepublic UsernamePassword asUsernamePassword()