package com.sunyard.chsm.param;

import com.sunyard.chsm.enums.Padding;
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 SymMacCheckReq {
    // 密钥ID
    @NotNull(message = "密钥ID不能为空")
    private Long keyId;

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

    // 填充方式, 默认PCKS7
    private Padding padding = Padding.PCKS7Padding;

    // iv,Base64编码
    @NotBlank(message = "iv不能为空")
    private String iv;

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

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

}
