package com.sunyard.chsm.param;

import com.sunyard.chsm.enums.HashAlg;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
public class SymHmacCheckReq {
    // 密钥ID
    @NotNull(message = "密钥ID不能为空")
    private Long keyId;

    // 密钥索引
    @NotEmpty(message = "密钥索引不能为空")
    @Size(min = 15, max = 24, message = "密钥索引长度在15-24")
    private String keyIndex;

    // Hash算法,默认SM3
    private HashAlg hashAlg = HashAlg.SM3;

    // 明文,使用Base64编码
    @NotBlank(message = "明文不能为空")
    private String plainData;

    // hmac值,使用Base64编码
    @NotBlank(message = "hmac不能为空")
    private String hmac;

}
