Search in sources :

Example 11 with KeystoreEncryptionSpi

use of org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi in project ignite by apache.

the class AbstractEncryptionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setConsistentId(name);
    KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
    encSpi.setKeyStorePath(keystorePath());
    encSpi.setKeyStorePassword(keystorePassword());
    cfg.setEncryptionSpi(encSpi);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10L * 1024 * 1024).setPersistenceEnabled(true)).setPageSize(4 * 1024).setWalMode(FSYNC);
    cfg.setDataStorageConfiguration(memCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

Example 12 with KeystoreEncryptionSpi

use of org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi in project ignite by apache.

the class KeystoreEncryptionSpiSelfTest method testCantStartKeystoreDoesntExists.

/**
 * @throws Exception If failed.
 */
@Test
public void testCantStartKeystoreDoesntExists() throws Exception {
    GridTestUtils.assertThrowsWithCause(() -> {
        KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
        encSpi.setKeyStorePath("/ignite/is/cool/path/doesnt/exists");
        encSpi.setKeyStorePassword(KEYSTORE_PASSWORD.toCharArray());
        encSpi.spiStart("default");
    }, IgniteException.class);
}
Also used : KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi) Test(org.junit.Test)

Example 13 with KeystoreEncryptionSpi

use of org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi in project ignite by apache.

the class KeystoreEncryptionSpiSelfTest method testCantStartWithoutPassword.

/**
 * @throws Exception If failed.
 */
@Test
public void testCantStartWithoutPassword() throws Exception {
    GridTestUtils.assertThrowsWithCause(() -> {
        KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
        encSpi.setKeyStorePath("/ignite/is/cool/path/doesnt/exists");
        encSpi.spiStart("default");
    }, IgniteException.class);
}
Also used : KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi) Test(org.junit.Test)

Example 14 with KeystoreEncryptionSpi

use of org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi in project ignite by apache.

the class KeystoreEncryptionSpiSelfTest method testCantStartWithEmptyParam.

/**
 * @throws Exception If failed.
 */
@Test
public void testCantStartWithEmptyParam() throws Exception {
    GridTestUtils.assertThrowsWithCause(() -> {
        EncryptionSpi encSpi = new KeystoreEncryptionSpi();
        encSpi.spiStart("default");
    }, IgniteException.class);
}
Also used : KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi) Test(org.junit.Test)

Aggregations

KeystoreEncryptionSpi (org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)14 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)7 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)3 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)3 Test (org.junit.Test)3 NoopEncryptionSpi (org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi)2 Ignite (org.apache.ignite.Ignite)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)1 EncryptionConfiguration (org.apache.ignite.configuration.EncryptionConfiguration)1 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)1 NotNull (org.jetbrains.annotations.NotNull)1 Assert.assertNotNull (org.junit.Assert.assertNotNull)1 Test (org.junit.jupiter.api.Test)1