Skip to content

Most visited

Recently visited

navigation

LowpanCredential

LowpanCredential

public class LowpanCredential
extends Object

java.lang.Object
   ↳ com.google.android.things.lowpan.LowpanCredential


Describes a network access credential for a LoWPAN.

Currently, the only supported type of credential is that of a "master key", which is a fixed-length symmetric shared secret. The valid length for the master key is defined by the underlying LoWPAN type, but is typically fixed to a length of 16 bytes (128 bits).

The master key is shared by all devices participating in the LoWPAN and is used by the underlying network technology to derive other secrets for the purposes of device access control and data encryption/authentication.

There is typically no need to randomly generate a master key yourself: A master key is automatically generated when a LoWPAN is formed using a LowpanProvisioningParams with an unspecified LowpanCredential via form(LowpanProvisioningParams).

Note that a master key is always a sequence of random or pseudorandom bytes. Thile value of the master key can be derived from a passphrase using a network-type-defined key-streching algorithm, a master key is never the raw bytes of a password or passphrase.

See also:

Summary

Public methods

static LowpanCredential createMasterKey(String masterKeyHex)

Constructs a LowpanCredential with the given master key encoded as a hexidecimal string.

static LowpanCredential createMasterKey(byte[] masterKey)

Constructs a LowpanCredential with the given master key.

boolean equals(Object rhs)
byte[] getMasterKey()

Returns the bytes of the master key if this LowpanCredential contains a master key.

int hashCode()
boolean isMasterKey()

Returns true if this LowpanCredential is a symmetric master key, false otherwise.

String toString()

Inherited methods

From class java.lang.Object

Public methods

createMasterKey

LowpanCredential createMasterKey (String masterKeyHex)

Constructs a LowpanCredential with the given master key encoded as a hexidecimal string.

Parameters
masterKeyHex String
Returns
LowpanCredential

createMasterKey

LowpanCredential createMasterKey (byte[] masterKey)

Constructs a LowpanCredential with the given master key.

Parameters
masterKey byte
Returns
LowpanCredential

equals

boolean equals (Object rhs)

Parameters
rhs Object
Returns
boolean

getMasterKey

byte[] getMasterKey ()

Returns the bytes of the master key if this LowpanCredential contains a master key.

Returns
byte[]

hashCode

int hashCode ()

Returns
int

isMasterKey

boolean isMasterKey ()

Returns true if this LowpanCredential is a symmetric master key, false otherwise.

Returns
boolean

toString

String toString ()

Returns
String
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)