summaryrefslogtreecommitdiffstats
path: root/java/jau
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-10-27 08:02:01 +0200
committerSven Gothel <[email protected]>2021-10-27 08:02:01 +0200
commit0ea4288597e41c81f4a210b24f062604edb925d8 (patch)
treed9e6127eeb014f71e41b606e77348ef272319ae1 /java/jau
parent9a62af44f48b2afd2ada6ee4b7955e524b0e0627 (diff)
BTDevice: SMP Keys (C++/Java): Have setter update PairingData::keys_*_has; Expose SMPIdentityResolvingKey (IRK) adding get/set methods; Add setSignatureResolvingKey();
Diffstat (limited to 'java/jau')
-rw-r--r--java/jau/direct_bt/DBTDevice.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/java/jau/direct_bt/DBTDevice.java b/java/jau/direct_bt/DBTDevice.java
index db1de0f5..edbc7773 100644
--- a/java/jau/direct_bt/DBTDevice.java
+++ b/java/jau/direct_bt/DBTDevice.java
@@ -48,6 +48,7 @@ import org.direct_bt.HCIStatusCode;
import org.direct_bt.LE_PHYs;
import org.direct_bt.PairingMode;
import org.direct_bt.SMPIOCapability;
+import org.direct_bt.SMPIdentityResolvingKey;
import org.direct_bt.SMPKeyMask;
import org.direct_bt.SMPLinkKey;
import org.direct_bt.SMPLongTermKey;
@@ -328,6 +329,22 @@ public class DBTDevice extends DBTObject implements BTDevice
private final native byte setLongTermKeyImpl(final byte[] source);
@Override
+ public final SMPIdentityResolvingKey getIdentityResolvingKey(final boolean responder) {
+ final byte[] stream = new byte[SMPIdentityResolvingKey.byte_size];
+ getIdentityResolvingKeyImpl(responder, stream);
+ return new SMPIdentityResolvingKey(stream, 0);
+ }
+ private final native void getIdentityResolvingKeyImpl(final boolean responder, final byte[] sink);
+
+ @Override
+ public final HCIStatusCode setIdentityResolvingKey(final SMPIdentityResolvingKey irk) {
+ final byte[] stream = new byte[SMPIdentityResolvingKey.byte_size];
+ irk.put(stream, 0);
+ return HCIStatusCode.get( setIdentityResolvingKeyImpl(stream) );
+ }
+ private final native byte setIdentityResolvingKeyImpl(final byte[] source);
+
+ @Override
public final SMPSignatureResolvingKey getSignatureResolvingKey(final boolean responder) {
final byte[] stream = new byte[SMPSignatureResolvingKey.byte_size];
getSignatureResolvingKeyImpl(responder, stream);
@@ -336,6 +353,14 @@ public class DBTDevice extends DBTObject implements BTDevice
private final native void getSignatureResolvingKeyImpl(final boolean responder, final byte[] sink);
@Override
+ public final HCIStatusCode setSignatureResolvingKey(final SMPSignatureResolvingKey irk) {
+ final byte[] stream = new byte[SMPSignatureResolvingKey.byte_size];
+ irk.put(stream, 0);
+ return HCIStatusCode.get( setSignatureResolvingKeyImpl(stream) );
+ }
+ private final native byte setSignatureResolvingKeyImpl(final byte[] source);
+
+ @Override
public final SMPLinkKey getLinkKey(final boolean responder) {
final byte[] stream = new byte[SMPLinkKey.byte_size];
getLinkKeyImpl(responder, stream);