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

io.irain.reactor.security.interfaces.PublicKeyInterface Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package io.irain.reactor.security.interfaces;

import io.irain.reactor.commons.crypto.RSAUtil;
import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * @author youta
 **/
public interface PublicKeyInterface {

    /**
     * 通过appid获取公钥
     *
     * @param appid id
     * @return 公钥
     */
    Mono loadPublicKeyByAppid(String appid);

    /**
     * 验证签名
     *
     * @param map       参数
     * @param publicKey 公钥
     * @return 是否验证通过
     */
    default boolean verify(Map map, String publicKey) {
        return RSAUtil.check(map, publicKey);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy