Search in sources :

Example 1 with KeystoreEncryptionSpi

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

the class WalRecoveryWithPageCompressionAndTdeTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    for (CacheConfiguration<?, ?> ccfg : cfg.getCacheConfiguration()) ccfg.setEncryptionEnabled(true);
    KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
    encSpi.setKeyStorePath(AbstractEncryptionTest.KEYSTORE_PATH);
    encSpi.setKeyStorePassword(AbstractEncryptionTest.KEYSTORE_PASSWORD.toCharArray());
    cfg.setEncryptionSpi(encSpi);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

Example 2 with KeystoreEncryptionSpi

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

the class DiskPageCompressionConfigValidationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
    encSpi.setKeyStorePath(KEYSTORE_PATH);
    encSpi.setKeyStorePassword(KEYSTORE_PASSWORD.toCharArray());
    cfg.setEncryptionSpi(encSpi);
    DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10L * 1024 * 1024).setPersistenceEnabled(true)).setPageSize(MAX_PAGE_SIZE).setWalMode(FSYNC);
    cfg.setDataStorageConfiguration(dsCfg);
    if (ccfg != null)
        cfg.setCacheConfiguration(ccfg);
    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 3 with KeystoreEncryptionSpi

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

the class PlatformConfigurationUtils method readEncryptionConfiguration.

/**
 * Reads encryption configuration
 * @param in Reader.
 * @param cfg Configuration.
 */
private static void readEncryptionConfiguration(BinaryRawReaderEx in, IgniteConfiguration cfg) {
    if (!in.readBoolean()) {
        cfg.setEncryptionSpi(new NoopEncryptionSpi());
        return;
    }
    KeystoreEncryptionSpi enc = new KeystoreEncryptionSpi();
    enc.setMasterKeyName(in.readString());
    enc.setKeySize(in.readInt());
    enc.setKeyStorePath(in.readString());
    enc.setKeyStorePassword(in.readCharArray());
    cfg.setEncryptionSpi(enc);
}
Also used : NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

Example 4 with KeystoreEncryptionSpi

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

the class EncryptedCacheNodeJoinTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String grid) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(grid);
    cfg.setConsistentId(grid);
    if (grid.equals(GRID_0) || grid.equals(GRID_2) || grid.equals(GRID_3) || grid.equals(GRID_4) || grid.equals(GRID_5) || grid.equals(GRID_6) || grid.equals(GRID_7)) {
        KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
        encSpi.setKeyStorePath(grid.equals(GRID_2) ? KEYSTORE_PATH_2 : KEYSTORE_PATH);
        encSpi.setKeyStorePassword(KEYSTORE_PASSWORD.toCharArray());
        cfg.setEncryptionSpi(encSpi);
    } else
        cfg.setEncryptionSpi(null);
    if (configureCache)
        cfg.setCacheConfiguration(cacheConfiguration(grid));
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

Example 5 with KeystoreEncryptionSpi

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

the class IgnitePdsDefragmentationEncryptionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi();
    encSpi.setKeyStorePath(AbstractEncryptionTest.KEYSTORE_PATH);
    encSpi.setKeyStorePassword(AbstractEncryptionTest.KEYSTORE_PASSWORD.toCharArray());
    cfg.setEncryptionSpi(encSpi);
    for (CacheConfiguration<?, ?> ccfg : cfg.getCacheConfiguration()) ccfg.setEncryptionEnabled(true);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

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