Lehel44 commented on a change in pull request #5110:
URL: https://github.com/apache/nifi/pull/5110#discussion_r644355018
##########
File path:
nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/EncryptedWriteAheadProvenanceRepository.java
##########
@@ -133,33 +124,16 @@ public synchronized void initialize(final EventReporter
eventReporter, final Aut
super.init(recordWriterFactory, recordReaderFactory, eventReporter,
authorizer, resourceFactory);
}
- private KeyProvider buildKeyProvider() throws KeyManagementException {
- return buildKeyProvider(null);
- }
-
- private KeyProvider buildKeyProvider(SecretKey rootKey) throws
KeyManagementException {
- RepositoryConfiguration config = super.getConfig();
- if (config == null) {
- throw new KeyManagementException("The repository configuration is
missing");
- }
-
- final String implementationClassName =
config.getKeyProviderImplementation();
- if (implementationClassName == null) {
- throw new KeyManagementException("Cannot create Key Provider
because the NiFi Properties is missing the following property: "
- +
NiFiProperties.PROVENANCE_REPO_ENCRYPTION_KEY_PROVIDER_IMPLEMENTATION_CLASS);
- }
-
- return KeyProviderFactory.buildKeyProvider(implementationClassName,
config.getKeyProviderLocation(), config.getKeyId(), config.getEncryptionKeys(),
rootKey);
- }
-
- private static SecretKey getRootKey() throws KeyManagementException {
- try {
- // Get the root encryption key from bootstrap.conf
- String rootKeyHex = CryptoUtils.extractKeyFromBootstrapFile();
- return new SecretKeySpec(Hex.decodeHex(rootKeyHex.toCharArray()),
"AES");
- } catch (IOException | DecoderException e) {
- logger.error("Encountered an error: ", e);
- throw new KeyManagementException(e);
- }
+ private KeyProvider buildKeyProvider() throws KeyManagementException,
IOException {
Review comment:
KeyManagementException is never thrown in the method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]