浏览代码

2020/09/29 Jessica
Actions:
Security Profile add Filter Function

Jessica Tseng 4 年之前
父节点
当前提交
9732599296
共有 21 个文件被更改,包括 388 次插入22 次删除
  1. 1 1
      EVCB_OCPP.Domain/Properties/AssemblyInfo.cs
  2. 1 1
      EVCB_OCPP.MailService/Properties/AssemblyInfo.cs
  3. 14 4
      EVCB_OCPP.Packet/EVCB_OCPP.Packet.csproj
  4. 27 0
      EVCB_OCPP.Packet/Features/Security/CertificateSignedFeature.cs
  5. 27 0
      EVCB_OCPP.Packet/Features/Security/DeleteCertificateFeature.cs
  6. 27 0
      EVCB_OCPP.Packet/Features/Security/ExtendedTriggerMessageFeature.cs
  7. 27 0
      EVCB_OCPP.Packet/Features/Security/GetInstalledCertificateIdsFeature.cs
  8. 27 0
      EVCB_OCPP.Packet/Features/Security/GetLogFeature.cs
  9. 27 0
      EVCB_OCPP.Packet/Features/Security/InstallCertificateFeature.cs
  10. 27 0
      EVCB_OCPP.Packet/Features/Security/LogStatusNotificationFeature.cs
  11. 27 0
      EVCB_OCPP.Packet/Features/Security/SecurityEventNotificationFeature.cs
  12. 27 0
      EVCB_OCPP.Packet/Features/Security/SignCertificateFeature.cs
  13. 27 0
      EVCB_OCPP.Packet/Features/Security/SignedFirmwareStatusNotificationFeature.cs
  14. 27 0
      EVCB_OCPP.Packet/Features/Security/SignedUpdateFirmwareFeature.cs
  15. 42 0
      EVCB_OCPP.Packet/Features/SecurityProfile.cs
  16. 12 7
      EVCB_OCPP.Packet/Features/StandardConfiguration.cs
  17. 2 1
      EVCB_OCPP.Packet/Messages/Security/SignedUpdateFirmwareConfirmation.cs
  18. 0 6
      EVCB_OCPP.Packet/Messages/Security/UpdateFirmwareStatusEnumType.cs
  19. 17 0
      EVCB_OCPP.Packet/Messages/SubTypes/UpdateFirmwareStatusEnumType.cs
  20. 1 1
      EVCB_OCPP.Packet/Properties/AssemblyInfo.cs
  21. 1 1
      EVCB_OCPP.Packet20/Properties/AssemblyInfo.cs

+ 1 - 1
EVCB_OCPP.Domain/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("67b37f2")]
+[assembly: AssemblyInformationalVersion("016a30b")]

+ 1 - 1
EVCB_OCPP.MailService/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("67b37f2")]
+[assembly: AssemblyInformationalVersion("016a30b")]

+ 14 - 4
EVCB_OCPP.Packet/EVCB_OCPP.Packet.csproj

@@ -78,6 +78,18 @@
     <Compile Include="Features\ReservationProfile.cs" />
     <Compile Include="Features\Reservation\CancelReservationFeature.cs" />
     <Compile Include="Features\Reservation\ReserveNowFeature.cs" />
+    <Compile Include="Features\SecurityProfile.cs" />
+    <Compile Include="Features\Security\CertificateSignedFeature.cs" />
+    <Compile Include="Features\Security\DeleteCertificateFeature.cs" />
+    <Compile Include="Features\Security\ExtendedTriggerMessageFeature.cs" />
+    <Compile Include="Features\Security\GetInstalledCertificateIdsFeature.cs" />
+    <Compile Include="Features\Security\GetLogFeature.cs" />
+    <Compile Include="Features\Security\InstallCertificateFeature.cs" />
+    <Compile Include="Features\Security\LogStatusNotificationFeature.cs" />
+    <Compile Include="Features\Security\SecurityEventNotificationFeature.cs" />
+    <Compile Include="Features\Security\SignCertificateFeature.cs" />
+    <Compile Include="Features\Security\SignedFirmwareStatusNotificationFeature.cs" />
+    <Compile Include="Features\Security\SignedUpdateFirmwareFeature.cs" />
     <Compile Include="Features\SmartChargingProfile.cs" />
     <Compile Include="Features\SmartCharging\ClearChargingProfileFeature.cs" />
     <Compile Include="Features\SmartCharging\GetCompositeScheduleFeature.cs" />
