- Included EXIficient library and according xml parser libraries (see shared/libs) as EXIficient's license finally changed from GPLv2 to MIT (MIT is compatible with EPL v1). Uncommented EXIficientCodec.java file. You now can quickly switch between EXIficientCodec and OpenEXI coded by (un)commenting the respective line in MessageHandler.java.

- A failed verification of received sales tariff (in ChargeParameterDiscoveryRes) does not lead any more to the termination of the communication session, but to just ignoring the sales tariff so that the charge process itself can still continue.
- Additional check if TLS is used when selecting a payment option from the offered list of payment options. If the SECC is offering a contract-based payment although no TLS is used (in this case the SECC shall not offer contract-based payment after all), the EVCC will not select 'CONTRACT' any more but 'EIM' instead.
- The received private key of the contract certificate (upon receipt of CertificateInstallationRes/CertificateUpdateRes) is first checked according to [V2G2-823] before saving the private key. If the check fails, the contract certificate and private key will not be safed (BUT: check is not complete, additional help with ECC mechanisms might be needed).
- All other files: Just the slight modification of the copyright header (which has been done in the master branch, but not the developer branch)
This commit is contained in:
Marc Mültin 2016-07-28 14:28:03 +02:00
parent 96ea627bb7
commit fe7aebdca4
226 changed files with 762 additions and 647 deletions

View File

@ -1,3 +1,13 @@
#*******************************************************************************
# Copyright (c) 2016 Dr.-Ing. Marc Mültin.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
#*******************************************************************************
# This shell script can be used to create all necessary certificates and keystores needed in order to
# - successfully perform a TLS handshake between the EVCC (TLSClient) and the SECC (TLSServer) and
# - install/update a contract certificate in the EVCC.

View File

