NetworkKey

@Serializable
data class NetworkKey

AThe network key object represents the state of the mesh network key that is used for securing communication at the network layer.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The index property contains an integer from 0 to 4095 that represents the NetKey index for this network key.

Link copied to clipboard

Returns whether the network key is added to any nodes in the network. A key that is in use cannot be removed until it has been removed from all the nodes and is no longer bound to any application keys.

Link copied to clipboard

Returns true if the network key is the primary network key.

Link copied to clipboard

128-bit key.

Link copied to clipboard

Human-readable name for the the mesh subnet associated with this network key.

Link copied to clipboard
lateinit var networkId: ByteArray

Network ID is derived from a network key and is used to identify the network

Link copied to clipboard
@Serializable(with = KeySerializer::class)
var oldKey: ByteArray?

The oldKey property contains a 32-character hexadecimal string that represents the 128-bit network key, and shall be present when the phase property has a non-zero value, such as when the Key Refresh procedure is in progress. The value of the oldKey property contains the previous network key.

Link copied to clipboard

Old Network ID is derived from the old network key.

Link copied to clipboard

The phase property represents the KeyRefreshPhase for the subnet associated with this network key.

Link copied to clipboard

Security property contains a string with a value of either “insecure” or “secure”, which describes a minimum security level for a subnet associated with this network key. If all the nodes on the subnet associated with this network key have been provisioned using the Secure Provisioning procedure, then the value of minSecurity property for the subnet is set to “secure”; otherwise, the value of the minSecurity is set to “insecure”.

Link copied to clipboard
var timestamp: Instant

The timestamp property contains a string that represents the last time the value of the phase property has been updated.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Sets the security level to secure.

Link copied to clipboard
fun setKey(key: ByteArray)

Updates the existing key with the given key, if it is not in use.