oracle.nosql.driver.iam.PrivateKeyFileSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nosqldriver Show documentation
Show all versions of nosqldriver Show documentation
Java examples for Oracle NoSQL Database
/*-
* Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl/
*/
package oracle.nosql.driver.iam;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.function.Supplier;
/**
* @hidden
* Internal use only
*
* The class to supplies private key from file.
*/
class PrivateKeyFileSupplier implements Supplier {
private final File pemFile;
public PrivateKeyFileSupplier(File pemFile) {
this.pemFile = pemFile;
}
@Override
public InputStream get() {
try {
return new FileInputStream(pemFile);
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(
"Could not find private key: " + pemFile, e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy