removeKeyWithUnpair also unpairs others
This commit is contained in:
parent
67ba4d5596
commit
f602fadf80
|
@ -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 {
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue