项目作者: kxfeng

项目描述 :
A secure SharedPreferences protected by Android keystore system
高级语言: Java
项目地址: git://github.com/kxfeng/secure-preferences.git
创建时间: 2019-01-31T19:13:31Z
项目社区:https://github.com/kxfeng/secure-preferences

开源协议:Apache License 2.0

下载


SecurePreferences

An Android secure SharedPreferences which use AES secret key to encrypt and decrypt key-values. You can use the AppKeyStore class to generate secret keys for app usage, which are protected by Android keystore system.

Download

  1. repositories {
  2. jcenter()
  3. }
  4. dependencies {
  5. implementation 'com.github.kxfeng:secure-preferences:1.0.0'
  6. }

Usage

Generate secret key

  1. AppKeyStore.init(this);
  2. SecretKey aesKey = AppKeyStore.getOrCreateSecretKey("SECURE_PREFERENCES_KEY_ALIAS", "AES", 256);

Create SecurePreferences

  1. SharedPreferences preferences = new SecurePreferences(this, "app_secure_preferences", aesKey);

License

  1. Copyright 2019 kxfeng
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.