How can I use an AndroidKeyStore based keypair with AWSIotKeystoreHelper / AWSIotMqttManager #3197
Labels
feature-request
Request a new feature
iot
Issues with the AWS Android SDK for Internet of Things (IoT)
pending-community-response
Issue is pending response from the issue requestor
The APIs for AWSIotKeystoreHelper and AWSIotMqttManager appear to require direct export access to the private key information. As such they are incompatible with hardware based keystore implementations including Android's AndroidKeyStore. This seems like a huge limitation if true. I'm hoping there is some way to use hardware backed keys that I am just not seeing.
Which AWS Services are you utilizing?
AWSIotMqttManager via AWSIotKeystoreHelper
Provide code snippets (if applicable)
The SDK documentation states that I should use AWSIotKeystoreHelper to create a keystore that can be used by AWSIotMqttManager. Here are the two api calls for creating such a keystore:
In both cases, if an AndroidKeystore is passed in, exceptions are thrown when getIotKeystore attempts to directly import a private key via it's call to setKeyEntry on line 307:
This exception occurs because the 'key' argument coming from the passed in keystore does not allow direct access to the actual private key information (as designed). key.getEncoded() for example, returns null which is also correct for hardware based keys.
I have also tried passing a AndroidKeystore directly into AWSIosMqttManager.connect(). This also fails because the AWS code appears to assume that it's keystore's private keys are fully decryptable with a well known password which is never the case for hardware backed keystores.
Environment(please complete the following information):
Device Information (please complete the following information):
The text was updated successfully, but these errors were encountered: