Class PKS12KeyStoreWallet


  • public class PKS12KeyStoreWallet
    extends Object
    A wallet of PKS#12 key files. It is an in-memory storage of PKS12KeyStore instances for users in order to be taken into account by some cryptographic processes to exchange between them digital data.

    It is a singleton that manages all the PKS#12 key stores for Silverpeas.

    • Method Detail

      • getInstance

        public static PKS12KeyStoreWallet getInstance()
        Gets the single wallet instance.
        Returns:
        the single instance of the key store wallet.
      • addKeyStore

        public void addKeyStore​(String keyFilePath,
                                String password)
                         throws CryptoException
        Adds the PKS#12 keys contained in the specified file that is protected with the specified password. The keys are added in the form of a PKS#12 key store.
        Parameters:
        keyFilePath - the path of the key store file.
        password - the password that protects the key store file.
        Throws:
        CryptoException - if an error occurs while adding the keys into this wallet.
      • getKeyStore

        public PKS12KeyStore getKeyStore​(String keyFilePath)
                                  throws CryptoException
        Gets the PKS#12 key store identified by the specified key store file and loaded in this wallet.
        Parameters:
        keyFilePath - the path of the file from which the PKS#12 key store was loaded into this wallet.
        Returns:
        the PKS#12 key store from this wallet.
        Throws:
        CryptoException - if no such PKS#12 key store exists in this wallet.