All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.everitoken.sdk.java.provider.KeyProvider Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy