Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created February 12, 2019 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/ab48b37cb61f6edd106d5dc0db674822 to your computer and use it in GitHub Desktop.
Save abhirockzz/ab48b37cb61f6edd106d5dc0db674822 to your computer and use it in GitHub Desktop.
String privateKey = System.getenv().get("OCI_PRIVATE_KEY_FILE_NAME");
Supplier<InputStream> privateKeySupplier = () -> {
InputStream is = null;
String ociPrivateKeyPath = "/function/" + privateKey;
System.err.println("Private key location - " + ociPrivateKeyPath);
try {
is = new FileInputStream(ociPrivateKeyPath);
} catch (FileNotFoundException ex) {
System.err.println("Problem accessing OCI private key at " + ociPrivateKeyPath + " - " + ex.getMessage());
}
return is;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment