28import org.jau.util.BasicTypes;
68 public static PropertyType get(
final String name)
throws IllegalArgumentException {
79 case (
byte) 0x01:
return RESPONDER;
80 case (
byte) 0x02:
return AUTH;
81 case (
byte) 0x04:
return SC;
109 final StringBuilder out =
new StringBuilder();
114 if( 0 < count ) { out.append(
", "); }
118 if( 0 < count ) { out.append(
", "); }
121 return "["+out.toString()+
"]";
170 public void get(
final byte[] source,
int pos) {
171 if(
byte_size > ( source.length - pos ) ) {
172 throw new IllegalArgumentException(
"Stream ( "+source.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
176 ediv[0] = source[pos++];
177 ediv[1] = source[pos++];
178 System.arraycopy(source, pos,
rand, 0, 8); pos+=8;
179 System.arraycopy(source, pos,
ltk, 0, 16); pos+=16;
193 public final void put(
final byte[] sink,
int pos) {
194 if(
byte_size > ( sink.length - pos ) ) {
195 throw new IllegalArgumentException(
"Stream ( "+sink.length+
" - "+pos+
" ) < "+
byte_size+
" bytes");
199 sink[pos++] =
ediv[0];
200 sink[pos++] =
ediv[1];
201 System.arraycopy(
rand, 0, sink, pos, 8); pos+=8;
202 System.arraycopy(
ltk, 0, sink, pos, 16); pos+=16;
212 ", ediv "+BasicTypes.bytesHexString(
ediv, 0, -1,
false )+
213 ", rand "+BasicTypes.bytesHexString(
rand, 0, -1,
false )+
214 ", ltk "+BasicTypes.bytesHexString(
ltk, 0, -1,
true )+
SMPLongTermKey PropertyType Bit Mask
boolean isSet(final PropertyType bit)
byte mask
The PropertyType bit mask.
SMP Long Term Key, used for platform agnostic persistence.
byte ltk[]
Long Term Key (LTK), 16 octets or 128 bits.
byte enc_size
Encryption Size, 1 octets or 8 bits.
SMPLongTermKey()
Construct emoty unset instance.
byte rand[]
Random Number, 8 octets or 64 bits.
SMPLongTermKey(final byte source[], final int pos)
Construct instance via given source byte array.
Properties properties
Properties bit mask.
static final int byte_size
Size of the byte stream representation in bytes (28)
final boolean isResponder()
final void put(final byte[] sink, int pos)
Method transfers all bytes representing this instance into the given destination array at the given p...
byte ediv[]
Encryption Diversifier, 2 octets or 16 bits.
SMPLongTermKey Property Bits
SC
Secure Connection used.
NONE
No specific property.
PropertyType(final byte v)
RESPONDER
Responder Key (LL slave).