/** * This method returns a crypto module based on settings in the given configuration parameter. * * @return a class implementing the CryptoModule interface. It will *never* return null; rather, * it will return a class which obeys the interface but makes no changes to the underlying * data. */ public static CryptoModule getCryptoModule(AccumuloConfiguration conf) { String cryptoModuleClassname = conf.get(Property.CRYPTO_MODULE_CLASS); return getCryptoModule(cryptoModuleClassname); }
.getCryptoModule(cryptoModuleName); @SuppressWarnings("deprecation") InputStream decryptingInputStream = cryptoOps.getDecryptingInputStream(input, cryptoOpts);
private void setupCryptoFromCachedData(BlockRead cachedCryptoParams) throws IOException { BCFileCryptoModuleParameters params = new BCFileCryptoModuleParameters(); params.read(cachedCryptoParams); if (Arrays.equals(params.getEncryptedKey(), NO_CRYPTO.getEncryptedKey()) && NO_CRYPTO.getOpaqueKeyEncryptionKeyID().equals(params.getOpaqueKeyEncryptionKeyID())) { this.cryptoParams = null; this.cryptoModule = null; this.secretKeyEncryptionStrategy = null; } else { this.cryptoModule = CryptoModuleFactory .getCryptoModule(params.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey())); this.secretKeyEncryptionStrategy = CryptoModuleFactory .getSecretKeyEncryptionStrategy(params.getKeyEncryptionStrategyClass()); // This call should put the decrypted session key within the cryptoParameters object cryptoParams = (BCFileCryptoModuleParameters) secretKeyEncryptionStrategy .decryptSecretKey(params); } }
org.apache.accumulo.core.security.crypto.CryptoModule cryptoModule = org.apache.accumulo.core.security.crypto.CryptoModuleFactory.getCryptoModule(conf .getConfiguration().get(Property.CRYPTO_MODULE_CLASS));
CryptoModule cryptoModule = CryptoModuleFactory.getCryptoModule(cryptoModuleClassname); .getCryptoModule(DefaultCryptoModule.class.getName());
.getCryptoModule(conf.getConfiguration().get(Property.CRYPTO_MODULE_CLASS));
this.cryptoModule = CryptoModuleFactory.getCryptoModule(accumuloConfiguration); this.cryptoParams = new BCFileCryptoModuleParameters(); CryptoModuleFactory.fillParamsObjectFromConfiguration(cryptoParams, accumuloConfiguration);
cache.cacheMetaBlock(CRYPTO_BLOCK_NAME, baos.toByteArray()); this.cryptoModule = CryptoModuleFactory.getCryptoModule( cryptoParams.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey())); this.secretKeyEncryptionStrategy = CryptoModuleFactory
cryptoParams.read(this.in); this.cryptoModule = CryptoModuleFactory.getCryptoModule( cryptoParams.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey()));