1
0

IBackendInterface.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*******************************************************************************
  2. * The MIT License (MIT)
  3. *
  4. * Copyright (c) 2015-207 V2G Clarity (Dr.-Ing. Marc Mültin)
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. *******************************************************************************/
  24. package com.v2gclarity.risev2g.secc.backend;
  25. import java.security.cert.X509Certificate;
  26. import java.security.interfaces.ECPrivateKey;
  27. import java.util.HashMap;
  28. import com.v2gclarity.risev2g.secc.session.V2GCommunicationSessionSECC;
  29. import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.CertificateChainType;
  30. import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.SAScheduleListType;
  31. public interface IBackendInterface {
  32. /**
  33. * Provides a reference to the current communication session for
  34. * this backend interface.
  35. * @param commSessionContext The active communication session
  36. */
  37. public void setCommSessionContext(V2GCommunicationSessionSECC commSessionContext);
  38. /**
  39. * Provides a list of schedules coming from a secondary actor (SAScheduleList) with pMax values
  40. * and optional tariff incentives which shall influence the charging behaviour of the EV.
  41. *
  42. * @param maxEntriesSAScheduleTuple The maximum number of PMaxEntries and SalesTariff entries allowed by EVCC
  43. * @param departureTime The departure time provided by the EV
  44. * @param xmlSignatureRefElements Signature reference parameter provided to put sales tariff IDs and sales tariffs in
  45. * @return An SASchedulesType element with a list of secondary actor schedules
  46. */
  47. public SAScheduleListType getSAScheduleList(
  48. int maxEntriesSAScheduleTuple,
  49. long departureTime,
  50. HashMap<String, byte[]> xmlSignatureRefElements);
  51. /**
  52. * Provides a certificate chain coming from a secondary actor with the leaf certificate being
  53. * the contract certificate and possible intermediate certificates (Sub-CAs) included.
  54. *
  55. * This interface is to be used for the CertificateUpdate
  56. *
  57. * @param oldContractCertificateChain The to-be-updated contract certificate chain
  58. * @return Certificate chain for contract certificate
  59. */
  60. public CertificateChainType getContractCertificateChain(CertificateChainType oldContractCertChain);
  61. /**
  62. * Provides a certificate chain coming from a secondary actor with the leaf certificate being
  63. * the contract certificate and possible intermediate certificates (Sub-CAs) included.
  64. *
  65. * This interface is to be used for the CertificateInstallation
  66. *
  67. * @param oemProvisioningCert The OEM provisioning certificate
  68. * @return Certificate chain for contract certificate
  69. */
  70. public CertificateChainType getContractCertificateChain(X509Certificate oemProvisioningCert);
  71. /**
  72. * Provides the private key belonging to the contract certificate.
  73. *
  74. * @return PrivateKey of the contract certificate
  75. */
  76. public ECPrivateKey getContractCertificatePrivateKey();
  77. /**
  78. * Provides a certificate chain coming from a secondary actor with the leaf certificate being
  79. * the provisioning certificate and possible intermediate certificates (sub CAs) included.
  80. *
  81. * @return Certificate chain for provisioning certificate
  82. */
  83. public CertificateChainType getCPSCertificateChain();
  84. /**
  85. * Provides the private key belonging to the SA provisioning certificate.
  86. *
  87. * @return PrivateKey of the SA provisioning certificate
  88. */
  89. public ECPrivateKey getCPSLeafPrivateKey();
  90. /**
  91. * Provides the private key belonging to the MO Sub-CA 2 certificate (signature of SalesTariff).
  92. *
  93. * @return PrivateKey of the MO Sub-CA 2 certificate
  94. */
  95. public ECPrivateKey getMOSubCA2PrivateKey();
  96. }