amitaymolko / react-native-rsa-native

A native implementation of RSA key generation and encryption/decryption.
MIT License
232 stars 112 forks source link

fix: add keyTag RSA instance for generateCSRWithEC #156

Open alessioemireni opened 1 year ago

alessioemireni commented 1 year ago

The purpose of this PR is to fix an exception invoking the method generateCSRWithEC.

Before the EC Keypair is created the Keystore delete a key but it lacks the reference of the keyTag.

The error is:

android.security.KeyStoreException: System error (internal Keystore code: 4 message: In delete_key: Trying to unbind the key.

Caused by:
    0: In unbind_key.
    1: In with_transaction.
    2: Trying to get access tuple.
    3: With key.domain = Domain(0).
    4: In load_key_entry_id: Alias must be specified.
    5: Error::Rc(ResponseCode(4))) (public error code: 4 internal Keystore code: 4)

Failed to delete entry: null