rust_ocpp/v2_0_1/messages/certificate_signed.rs
1//! CertificateSigned
2use crate::v2_0_1::datatypes::status_info_type::StatusInfoType;
3use crate::v2_0_1::enumerations::certificate_signed_status_enum_type::CertificateSignedStatusEnumType;
4use crate::v2_0_1::enumerations::certificate_signing_use_enum_type::CertificateSigningUseEnumType;
5use validator::Validate;
6
7/// `CertificateSignedRequest`, sent by the CSMS to the Charging Station.
8#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
9#[serde(rename_all = "camelCase")]
10pub struct CertificateSignedRequest {
11 /// The signed PEM encoded X.509 certificate. This can also contain the necessary sub
12 /// CA certificates. In that case, the order of the bundle should follow the
13 /// certificate chain, starting from the leaf certificate.
14 ///
15 /// The Configuration Variable `MaxCertificateChainSize` can be used to limit the
16 /// maximum size of this field.
17 #[validate(length(min = 0, max = 10000))]
18 pub certificate_chain: String,
19 /// Indicates the type of the signed certificate that is returned. When omitted the
20 /// certificate is used for both the 15118 connection (if implemented) and the
21 /// Charging Station to CSMS connection. This field is required when a typeOfCertificate
22 /// was included in the [SignCertificateRequest](`crate::v2_0_1::messages::sign_certificate::SignCertificateRequest`)
23 /// that requested this certificate to be signed AND both the 15118 connection
24 /// and the Charging Station connection are implemented.
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub certificate_type: Option<CertificateSigningUseEnumType>,
27}
28
29/// `CertificateSignedResponse`, sent by the Charging Station to the CSMS in response to a [`CertificateSignedRequest`].
30#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
31#[serde(rename_all = "camelCase")]
32pub struct CertificateSignedResponse {
33 /// Returns whether certificate signing has been accepted, otherwise rejected.
34 pub status: CertificateSignedStatusEnumType,
35 /// Detailed status information.
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub status_info: Option<StatusInfoType>,
38}