// Dummy password for encrypting pem based stores in memory
private static final String DUMMY_PASSWORD = "dummy";
public static KeyStoreHelper create(VertxInternal vertx, KeyStoreOptions options) {
if (options instanceof JKSOptions) {
JKSOptions jks = (JKSOptions) options;
Callable<Buffer> value;
if (jks.getPath() != null) {
value = () -> vertx.fileSystem().readFileSync(vertx.resolveFile(jks.getPath()).getAbsolutePath());
} else if (jks.getValue() != null) {
value = () -> jks.getValue();
} else {
return null;
}
return new JKSOrPKCS12("JKS", jks.getPassword(), value);
} else if (options instanceof PKCS12Options) {
PKCS12Options pkcs12 = (PKCS12Options) options;
Callable<Buffer> value;
if (pkcs12.getPath() != null) {
value = () -> vertx.fileSystem().readFileSync(vertx.resolveFile(pkcs12.getPath()).getAbsolutePath());