@@ -165,7 +177,6 @@
     <Compile Include="Messages\Security\SignedFirmwareStatusNotificationRequest.cs" />
     <Compile Include="Messages\Security\SignedUpdateFirmwareConfirmation.cs" />
     <Compile Include="Messages\Security\SignedUpdateFirmwareRequest.cs" />
-    <Compile Include="Messages\Security\UpdateFirmwareStatusEnumType.cs" />
     <Compile Include="Messages\SmartCharging\ClearChargingProfileConfirmation.cs" />
     <Compile Include="Messages\SmartCharging\ClearChargingProfileRequest.cs" />
     <Compile Include="Messages\SmartCharging\GetCompositeScheduleConfirmation.cs" />
@@ -241,6 +252,7 @@
     <Compile Include="Messages\SubTypes\TriggerMessageStatusEnumType.cs" />
     <Compile Include="Messages\SubTypes\UnitOfMeasure.cs" />
     <Compile Include="Messages\SubTypes\UnlockStatus.cs" />
+    <Compile Include="Messages\SubTypes\UpdateFirmwareStatusEnumType.cs" />
     <Compile Include="Messages\SubTypes\UpdateStatus.cs" />
     <Compile Include="Messages\SubTypes\UpdateType.cs" />
     <Compile Include="Messages\SubTypes\UploadLogStatusEnumType.cs" />
@@ -249,9 +261,7 @@
     <Compile Include="Utilities\FormatHelper.cs" />
     <Compile Include="Utilities\UTCDateTimeConverter.cs" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Features\Security\" />
