using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVCB_OCPP.Packet20.DataTypes
{
    public class CertificateHashDataType
    {
        /// <summary>
        /// Used algorithms for the hashes provided
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        [Required]
        public HashAlgorithmEnumType HashAlgorithm { set; get; }

        /// <summary>
        /// hashed value of the IssuerName.
        /// </summary>
        [StringLength(128, MinimumLength = 0)]
        [Required]
        public string IssuerNameHash { set; get; }

        /// <summary>
        /// Hashed value of the issuers public key
        /// </summary>
        [StringLength(128, MinimumLength = 0)]
        [Required]
        public string IssuerKeyHash { set; get; }

        /// <summary>
        /// The serial number of the certificate.
        /// </summary>
        [StringLength(40, MinimumLength = 0)]
        [Required]
        public string SerialNumber { set; get; }
    }
}
