Key's password should not have to be the same as the keystore's password #3394
Labels
feature-request
Request a new feature
iot
Issues with the AWS Android SDK for Internet of Things (IoT)
Describe the bug
This SDK contains a few pieces of code that assume the key's password and the keystore's password are exactly the same.
For example, both overloads of
AWSIotKeystoreHelper.getIotKeystore
accept akeyStorePassword
parameter that is used for two different purposes:KeyStore.load
getTempKeystore
method ascustomerKeystorePassword
parameter that is later used forKeyStore.getKey
The
KeyStore.load
usage is correct. According toload
's Javadoc: "A password may be given to unlock the keystore (...) or to check the integrity of the keystore data". However, theKeystore.getKey
usage is wrong because the password must match the key's password, not the keystore's password. It looks like the key's password and the keystore's passwords are confused and treated as if they were the same thing, which is a wrong assumption. As a result, to make the SDK work, one must use a keystore whose password is exactly the same as the key's password.Another example is
AWSIotKeystoreHelper.saveCertificateAndPrivateKey
method that useskeystorePassword
parameter for bothKeyStore.setKeyEntry
and forKeyStore.store
.To Reproduce
Which AWS service(s) are affected?
AWS SDK IoT
Expected behavior
AWS SDK should accept both the keystore's password and the key's password separately and not assume they are the same.
Screenshots
n/a
Environment Information (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: