CertificateSignedRequest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using EVCB_OCPP.Packet.Features;
  2. using Newtonsoft.Json;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace EVCB_OCPP.Packet.Messages.Security
  10. {
  11. public class CertificateSignedRequest:IRequest
  12. {
  13. public CertificateSignedRequest()
  14. {
  15. Action = Actions.CertificateSigned.ToString();
  16. }
  17. /// <summary>
  18. /// Required. The signed PEM encoded X.509 certificates. This can also contain the
  19. /// necessary sub CA certificates.The maximum size of this field is be limited by the
  20. /// configuration key: CertificateSignedMaxSize.
  21. /// </summary>
  22. [Required]
  23. [StringLength(10000, MinimumLength = 0)]
  24. public string certificateChain { set; get; }
  25. [JsonIgnore]
  26. public string Action { set; get; }
  27. public bool TransactionRelated()
  28. {
  29. return false;
  30. }
  31. public bool Validate()
  32. {
  33. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  34. }
  35. }
  36. }