-  </ItemGroup>
+  <ItemGroup />
   <ItemGroup>
     <None Include="packages.config" />
   </ItemGroup>

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/CertificateSignedFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class CertificateSignedFeature: Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.CertificateSigned.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(CertificateSignedConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(CertificateSignedRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/DeleteCertificateFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class DeleteCertificateFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.DeleteCertificate.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(DeleteCertificateConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(DeleteCertificateRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/ExtendedTriggerMessageFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class ExtendedTriggerMessageFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.ExtendedTriggerMessage.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(ExtendedTriggerMessageConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(ExtendedTriggerMessageRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/GetInstalledCertificateIdsFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class GetInstalledCertificateIdsFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.GetInstalledCertificateIds.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(GetInstalledCertificateIdsConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(GetInstalledCertificateIdsRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/GetLogFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+   public class GetLogFeature: Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.GetLog.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(GetLogConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(GetLogRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/InstallCertificateFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class InstallCertificateFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.InstallCertificate.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(InstallCertificateConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(InstallCertificateRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/LogStatusNotificationFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class LogStatusNotificationFeature: Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.LogStatusNotification.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(LogStatusNotificationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(LogStatusNotificationRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/SecurityEventNotificationFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class SecurityEventNotificationFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.SecurityEventNotification.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(SecurityEventNotificationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(SecurityEventNotificationRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/SignCertificateFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class SignCertificateFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.SignCertificate.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(SignCertificateConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(SignCertificateRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/SignedFirmwareStatusNotificationFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class SignedFirmwareStatusNotificationFeature: Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.SignedFirmwareStatusNotification.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(SignedFirmwareStatusNotificationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(SignedFirmwareStatusNotificationRequest);
+        }
+    }
+}

+ 27 - 0
EVCB_OCPP.Packet/Features/Security/SignedUpdateFirmwareFeature.cs

@@ -0,0 +1,27 @@
+using EVCB_OCPP.Packet.Messages.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Security
+{
+    public class SignedUpdateFirmwareFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.SignedUpdateFirmware.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(SignedUpdateFirmwareConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(SignedUpdateFirmwareRequest);
+        }
+    }
+}

+ 42 - 0
EVCB_OCPP.Packet/Features/SecurityProfile.cs

@@ -0,0 +1,42 @@
+using EVCB_OCPP.Packet.Features.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features
+{
+    public class SecurityProfile : Profile
+    {
+        public SecurityProfile()
+        {
+            Name = "Security";
+
+            features.Add(new CertificateSignedFeature());
+            features.Add(new DeleteCertificateFeature());
+            features.Add(new ExtendedTriggerMessageFeature());
+            features.Add(new GetInstalledCertificateIdsFeature());
+            features.Add(new GetLogFeature());
+            features.Add(new InstallCertificateFeature());
+            features.Add(new LogStatusNotificationFeature());
+            features.Add(new SecurityEventNotificationFeature());
+            features.Add(new SignCertificateFeature());
+            features.Add(new SignedFirmwareStatusNotificationFeature());
+            features.Add(new SignedUpdateFirmwareFeature());
+
+            actions.Add(Actions.CertificateSigned.ToString());
+            actions.Add(Actions.DeleteCertificate.ToString());
+            actions.Add(Actions.ExtendedTriggerMessage.ToString());
+            actions.Add(Actions.GetInstalledCertificateIds.ToString());
+            actions.Add(Actions.GetLog.ToString());
+            actions.Add(Actions.InstallCertificate.ToString());
+            actions.Add(Actions.LogStatusNotification.ToString());
+            actions.Add(Actions.SecurityEventNotification.ToString());
+            actions.Add(Actions.SignCertificate.ToString());
+            actions.Add(Actions.SignedFirmwareStatusNotification.ToString());
+            actions.Add(Actions.SignedUpdateFirmware.ToString());
+
+        }
+    }
+}

+ 12 - 7
EVCB_OCPP.Packet/Features/StandardConfiguration.cs

@@ -112,7 +112,7 @@ namespace OCPPPackage.Profiles
         public const string CertificateStoreMaxLength = "CertificateStoreMaxLength";
         public const string CpoName = "CpoName";
         public const string SecurityProfile = "SecurityProfile";
- 
+
 
         #endregion
 
@@ -129,7 +129,7 @@ namespace OCPPPackage.Profiles
            StopTxnAlignedData,
            StopTxnAlignedDataMaxLength,
            StopTxnSampledData,
-           StopTxnSampledDataMaxLength,   
+           StopTxnSampledDataMaxLength,
            TransactionMessageAttempts,
            TransactionMessageRetryInterval,
            MaxEnergyOnInvalidId,
@@ -139,7 +139,7 @@ namespace OCPPPackage.Profiles
            MeterValuesSampledDataMaxLength,
            WebSocketPingInterval,
            MeterValueSampleInterval,
-           MinimumStatusDuration,       
+           MinimumStatusDuration,
            UnlockConnectorOnEVSideDisconnect,
            ResetRetries,
            AllowOfflineTxForUnknownId,
@@ -149,7 +149,7 @@ namespace OCPPPackage.Profiles
            ClockAlignedDataInterval,
            ConnectionTimeOut,
            ConnectorPhaseRotation,
-           ConnectorPhaseRotationMaxLength,       
+           ConnectorPhaseRotationMaxLength,
            HeartbeatInterval,
            LightIntensity,
            LocalAuthorizeOffline,
@@ -163,7 +163,12 @@ namespace OCPPPackage.Profiles
            ChargingScheduleMaxPeriods,
            ConnectorSwitch3to1PhaseSupported,
            MaxChargingProfilesInstalled,
-
+           AdditionalRootCertificateCheck,
+           AuthorizationKey,
+           CertificateSignedMaxChainSize,
+           CertificateStoreMaxLength,
+           CpoName,
+        SecurityProfile
 
 
         };
@@ -181,10 +186,10 @@ namespace OCPPPackage.Profiles
 
         }
 
-       
 
 
-     
+
+
 
 
     }

+ 2 - 1
EVCB_OCPP.Packet/Messages/Security/SignedUpdateFirmwareConfirmation.cs

@@ -1,4 +1,5 @@
-using Newtonsoft.Json;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Converters;
 using System;
 using System.Collections.Generic;

+ 0 - 6
EVCB_OCPP.Packet/Messages/Security/UpdateFirmwareStatusEnumType.cs

@@ -1,6 +0,0 @@
-namespace EVCB_OCPP.Packet.Messages.Security
-{
-    public class UpdateFirmwareStatusEnumType
-    {
-    }
-}

+ 17 - 0
EVCB_OCPP.Packet/Messages/SubTypes/UpdateFirmwareStatusEnumType.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.SubTypes
+{
+    public enum UpdateFirmwareStatusEnumType
+    {
+        Accepted=1,
+        Rejected,
+        AcceptedCanceled,
+        InvalidCertificate,
+        RevokedCertificate,
+    }
+}

+ 1 - 1
EVCB_OCPP.Packet/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("67b37f2")]
+[assembly: AssemblyInformationalVersion("016a30b")]

+ 1 - 1
EVCB_OCPP.Packet20/Properties/AssemblyInfo.cs

@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
 // [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
-[assembly: AssemblyInformationalVersion("67b37f2")]
+[assembly: AssemblyInformationalVersion("016a30b")]