Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
org.direct_bt.SMPLongTermKey Class Reference

SMP Long Term Key, used for platform agnostic persistence. More...

Collaboration diagram for org.direct_bt.SMPLongTermKey:

Classes

class  Properties
 SMPLongTermKey PropertyType Bit Mask More...
 
enum  PropertyType
 SMPLongTermKey Property Bits More...
 

Public Member Functions

 SMPLongTermKey ()
 Construct emoty unset instance. More...
 
 SMPLongTermKey (final byte source[], final int pos)
 Construct instance via given source byte array. More...
 
void get (final byte[] source, int pos)
 Method transfers all bytes representing a SMPLongTermKeyInfo from the given source array at the given position into this instance. More...
 
final boolean isResponder ()
 
final boolean isValid ()
 
final void put (final byte[] sink, int pos)
 Method transfers all bytes representing this instance into the given destination array at the given position. More...
 
String toString ()
 

Public Attributes

byte ediv []
 Encryption Diversifier, 2 octets or 16 bits. More...
 
byte enc_size
 Encryption Size, 1 octets or 8 bits. More...
 
byte ltk []
 Long Term Key (LTK), 16 octets or 128 bits. More...
 
Properties properties
 Properties bit mask. More...
 
byte rand []
 Random Number, 8 octets or 64 bits. More...
 

Static Public Attributes

static final int byte_size = 1+1+2+8+16
 Size of the byte stream representation in bytes (28) More...
 

Detailed Description

SMP Long Term Key, used for platform agnostic persistence.

Notable: No endian wise conversion shall occur on this data, since the encryption values are interpreted as a byte stream.

Byte layout must be synchronized with native direct_bt::SMPLongTermKeyInfo

Since
2.2.0

Definition at line 41 of file SMPLongTermKey.java.

Constructor & Destructor Documentation

◆ SMPLongTermKey() [1/2]

org.direct_bt.SMPLongTermKey.SMPLongTermKey ( final byte  source[],
final int  pos 
)

Construct instance via given source byte array.

Definition at line 144 of file SMPLongTermKey.java.

◆ SMPLongTermKey() [2/2]

org.direct_bt.SMPLongTermKey.SMPLongTermKey ( )

Construct emoty unset instance.

Definition at line 152 of file SMPLongTermKey.java.

Member Function Documentation

◆ get()

void org.direct_bt.SMPLongTermKey.get ( final byte[]  source,
int  pos 
)

Method transfers all bytes representing a SMPLongTermKeyInfo from the given source array at the given position into this instance.

Implementation is consistent with put(byte[], int).

Parameters
sourcethe source array
posstarting position in the source array
See also
put(byte[], int)

Definition at line 170 of file SMPLongTermKey.java.

Here is the caller graph for this function:

◆ put()

final void org.direct_bt.SMPLongTermKey.put ( final byte[]  sink,
int  pos 
)

Method transfers all bytes representing this instance into the given destination array at the given position.

Implementation is consistent with SMPLongTermKeyInfo(byte[], int).

Parameters
sinkthe destination array
posstarting position in the destination array
See also
#SMPLongTermKeyInfo(byte[], int)
get(byte[], int)

Definition at line 193 of file SMPLongTermKey.java.

Here is the caller graph for this function:

◆ isValid()

final boolean org.direct_bt.SMPLongTermKey.isValid ( )

Definition at line 205 of file SMPLongTermKey.java.

Here is the caller graph for this function:

◆ isResponder()

final boolean org.direct_bt.SMPLongTermKey.isResponder ( )

Definition at line 207 of file SMPLongTermKey.java.

◆ toString()

String org.direct_bt.SMPLongTermKey.toString ( )

Definition at line 210 of file SMPLongTermKey.java.

Here is the caller graph for this function:

Member Data Documentation

◆ properties

Properties org.direct_bt.SMPLongTermKey.properties

Properties bit mask.

1 octet or 8 bits.

Definition at line 126 of file SMPLongTermKey.java.

◆ enc_size

byte org.direct_bt.SMPLongTermKey.enc_size

Encryption Size, 1 octets or 8 bits.

Is zero if key is invalid.

Definition at line 129 of file SMPLongTermKey.java.

◆ ediv

byte org.direct_bt.SMPLongTermKey.ediv[]

Encryption Diversifier, 2 octets or 16 bits.

Definition at line 131 of file SMPLongTermKey.java.

◆ rand

byte org.direct_bt.SMPLongTermKey.rand[]

Random Number, 8 octets or 64 bits.

Definition at line 133 of file SMPLongTermKey.java.

◆ ltk

byte org.direct_bt.SMPLongTermKey.ltk[]

Long Term Key (LTK), 16 octets or 128 bits.

Definition at line 135 of file SMPLongTermKey.java.

◆ byte_size

final int org.direct_bt.SMPLongTermKey.byte_size = 1+1+2+8+16
static

Size of the byte stream representation in bytes (28)

See also
put(byte[], int)

Definition at line 141 of file SMPLongTermKey.java.


The documentation for this class was generated from the following file: