removeKeyWithUnpair also unpairs others

This commit is contained in:
Michele Balistreri 2021-03-02 13:27:59 +03:00
parent 67ba4d5596
commit f602fadf80
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
3 changed files with 24 additions and 3 deletions

View File

@ -568,8 +568,26 @@ public class SmartCard extends BroadcastReceiver implements CardListener {
}
public void removeKeyWithUnpair(final String pairingBase64, final String pin) throws IOException, APDUException {
removeKey(pairingBase64, pin);
unpair(pairingBase64, pin);
KeycardCommandSet cmdSet = new KeycardCommandSet(this.cardChannel);
cmdSet.select().checkOK();
Pairing pairing = new Pairing(pairingBase64);
cmdSet.setPairing(pairing);
cmdSet.autoOpenSecureChannel();
Log.i(TAG, "secure channel opened");
cmdSet.verifyPIN(pin).checkOK();
Log.i(TAG, "pin verified");
cmdSet.removeKey();
Log.i(TAG, "key removed");
cmdSet.unpairOthers();
Log.i(TAG, "unpaired others");
cmdSet.autoUnpair();
Log.i(TAG, "card unpaired");
}
public void unpairAndDelete(final String pairingBase64, final String pin) throws IOException, APDUException {

View File

@ -276,6 +276,9 @@ class SmartCard {
try cmdSet.removeKey().checkOK()
os_log("key removed")
try cmdSet.unpairOthers()
os_log("unpaired others")
try cmdSet.autoUnpair()
os_log("card unpaired")

View File

@ -1,7 +1,7 @@
{
"name": "react-native-status-keycard",
"homepage": "https://keycard.status.im/",
"version": "2.5.31",
"version": "2.5.32",
"description": "React Native library to interact with Status Keycard using NFC connection (Android only)",
"main": "index.js",
"scripts": {