Skip to main content

Crate android_native_keyring_store

Crate android_native_keyring_store 

Source
Expand description

§Keyring-compatible Android-native credential store

This crate uses two Android-native features—SharedPreferences and the Keystore—to provide secure storage of passwords and other sensitive data for the keyring ecosystem.

§Named Credential Stores

This crate supports multiple, named credential stores, each backed by a dedicated SharedPreferences file and a dedicated Android Keystore entry. The implementation, found in the by_store module, supports search and doesn’t allow for ambiguity or provide any attributes on credentials.

§Legacy Credential Store

Earlier versions of this crate provided a single store that used one SharedPreferences file and Keystore entry per service name, rather than per store name. This legacy implementation, found in the by_service module, does not support search and leaves keys behind even when all of their associated credentials are deleted. It is still available under the legacy feature flag via the LegacyStore::from_ndk_context constructor, but it is deprecated and may be removed in future versions of the crate. All client applications are advised to migrate any existing credentials from legacy storage to a named store. See the Migration Guide for details.

§Application Requirements

This crate compiles to produce a native library that can be loaded into an Android application. Because this crate gets its Android application context from the ndk-context crate, applications that use this crate must initialize the application-context object provided by the ndk-context crate before they can create credential stores. The README for this crate provides detailed instructions for how to do this.

Re-exports§

pub use by_store::Cred;
pub use by_store::Store;
pub use by_service::Cred as LegacyCred;
pub use by_service::Store as LegacyStore;

Modules§

by_service
Legacy Implementation
by_store
Named Credential Stores

Functions§

Java_io_crates_keyring_Keyring_00024Companion_initializeNdkContext
Initialize the NDK context.