Package com.castlabs.android.drm
Class SharedPreferencesKeyStore
java.lang.Object
com.castlabs.android.drm.KeyStore
com.castlabs.android.drm.SharedPreferencesKeyStore
KeyStore implementation that stores keySetIds in
SharedPreferences. If a Context
is passed to the constructor, the shared preferences created will always be in
Context.MODE_PRIVATE.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault name used for the shared preferences store -
Constructor Summary
ConstructorsConstructorDescriptionSharedPreferencesKeyStore(Context context) Creates a new store that persists the KeySetIds in aContext.MODE_PRIVATEshared preferences using theDEFAULT_PREF_NAMESharedPreferencesKeyStore(Context context, String name) Creates a new store that persists the KeySetIds in aContext.MODE_PRIVATEshared preferences using the given name.SharedPreferencesKeyStore(SharedPreferences sharedPreferences) Creates a new store that uses the given shared preferences as backend. -
Method Summary
-
Field Details
-
DEFAULT_PREF_NAME
Default name used for the shared preferences store- See Also:
-
-
Constructor Details
-
SharedPreferencesKeyStore
Creates a new store that persists the KeySetIds in aContext.MODE_PRIVATEshared preferences using theDEFAULT_PREF_NAME- Parameters:
context- the context
-
SharedPreferencesKeyStore
Creates a new store that persists the KeySetIds in aContext.MODE_PRIVATEshared preferences using the given name.- Parameters:
context- the contextname- the name used to create the shared preferences
-
-
Method Details
-
getLicenseKeysCount
public int getLicenseKeysCount()Description copied from class:KeyStoreGet count of stored license keys- Specified by:
getLicenseKeysCountin classKeyStore- Returns:
- count of stored keys
-