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.Messages
{
    public class SignCertificateRequest
    {
        /// <summary>
        /// The Charging Station SHALL send the public
        /// key in form of a Certificate Signing Request(CSR) as
        ///described in RFC 2986 [22] using the
        ///SignCertificateRequest message.
        /// </summary>
        [Required]
        [StringLength(5500, MinimumLength = 0)]
        public string Csr { set; get; }

        /// <summary>
        /// Indicates the type of certificate that is to be
        ///signed.When omitted the certificate is to be used for
        ///both the 15118 connection(if implemented) and the
        ///Charging Station to CSMS connection
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public CertificateSigningUseEnumType CertificateType { set; get; }
    }
}