Class HsmKeyStoreLoader

    • Constructor Detail

      • HsmKeyStoreLoader

        public HsmKeyStoreLoader​(Provider hsmProvider)
        Initializes the HSM loader with the given PKCS#11 provider.
        Parameters:
        hsmProvider - the provider object.
    • Method Detail

      • toPkcs11Provider

        public static Optional<Provider> toPkcs11Provider​(String providerName,
                                                          String configFilePath)
        Creates and configures a new PKCS#11 provider for the given PKCS#11 configuration file and existing provider name.
        Parameters:
        providerName - the name of an existing registered provider.
        configFilePath - the file path of the PKCS#11 configuration file.
        Returns:
        an optional of a new unregistered Provider or an empty optional if no existing provider was found with the given name.
      • toPkcs11Provider

        public static Provider toPkcs11Provider​(String configFilePath)
        Creates and configures a new PKCS#11 provider for the given PKCS#11 configuration file. It will be either an instance of sun.security.pkcs11.SunPKCS11 or com.ibm.crypto.pkcs11impl.provider.IBMPKCS11Impl.
        Parameters:
        configFilePath - the file path of the PKCS#11 configuration file.
        Returns:
        a new unregistered Provider.
        Throws:
        IllegalStateException - if no PKCS#11 provider could be configured.