@ -1,12 +1,12 @@
###############################################################################
# Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
# Copyright (c) 2016 Dr.-Ing. Marc Mültin.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
# Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
###############################################################################
# ===========================================================
# Configuration properties for a unique electric vehicle (EV)

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.evController;
@ -48,7 +48,9 @@ public class DummyEVController implements IACEVController, IDCEVController {
@Override
public PaymentOptionType getPaymentOption(PaymentOptionListType paymentOptionsOffered) {
if (paymentOptionsOffered.getPaymentOption().contains(PaymentOptionType.CONTRACT))
// Contract payment option may only be chosen if offered by SECC AND if communication is secured by TLS
if (paymentOptionsOffered.getPaymentOption().contains(PaymentOptionType.CONTRACT) &&
getCommSessionContext().isSecureCommunication())
return PaymentOptionType.CONTRACT;
else
return PaymentOptionType.EXTERNAL_PAYMENT;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.evController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.evController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.evController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.main;

View File

@ -1,16 +1,15 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.session;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
@ -49,7 +48,6 @@ import org.eclipse.risev2g.shared.messageHandling.SendMessage;
import org.eclipse.risev2g.shared.messageHandling.TerminateSession;
import org.eclipse.risev2g.shared.misc.V2GCommunicationSession;
import org.eclipse.risev2g.shared.misc.V2GTPMessage;
import org.eclipse.risev2g.shared.utils.SecurityUtils;
import org.eclipse.risev2g.shared.v2gMessages.appProtocol.AppProtocolType;
import org.eclipse.risev2g.shared.v2gMessages.appProtocol.SupportedAppProtocolRes;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.ChargeParameterDiscoveryReqType;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.session;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;
@ -77,9 +77,13 @@ public class WaitForChargeParameterDiscoveryRes extends ClientState {
SAScheduleListType saSchedules = (SAScheduleListType) chargeParameterDiscoveryRes.getSASchedules().getValue();
// Verify each sales tariff with the mobility operator sub 2 certificate
if (saSchedules != null && !verifySalesTariffs(saSchedules, v2gMessageRes.getHeader().getSignature()))
return new TerminateSession("Verification of sales tariffs failed");
// If TLS is used, verify each sales tariff (if present) with the mobility operator sub 2 certificate
if (getCommSessionContext().isSecureCommunication() && saSchedules != null) {
if (!verifySalesTariffs(saSchedules, v2gMessageRes.getHeader().getSignature()))
getLogger().warn("Verification of sales tariffs failed. They are therefore ignored in the "
+ "charge process.");
deleteUnverifiedSalesTariffs(saSchedules);
}
// Save the list of SASchedules (saves the time of reception as well)
getCommSessionContext().setSaSchedules(saSchedules);
@ -132,7 +136,7 @@ public class WaitForChargeParameterDiscoveryRes extends ClientState {
X509Certificate moSub2Certificate = SecurityUtils.getMOSub2Certificate(
GlobalValues.EVCC_KEYSTORE_FILEPATH.toString());
if (moSub2Certificate == null) {
getLogger().error("No MOSub2Certificate found");
getLogger().warn("No MOSub2Certificate found.");
return false;
} else {
ECPublicKey ecPublicKey = (ECPublicKey) moSub2Certificate.getPublicKey();
@ -144,4 +148,20 @@ public class WaitForChargeParameterDiscoveryRes extends ClientState {
return true;
}
/**
* If the signature of one ore more sales tariffs cannot be verified, then the sales tariffs should be ignored
* rather than terminating the charge process. The charge process can then proceed based solely on the
* PMaxSchedule
*
* @param saSchedules The schedule(s) from the secondary actor including PMaxSchedule and potential SalesTariff
* elements.
*/
private void deleteUnverifiedSalesTariffs(SAScheduleListType saSchedules) {
List<SAScheduleTupleType> saScheduleTuples = saSchedules.getSAScheduleTuple();
for (SAScheduleTupleType saScheduleTuple : saScheduleTuples) {
saScheduleTuple.setSalesTariff(null);
}
}
}

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;
@ -35,8 +35,14 @@ public class WaitForChargingStatusRes extends ClientState {
ChargingStatusResType chargingStatusRes =
(ChargingStatusResType) v2gMessageRes.getBody().getBodyElement().getValue();
// ReceiptRequired has higher priority than a possible EVSENotification=Renegotiate
if (chargingStatusRes.isReceiptRequired()) {
/*
* ReceiptRequired has higher priority than a possible EVSENotification=Renegotiate
*
* Check if communication is secured with TLS before reacting upon a possible request from the SECC to send
* a MeteringReceiptRequest. If no TLS is used, a MeteringReceiptRequest may not be sent because
* a signature cannot be applied without private key of the contract certificate.
*/
if (chargingStatusRes.isReceiptRequired() && getCommSessionContext().isSecureCommunication()) {
MeteringReceiptReqType meteringReceiptReq = new MeteringReceiptReqType();
meteringReceiptReq.setId("meteringReceiptReq");
meteringReceiptReq.setMeterInfo(chargingStatusRes.getMeterInfo());

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.evcc.transportLayer;

View File

@ -1,12 +1,12 @@
###############################################################################
# Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
# Copyright (c) 2016 Dr.-Ing. Marc Mültin.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
# Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
###############################################################################
# ==============================================================================
# Configuration properties for a unique electric vehicle supply equipment (EVSE)

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.backend;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.backend;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.evseController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.evseController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.evseController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.evseController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.evseController;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.main;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.session;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.session;
@ -60,6 +60,7 @@ import org.eclipse.risev2g.shared.v2gMessages.msgDef.EnergyTransferModeType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.MessageHeaderType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.MeterInfoType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.PMaxScheduleType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.PaymentOptionType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.ResponseCodeType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.SAScheduleListType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.ServiceType;
@ -84,6 +85,7 @@ public class V2GCommunicationSessionSECC extends V2GCommunicationSession impleme
private byte[] genChallenge;
private SAScheduleListType saSchedules;
private EnergyTransferModeType requestedEnergyTransferMode;
private PaymentOptionType selectedPaymentOption;
private CertificateChainType contractSignatureCertChain;
private MeterInfoType sentMeterInfo;
private boolean tlsConnection;
@ -458,4 +460,14 @@ public class V2GCommunicationSessionSECC extends V2GCommunicationSession impleme
public void setTlsConnection(boolean tlsConnection) {
this.tlsConnection = tlsConnection;
}
public PaymentOptionType getSelectedPaymentOption() {
return selectedPaymentOption;
}
public void setSelectedPaymentOption(PaymentOptionType selectedPaymentOption) {
this.selectedPaymentOption = selectedPaymentOption;
}
}

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.states;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.transportLayer;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.secc.transportLayer;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -21,6 +21,11 @@
</repositories>
<dependencies>
<dependency>
<groupId>com.siemens.ct.exi</groupId>
<artifactId>exificient</artifactId>
<version>0.9.6</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.enumerations;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.enumerations;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.enumerations;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.enumerations;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.enumerations;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.exiCodec;

View File

@ -1,192 +1,196 @@
package org.eclipse.risev2g.shared.exiCodec;
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
//import java.io.ByteArrayInputStream;
//import java.io.ByteArrayOutputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.io.StringWriter;
//import javax.xml.transform.Transformer;
//import javax.xml.transform.TransformerConfigurationException;
//import javax.xml.transform.TransformerException;
//import javax.xml.transform.TransformerFactory;
//import javax.xml.transform.sax.SAXSource;
//import javax.xml.transform.stream.StreamResult;
//import org.eclipse.risev2g.shared.enumerations.GlobalValues;
//import org.xml.sax.InputSource;
//import org.xml.sax.SAXException;
//import org.xml.sax.XMLReader;
//import org.xml.sax.helpers.XMLReaderFactory;
//import com.siemens.ct.exi.EXIFactory;
//import com.siemens.ct.exi.GrammarFactory;
//import com.siemens.ct.exi.api.sax.EXIResult;
//import com.siemens.ct.exi.api.sax.EXISource;
//import com.siemens.ct.exi.exceptions.EXIException;
//import com.siemens.ct.exi.grammars.Grammars;
//import com.siemens.ct.exi.helpers.DefaultEXIFactory;
//
//public final class EXIficientCodec extends ExiCodec {
// // -- BEGIN: SINGLETON DEFINITION --
// /*
// * Eager instantiation of the singleton, since a EXIficientCodec is always needed.
// * The JVM creates the unique instance when the class is loaded and before any thread tries to
// * access the instance variable -> thread safe.
// */
// private static final EXIficientCodec instance = new EXIficientCodec();
//
// private EXIFactory exiFactory;
// private GrammarFactory grammarFactory;
// private Grammars grammarAppProtocol;
// private Grammars grammarMsgDef;
// private OutputStream encodeOS;
//
// private EXIficientCodec() {
// super();
//
// setExiFactory(DefaultEXIFactory.newInstance());
// getExiFactory().setValuePartitionCapacity(0);
// setGrammarFactory(GrammarFactory.newInstance());
//
// /*
// * The supportedAppProtocolReq and -Res message have a different schema than the rest
// * of the V2G application layer messages
// */
// try {
// setGrammarAppProtocol(getGrammarFactory().createGrammars(
// getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString())));
// setGrammarMsgDef(getGrammarFactory().createGrammars(
// getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()),
// XSDResolver.getInstance()));
// } catch (EXIException e) {
// getLogger().error("Error occurred while trying to initialize EXIficientCodec (EXIException)!", e);
// }
// }
//
// public static EXIficientCodec getInstance() {
// return instance;
// }
// // -- END: SINGLETON DEFINITION --
//
//
//
//
// public synchronized byte[] encodeEXI(Object jaxbObject, boolean supportedAppProtocolHandshake) {
// InputStream inStream = marshalToInputStream(jaxbObject);
// ByteArrayOutputStream baos = new ByteArrayOutputStream();
// baos = ((ByteArrayOutputStream) encode(inStream, supportedAppProtocolHandshake));
//
// return baos.toByteArray();
// }
//
//
// private synchronized OutputStream encode(InputStream jaxbXML, boolean supportedAppProtocolHandshake) {
// if (supportedAppProtocolHandshake) return encode(jaxbXML, getGrammarAppProtocol());
// else return encode(jaxbXML, getGrammarMsgDef());
// }
//
//
// private synchronized OutputStream encode(InputStream jaxbXML, Grammars grammar) {
// EXIResult exiResult = null;
//
// try {
// exiFactory.setGrammars(grammar);
// encodeOS = new ByteArrayOutputStream();
// exiResult = new EXIResult(exiFactory);
// exiResult.setOutputStream(encodeOS);
// XMLReader xmlReader = XMLReaderFactory.createXMLReader();
// xmlReader.setContentHandler(exiResult.getHandler());
//
// // parse xml file
// xmlReader.parse(new InputSource(jaxbXML));
//
// encodeOS.close();
// } catch (SAXException | IOException | EXIException e) {
// getLogger().error(e.getClass().getSimpleName() + " occurred while trying to encode", e);
// }
//
// return encodeOS;
// }
//
//
// @Override
// public synchronized Object decodeEXI(byte[] exiEncodedMessage, boolean supportedAppProtocolHandshake) {
// ByteArrayInputStream bais = new ByteArrayInputStream(exiEncodedMessage);
// setDecodedExi(decode(bais, supportedAppProtocolHandshake));
//
// return unmarshallToMessage(getDecodedExi());
// }
//
//
// private synchronized String decode(InputStream exiInputStream, boolean supportedAppProtocolHandshake) {
// TransformerFactory tf = TransformerFactory.newInstance();
// Transformer transformer = null;
// StringWriter stringWriter = new StringWriter();
//
// try {
// transformer = tf.newTransformer();
// } catch (TransformerConfigurationException e) {
// getLogger().error("Error occurred while trying to decode (TransformerConfigurationException)", e);
// }
//
// if (supportedAppProtocolHandshake) exiFactory.setGrammars(grammarAppProtocol);
// else exiFactory.setGrammars(grammarMsgDef);
//
// try {
// EXISource saxSource = new EXISource(exiFactory);
// SAXSource exiSource = new SAXSource(new InputSource(exiInputStream));
// XMLReader exiReader = saxSource.getXMLReader();
// exiSource.setXMLReader(exiReader);
// transformer.transform(exiSource, new StreamResult(stringWriter));
// } catch (EXIException e) {
// getLogger().error("Error occurred while trying to decode (EXIException)", e);
// } catch (TransformerException e) {
// getLogger().error("Error occurred while trying to decode (TransformerException)", e);
// }
//
// return stringWriter.toString();
// }
//
// private Grammars getGrammarAppProtocol() {
// return grammarAppProtocol;
// }
//
// private void setGrammarAppProtocol(Grammars grammarAppProtocol) {
// this.grammarAppProtocol = grammarAppProtocol;
// }
//
// private Grammars getGrammarMsgDef() {
// return grammarMsgDef;
// }
//
// private void setGrammarMsgDef(Grammars grammarMsgDef) {
// this.grammarMsgDef = grammarMsgDef;
// }
//
// private EXIFactory getExiFactory() {
// return exiFactory;
// }
//
// private void setExiFactory(EXIFactory exiFactory) {
// this.exiFactory = exiFactory;
// }
//
// private GrammarFactory getGrammarFactory() {
// return grammarFactory;
// }
//
// private void setGrammarFactory(GrammarFactory grammarFactory) {
// this.grammarFactory = grammarFactory;
// }
//}
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringWriter;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import org.eclipse.risev2g.shared.enumerations.GlobalValues;
import org.eclipse.risev2g.shared.utils.ByteUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import com.siemens.ct.exi.EXIFactory;
import com.siemens.ct.exi.GrammarFactory;
import com.siemens.ct.exi.api.sax.EXIResult;
import com.siemens.ct.exi.api.sax.EXISource;
import com.siemens.ct.exi.exceptions.EXIException;
import com.siemens.ct.exi.grammars.Grammars;
import com.siemens.ct.exi.helpers.DefaultEXIFactory;
public final class EXIficientCodec extends ExiCodec {
// -- BEGIN: SINGLETON DEFINITION --
/*
* Eager instantiation of the singleton, since a EXIficientCodec is always needed.
* The JVM creates the unique instance when the class is loaded and before any thread tries to
* access the instance variable -> thread safe.
*/
private static final EXIficientCodec instance = new EXIficientCodec();
private EXIFactory exiFactory;
private GrammarFactory grammarFactory;
private Grammars grammarAppProtocol;
private Grammars grammarMsgDef;
private OutputStream encodeOS;
private EXIficientCodec() {
super();
setExiFactory(DefaultEXIFactory.newInstance());
getExiFactory().setValuePartitionCapacity(0);
setGrammarFactory(GrammarFactory.newInstance());
/*
* The supportedAppProtocolReq and -Res message have a different schema than the rest
* of the V2G application layer messages
*/
try {
setGrammarAppProtocol(getGrammarFactory().createGrammars(
getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString())));
setGrammarMsgDef(getGrammarFactory().createGrammars(
getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()),
XSDResolver.getInstance()));
} catch (EXIException e) {
getLogger().error("Error occurred while trying to initialize EXIficientCodec (EXIException)!", e);
}
}
public static EXIficientCodec getInstance() {
return instance;
}
// -- END: SINGLETON DEFINITION --
public synchronized byte[] encodeEXI(Object jaxbObject, boolean supportedAppProtocolHandshake) {
InputStream inStream = marshalToInputStream(jaxbObject);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos = ((ByteArrayOutputStream) encode(inStream, supportedAppProtocolHandshake));
return baos.toByteArray();
}
private synchronized OutputStream encode(InputStream jaxbXML, boolean supportedAppProtocolHandshake) {
if (supportedAppProtocolHandshake) return encode(jaxbXML, getGrammarAppProtocol());
else return encode(jaxbXML, getGrammarMsgDef());
}
private synchronized OutputStream encode(InputStream jaxbXML, Grammars grammar) {
EXIResult exiResult = null;
try {
exiFactory.setGrammars(grammar);
encodeOS = new ByteArrayOutputStream();
exiResult = new EXIResult(exiFactory);
exiResult.setOutputStream(encodeOS);
XMLReader xmlReader = XMLReaderFactory.createXMLReader();
xmlReader.setContentHandler(exiResult.getHandler());
// parse xml file
xmlReader.parse(new InputSource(jaxbXML));
encodeOS.close();
} catch (SAXException | IOException | EXIException e) {
getLogger().error(e.getClass().getSimpleName() + " occurred while trying to encode", e);
}
return encodeOS;
}
@Override
public synchronized Object decodeEXI(byte[] exiEncodedMessage, boolean supportedAppProtocolHandshake) {
ByteArrayInputStream bais = new ByteArrayInputStream(exiEncodedMessage);
setDecodedExi(decode(bais, supportedAppProtocolHandshake));
return unmarshallToMessage(getDecodedExi());
}
private synchronized String decode(InputStream exiInputStream, boolean supportedAppProtocolHandshake) {
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = null;
StringWriter stringWriter = new StringWriter();
try {
transformer = tf.newTransformer();
} catch (TransformerConfigurationException e) {
getLogger().error("Error occurred while trying to decode (TransformerConfigurationException)", e);
}
if (supportedAppProtocolHandshake) exiFactory.setGrammars(grammarAppProtocol);
else exiFactory.setGrammars(grammarMsgDef);
try {
EXISource saxSource = new EXISource(exiFactory);
SAXSource exiSource = new SAXSource(new InputSource(exiInputStream));
XMLReader exiReader = saxSource.getXMLReader();
exiSource.setXMLReader(exiReader);
transformer.transform(exiSource, new StreamResult(stringWriter));
} catch (EXIException e) {
getLogger().error("Error occurred while trying to decode (EXIException)", e);
} catch (TransformerException e) {
getLogger().error("Error occurred while trying to decode (TransformerException)", e);
}
return stringWriter.toString();
}
private Grammars getGrammarAppProtocol() {
return grammarAppProtocol;
}
private void setGrammarAppProtocol(Grammars grammarAppProtocol) {
this.grammarAppProtocol = grammarAppProtocol;
}
private Grammars getGrammarMsgDef() {
return grammarMsgDef;
}
private void setGrammarMsgDef(Grammars grammarMsgDef) {
this.grammarMsgDef = grammarMsgDef;
}
private EXIFactory getExiFactory() {
return exiFactory;
}
private void setExiFactory(EXIFactory exiFactory) {
this.exiFactory = exiFactory;
}
private GrammarFactory getGrammarFactory() {
return grammarFactory;
}
private void setGrammarFactory(GrammarFactory grammarFactory) {
this.grammarFactory = grammarFactory;
}
}

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.exiCodec;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.exiCodec;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.exiCodec;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;
@ -19,11 +19,13 @@ import javax.xml.bind.JAXBElement;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.eclipse.risev2g.shared.enumerations.GlobalValues;
import org.eclipse.risev2g.shared.exiCodec.EXIficientCodec;
import org.eclipse.risev2g.shared.exiCodec.ExiCodec;
import org.eclipse.risev2g.shared.exiCodec.OpenEXICodec;
import org.eclipse.risev2g.shared.misc.V2GCommunicationSession;
import org.eclipse.risev2g.shared.misc.V2GTPMessage;
import org.eclipse.risev2g.shared.utils.ByteUtils;
import org.eclipse.risev2g.shared.utils.MiscUtils;
import org.eclipse.risev2g.shared.utils.SecurityUtils;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.BodyBaseType;
import org.eclipse.risev2g.shared.v2gMessages.msgDef.BodyType;
@ -56,8 +58,8 @@ public class MessageHandler {
*/
public MessageHandler() {
// Choose which implementation of an EXI codec to use
// setExiCodec(EXIficientCodec.getInstance());
setExiCodec(OpenEXICodec.getInstance());
setExiCodec(EXIficientCodec.getInstance());
// setExiCodec(OpenEXICodec.getInstance());
}
public boolean isV2GTPMessageValid(V2GTPMessage v2gTpMessage) {
@ -112,7 +114,12 @@ public class MessageHandler {
public synchronized Object v2gMsgToExi(Object jaxbObject) {
return getExiCodec().encodeEXI(jaxbObject, false);
byte[] encodedEXI = getExiCodec().encodeEXI(jaxbObject, false);
// For test purposes you can log the byte array
// getLogger().debug("Encoded EXI byte array: " + ByteUtils.toStringFromByteArray(encodedEXI));
return encodedEXI;
}
@ -121,6 +128,9 @@ public class MessageHandler {
}
public synchronized Object exiToV2gMsg(byte[] exiEncodedMessage) {
// For debugging purposes
// getLogger().debug("Hex string of encoded EXI byte array: " + ByteUtils.toHexString(exiEncodedMessage));
return getExiCodec().decodeEXI(exiEncodedMessage, false);
}

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.messageHandling;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.misc;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.misc;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.misc;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.misc;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.utils;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.utils;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.utils;
@ -47,6 +47,7 @@ import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
import java.security.spec.ECGenParameterSpec;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.security.spec.ECPrivateKeySpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.InvalidParameterSpecException;
@ -615,6 +616,7 @@ public final class SecurityUtils {
ECPrivateKeySpec ecPrivateKeySpec = new ECPrivateKeySpec(new BigInteger(privateKeyBytes), ecParameterSpec);
ECPrivateKey privateKey = (ECPrivateKey) KeyFactory.getInstance("EC").generatePrivate(ecPrivateKeySpec);
return privateKey;
} catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidParameterSpecException e) {
getLogger().error(e.getClass().getSimpleName() + " occurred when trying to get private key from raw bytes", e);
@ -810,24 +812,28 @@ public final class SecurityUtils {
public static boolean saveContractCertificateChain(
String keyStorePassword,
CertificateChainType contractCertChain,
PrivateKey contractCertPrivateKey) {
ECPrivateKey contractCertPrivateKey) {
KeyStore keyStore = getKeyStore(GlobalValues.EVCC_KEYSTORE_FILEPATH.toString(), keyStorePassword);
try {
keyStore.setKeyEntry(
GlobalValues.ALIAS_CONTRACT_CERTIFICATE.toString(),
contractCertPrivateKey,
keyStorePassword.toCharArray(),
getCertificateChain(contractCertChain));
// Save the keystore persistently
FileOutputStream fos = new FileOutputStream("evccKeystore.jks");
keyStore.store(fos, GlobalValues.PASSPHRASE_FOR_CERTIFICATES_AND_KEYS.toString().toCharArray());
fos.close();
getLogger().info("Contract certificate with distinguished name '" +
getCertificate(contractCertChain.getCertificate())
.getSubjectX500Principal().getName() + "' saved");
if (!isPrivateKeyValid(contractCertPrivateKey, contractCertChain)) {
keyStore.setKeyEntry(
GlobalValues.ALIAS_CONTRACT_CERTIFICATE.toString(),
contractCertPrivateKey,
keyStorePassword.toCharArray(),
getCertificateChain(contractCertChain));
// Save the keystore persistently
FileOutputStream fos = new FileOutputStream("evccKeystore.jks");
keyStore.store(fos, GlobalValues.PASSPHRASE_FOR_CERTIFICATES_AND_KEYS.toString().toCharArray());
fos.close();
getLogger().info("Contract certificate with distinguished name '" +
getCertificate(contractCertChain.getCertificate())
.getSubjectX500Principal().getName() + "' saved");
} else {
return false;
}
} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException | NullPointerException e) {
getLogger().error(e.getClass().getSimpleName() + " occurred while trying to save contract " +
"certificate chain", e);
@ -838,6 +844,48 @@ public final class SecurityUtils {
}
private static boolean isPrivateKeyValid(ECPrivateKey privateKey, CertificateChainType contractCertChain) {
AlgorithmParameters parameters;
try {
parameters = AlgorithmParameters.getInstance("EC");
parameters.init(new ECGenParameterSpec("secp256r1"));
ECParameterSpec ecParameterSpec = parameters.getParameterSpec(ECParameterSpec.class);
// Now we need to check if the private key is correct (see requirement [V2G2-823])
BigInteger order = ecParameterSpec.getOrder();
ECPoint basePoint = ecParameterSpec.getGenerator();
BigInteger privateKeyValue = privateKey.getS();
X509Certificate contractCert = getCertificate(contractCertChain.getCertificate());
ECPublicKey publicKey = (ECPublicKey) contractCert.getPublicKey();
// 1. check
if (privateKeyValue.compareTo(order) != -1) {
getLogger().error("Validation of private key failed: its value is not strictly smaller than the "
+ "order of the base point");
return false;
}
// 2. check
/*
* TODO:
* No idea how to check for
* "multiplication of the base point with this value must generate a key matching the public key of
* the contract certificate"
* "this value" = value of private key
* -> some more expert knowledge on the arithmetic of elliptic curves is needed to tackle this!
*/
} catch (NoSuchAlgorithmException | InvalidParameterSpecException e) {
getLogger().error(e.getClass().getSimpleName() + " occurred when trying to get private key from raw bytes", e);
return false;
}
return true;
}
public static X509Certificate getContractCertificate() {
X509Certificate contractCertificate = null;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.v2gMessages;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
package org.eclipse.risev2g.shared.v2gMessages;

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert

View File

@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Marc Mültin (Chargepartner GmbH).
* Copyright (c) 2016 Dr.-Ing. Marc Mültin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr.-Ing. Marc Mültin (Chargepartner GmbH) - initial API and implementation and initial documentation
* Dr.-Ing. Marc Mültin - initial API and implementation and initial documentation
*******************************************************************************/
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert

Some files were not shown because too many files have changed in this diff Show More