package com.bootdo.util.safe;

/**
 * 签名算法类型
 */
public enum SignAlgorithm {

    // The RSA signature algorithm
    NONEwithRSA("NONEwithRSA", "RSA"),

    // The MD2/MD5 with RSA Encryption signature algorithm
    MD2withRSA("MD2withRSA", "RSA"),
    MD5withRSA("MD5withRSA", "RSA"),

    // The signature algorithm with SHA-* and the RSA
    SHA1withRSA("SHA1withRSA", "RSA"),
    SHA256withRSA("SHA256withRSA", "RSA"),
    SHA384withRSA("SHA384withRSA", "RSA"),
    SHA512withRSA("SHA512withRSA", "RSA"),

    // The Digital Signature Algorithm
    NONEwithDSA("NONEwithDSA", "DSA"),
    // The DSA with SHA-1 signature algorithm
    SHA1withDSA("SHA1withDSA", "DSA"),

    // The ECDSA signature algorithms
    NONEwithECDSA("NONEwithECDSA", "EC"),
    SHA1withECDSA("SHA1withECDSA", "EC"),
    SHA256withECDSA("SHA256withECDSA", "EC"),
    SHA384withECDSA("SHA384withECDSA", "EC"),
    SHA512withECDSA("SHA512withECDSA", "EC");//

    private String value;
    private String type;

    /**
     * 构造
     *
     * @param value 算法字符表示，区分大小写
     * @param type  XXXwithXXX算法的后半部分算法，如果为ECDSA，返回算法为EC
     */
    private SignAlgorithm(String value, String type) {
        this.value = value;
        this.type = type;
    }

    /**
     * 获取算法字符串表示，区分大小写
     *
     * @return 算法字符串表示
     */
    public String getValue() {
        return this.value;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

}
