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.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

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) {
        this.keys = keys.stream().map(PrivateKey::of).collect(Collectors.toList());
    }

    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