Class KeyStoreProvider

  • All Implemented Interfaces:
    Serializable

    public class KeyStoreProvider
    extends Object
    implements Serializable
    Provides instances of KeyStore defined by either given file / storePassword combination or one or more KeyMaterialHolder containing key-material as a byte-array.

    Some words on the String-representation of passwords

    No it is not (much) more secure to store them in a char[] because of not being part of the string-pool:
    • If an attacker is on your machine debugging the string-pool you are doomed anyway.
    • In most frameworks / user-land code there are some places where input / configuration data is represented as String on the way to the more secure "give me a char[]" parts. So it is usually in the String pool anyway.

    So: In theory the statements made by the Java Cryptography Architecture guide ("...") are correct but in our scenarios they will increase security only a small amount and introduce potential bugs and will therefore be ignored for this keyStoreType.

    It is more important to avoid accidental printing on logs and such, what is handled by this keyStoreType.

    Therefore, this class uses String-based handling of credentials, for simplification and provide shortcuts for creating char[], see getStorePasswordAsCharArray() and getKeyPasswordAsCharArray()
    Author:
    Oliver Wolff, Nikola Marijan
    See Also:
    Serialized Form