blob: 3157c0da63559ace85d4a523797b60fdd222fb8e [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.security.kms;
import org.apache.nifi.security.kms.reader.StandardFileBasedKeyReader;
import org.apache.nifi.security.kms.reader.FileBasedKeyReader;
import java.nio.file.Path;
import javax.crypto.SecretKey;
/**
* File Based Key Provider reads encrypted Secret Keys from a properties file containing one or more entries
*/
public class FileBasedKeyProvider extends StaticKeyProvider {
private static final FileBasedKeyReader READER = new StandardFileBasedKeyReader();
public FileBasedKeyProvider(final Path location, final SecretKey rootKey) {
super(READER.readSecretKeys(location, rootKey));
}
}