Java – what is the correct way to handle AWS credentials in an Android project?

I need to connect to Amazon's simpledb in my Android application. The sample project provided with Amazon 7000 places the credentials in a file called awscredentials.properties, which is located in the project source. Then the source code makes these calls access and use them:

Properties properties = new Properties();
properties.load( getClass().getResourceAsStream( "AwsCredentials.properties" ) );

String accessKeyId = properties.getProperty( "accessKey" );
String secretKey = properties.getProperty( "secretKey" );
...
credentials = new BasicAWSCredentials( properties.getProperty( "accessKey" ), properties.getProperty( "secretKey" ) );

Is this the right and safe way?

resolvent:

I don't do that. It's suitable for quick combination, but storing AWS credentials in a property file is not a safe method. Amazon actually provides useful reports on how to access AWS securely from a mobile device. I also suggest checking keystore provided by Android

In response to your other questions, I have written more details about using Iam users for mobile AWS credentials

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>