Class PlatformKeyringFactory
java.lang.Object
org.tentackle.keyring.DefaultKeyringFactory
org.tentackle.keyring.platform.PlatformKeyringFactory
- All Implemented Interfaces:
KeyringFactory
The keyring factory for the credential store of the operating system.
Replaces the DefaultKeyringFactory of Tentackle core as soon as this module is part of the
application. Picks the keyring as follows:
- the keyring named by the system property "tentackle.keyring", if set,
- the credential store of the operating system, if usable,
- the fallbacks of the
DefaultKeyringFactory.
-
Field Summary
Fields inherited from interface KeyringFactory
KEYRING_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractKeyringcreateKeyring(String name) Creates a keyring by its name.protected StringGets the name of the keyring for the current operating system.protected KeyringSelects the best keyring available.Methods inherited from class DefaultKeyringFactory
getKeyring, selectKeyring
-
Constructor Details
-
PlatformKeyringFactory
public PlatformKeyringFactory()Creates the factory.
-
-
Method Details
-
selectBestKeyring
Selects the best keyring available.Overridden by factories providing more secure keyrings, which fall back to this implementation if theirs is not usable.
Returns the credential store of the operating system, if usable. Otherwise, logs a warning and falls back to the keyrings of the
DefaultKeyringFactory.- Overrides:
selectBestKeyringin classDefaultKeyringFactory- Returns:
- the keyring
-
createKeyring
Creates a keyring by its name.Overridden by factories providing more keyrings.
Adds the keyrings of the operating systems.
- Overrides:
createKeyringin classDefaultKeyringFactory- Parameters:
name- the keyring's name- Returns:
- the keyring
-
getPlatformKeyringName
Gets the name of the keyring for the current operating system.- Returns:
- the keyring name
-