package com.sunyard.chsm.param;

import com.sunyard.chsm.enums.AlgMode;
import com.sunyard.chsm.enums.Padding;
import lombok.Data;

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

@Data
public class SymEncryptReq {

    // 密钥ID
    @NotNull(message = "密钥ID不能为空")
    private Long keyId;

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

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

    // 加密模式, 默认ECB
    @NotNull(message = "加密模式不能为空")
    private AlgMode mode = AlgMode.ECB;

    // iv, CBC模式下不能为空,Base64编码
    private String iv;
}
