SignCertificateRequest.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 SignCertificateRequest : IRequest
  12. {
  13. public SignCertificateRequest()
  14. {
  15. Action = Actions.SignCertificate.ToString();
  16. }
  17. /// <summary>
  18. /// The Charge Point SHALL send the public key in form of a Certificate
  19. /// Signing Request(CSR) as described in RFC 2986 [14] and then PEM encoded,
  20. ////using the SignCertificate.req message.
  21. /// </summary>
  22. [Required]
  23. [StringLength(5500, MinimumLength = 0)]
  24. public string csr { 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. }