io.everitoken.sdk.java.provider.KeyProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chain-sdk Show documentation
Show all versions of chain-sdk Show documentation
Official Java SDK for everiToken public chain. https://www.everitoken.io
package io.everitoken.sdk.java.provider;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import io.everitoken.sdk.java.PrivateKey;
public class KeyProvider implements KeyProviderInterface {
private final List keys;
private KeyProvider(@NotNull final List keys) {
List keyList = new ArrayList<>();
for (String key : keys) {
keyList.add(PrivateKey.of(key));
}
this.keys = keyList;
}
public static KeyProvider of(String key) {
return new KeyProvider(Collections.singletonList(key));
}
public static KeyProvider of(String[] keys) {
return new KeyProvider(Arrays.asList(keys));
}
public List get() {
return keys;
}
}