├── README.md ├── de.persosim.simulator.ui ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.pde.core.prefs │ └── org.eclipse.jdt.core.prefs ├── persosim_small.png ├── build.properties ├── .classpath ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ └── ui │ │ ├── handlers │ │ ├── SelectPersoFromTemplateHandler.java │ │ ├── SelectPersoFromFileHandler.java │ │ └── RemoveCardHandler.java │ │ └── utils │ │ └── FileComparator.java ├── NOTICE ├── pom.xml ├── .project ├── plugin.xml └── META-INF │ └── MANIFEST.MF ├── de.persosim.simulator.adapter.socket.ui ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.pde.core.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── plugin.xml ├── .classpath ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ └── adapter │ │ └── socket │ │ └── ui │ │ ├── vsmartcard │ │ └── Commands.java │ │ ├── PreferenceConstants.java │ │ └── handlers │ │ └── ConfigureVSmartcardHandler.java ├── NOTICE ├── pom.xml ├── .project └── META-INF │ └── MANIFEST.MF ├── de.persosim.simulator ├── .gitignore ├── personalization │ ├── .gitignore │ ├── gtCertificates │ │ ├── DETESTeID00005.cvcert │ │ ├── CFG.DFLT.EAC.AT │ │ │ ├── CVCA_KEY_01.bin │ │ │ ├── CVCA_KEY_01.pkcs8 │ │ │ ├── DV_Key_01_at.bin │ │ │ ├── at_cert_1.cvcert │ │ │ ├── CVCA_Cert_01.cvcert │ │ │ ├── dv_at_cert_1.cvcert │ │ │ ├── AT_Key_01_default.bin │ │ │ └── AT_Key_01_default.pkcs8 │ │ ├── CFG.DFLT.EAC.IS │ │ │ ├── CVCA_KEY_01.bin │ │ │ ├── CVCA_KEY_01.pkcs8 │ │ │ ├── DV_Key_01_is.bin │ │ │ ├── is_cert_1.cvcert │ │ │ ├── CVCA_Cert_01.cvcert │ │ │ ├── DV_Key_01_is.pkcs8 │ │ │ ├── dv_is_cert_1.cvcert │ │ │ ├── IS_Key_01_default.bin │ │ │ └── IS_Key_01_default.pkcs8 │ │ └── CFG.DFLT.EAC.ST │ │ │ ├── CVCA_KEY_01.bin │ │ │ ├── CVCA_KEY_01.pkcs8 │ │ │ ├── DV_Key_01_st.bin │ │ │ ├── st_cert_1.cvcert │ │ │ ├── CVCA_Cert_01.cvcert │ │ │ ├── DV_Key_01_st.pkcs8 │ │ │ ├── dv_st_cert_1.cvcert │ │ │ ├── ST_Key_01_default.bin │ │ │ └── ST_Key_01_default.pkcs8 │ └── profiles_overlays.preferences ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ ├── protocols │ │ ├── ta │ │ │ ├── TaProtocol.java │ │ │ └── RelativeAuthorization.java │ │ ├── file │ │ │ ├── FileProtocol.java │ │ │ └── CurrentFileSecMechanism.java │ │ ├── pace │ │ │ ├── package-info.java │ │ │ ├── PaceProtocol.java │ │ │ ├── PaceException.java │ │ │ └── MappingResultGm.java │ │ ├── ca │ │ │ ├── package-info.java │ │ │ └── CaProtocol.java │ │ ├── SecInfoPublicity.java │ │ ├── auxVerification │ │ │ └── AuxOid.java │ │ ├── ca3 │ │ │ ├── ChipAuthentication3Mechanism.java │ │ │ ├── Ps.java │ │ │ └── Psa.java │ │ ├── ResponseData.java │ │ └── ProtocolUpdate.java │ │ ├── processing │ │ ├── ProcessingState.java │ │ ├── ProcessingStateUpdate.java │ │ └── UpdatePropagation.java │ │ ├── cardobjects │ │ ├── AuthObject.java │ │ ├── MasterFileIdentifier.java │ │ ├── MasterFile.java │ │ ├── CardFile.java │ │ ├── KeyIdentifier.java │ │ ├── DomainParameterSetIdentifier.java │ │ ├── CardObjectWrapper.java │ │ ├── DateTimeCardObject.java │ │ ├── AuxDataObject.java │ │ ├── CardObjectIdentifier.java │ │ ├── AbstractCardObjectIdentifier.java │ │ ├── Iso7816LifeCycle.java │ │ ├── NullCardObject.java │ │ ├── AuthObjectIdentifier.java │ │ └── TrustPointIdentifier.java │ │ ├── perso │ │ ├── export │ │ │ ├── OidForSerialization.java │ │ │ ├── OverlayProfile.java │ │ │ └── File.java │ │ ├── PersoCreationFailedException.java │ │ ├── Personalization.java │ │ ├── ShouldSerializeMemberImpl.java │ │ └── xstream │ │ │ ├── EncodedByteArrayConverter.java │ │ │ └── NullConverter.java │ │ ├── tlv │ │ ├── CharacterStringType.java │ │ ├── ValidityChecks.java │ │ ├── Asn1DateWrapper.java │ │ ├── TlvValue.java │ │ ├── Asn1Date.java │ │ ├── Asn1IcaoStringWrapper.java │ │ ├── Asn1Utf8StringWrapper.java │ │ ├── Asn1IcaoCountryWrapper.java │ │ ├── Asn1Utf8String.java │ │ ├── Asn1PrintableStringWrapper.java │ │ ├── Asn1IcaoString.java │ │ ├── Asn1IcaoCountry.java │ │ ├── Asn1PrintableString.java │ │ ├── Asn1DocumentType.java │ │ ├── Asn1BitString.java │ │ └── TlvTagIdentifier.java │ │ ├── utils │ │ ├── Serialized.java │ │ └── XstreamSerialized.java │ │ ├── secstatus │ │ ├── SecStatusUpdatePropagation.java │ │ ├── SecurityEvent.java │ │ ├── AbstractSecMechanism.java │ │ ├── SecStatusEventUpdatePropagation.java │ │ ├── CAPAUsedPasswordMechanism.java │ │ ├── PaceUsedPasswordMechanism.java │ │ ├── SessionContextIdMechanism.java │ │ ├── SecStatusStoreUpdatePropagation.java │ │ ├── SecStatusMechanismUpdatePropagation.java │ │ └── SecMechanism.java │ │ ├── documents │ │ ├── MrzTD1.java │ │ ├── MrzTD3.java │ │ ├── MrzFactory.java │ │ └── MrzTD2.java │ │ ├── crypto │ │ ├── CryptoSupportAes.java │ │ ├── certificates │ │ │ ├── CvOid.java │ │ │ ├── ExtensionOid.java │ │ │ └── CertificateExtension.java │ │ ├── SignatureOids.java │ │ └── StandardizedDomainParameterProvider.java │ │ ├── securemessaging │ │ └── SmDataProviderGenerator.java │ │ ├── seccondition │ │ ├── NeverSecCondition.java │ │ ├── OrSecCondition.java │ │ ├── AndSecCondition.java │ │ ├── NotSecCondition.java │ │ ├── CAPASecurityCondition.java │ │ ├── PaceSecurityCondition.java │ │ ├── CAPAWithPasswordSecurityCondition.java │ │ └── PaceWithPasswordSecurityCondition.java │ │ ├── statemachine │ │ └── AbstractStateMachine.java │ │ ├── apdu │ │ ├── InterindustryCommandApdu.java │ │ └── IsoCompatibleProprietaryCommandApdu.java │ │ ├── platform │ │ ├── HardwareCommandApduPropagation.java │ │ ├── CommandProcessor.java │ │ ├── ProtocolMechanism.java │ │ └── HardwareResponseApduPropagation.java │ │ ├── CommandParserResult.java │ │ ├── apdumatching │ │ └── ApduSpecificationConstants.java │ │ └── exception │ │ └── LifeCycleChangeException.java ├── build.properties ├── .classpath ├── NOTICE ├── pom.xml ├── .project └── ReadMe.md ├── de.persosim.simulator.soap ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ └── control │ │ └── soap │ │ └── service │ │ ├── package-info.java │ │ ├── PersoSimRemoteControlResult.java │ │ └── ObjectFactory.java ├── pom.xml ├── .classpath ├── META-INF │ └── MANIFEST.MF └── .project ├── .gitignore ├── de.persosim.simulator.adapter.socket ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── .classpath ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ └── adapter │ │ └── socket │ │ ├── SimulatorProvider.java │ │ └── protocol │ │ └── SocketProtocol.java ├── NOTICE ├── pom.xml ├── .project └── META-INF │ └── MANIFEST.MF ├── de.persosim.simulator.basics ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ ├── utils │ │ ├── PreferenceAccessor.java │ │ └── Base64.java │ │ ├── exception │ │ ├── BitFieldOutOfBoundsException.java │ │ ├── NotParseableException.java │ │ ├── TagNotFoundException.java │ │ ├── CarParameterInvalidException.java │ │ ├── CardException.java │ │ ├── ProtocolException.java │ │ ├── NotImplementedException.java │ │ ├── FileIdentifierIncorrectValueException.java │ │ ├── VerificationException.java │ │ ├── AccessDeniedException.java │ │ ├── CertificateUpdateException.java │ │ ├── ObjectNotModifiedException.java │ │ ├── ProcessingException.java │ │ ├── CertificateNotParseableException.java │ │ ├── ISO7816Exception.java │ │ ├── CryptoException.java │ │ ├── CommandParameterUndefinedException.java │ │ └── GeneralException.java │ │ ├── preferences │ │ ├── PreferenceConstants.java │ │ └── EclipsePreferenceAccessor.java │ │ └── log │ │ └── PersoSimTagFilter.java ├── pom.xml ├── META-INF │ └── MANIFEST.MF ├── .classpath └── .project ├── de.persosim.simulator.controller ├── .gitignore ├── build.properties ├── .classpath ├── .settings │ └── org.eclipse.jdt.core.prefs ├── pom.xml ├── META-INF │ └── MANIFEST.MF ├── .project ├── plugin.xml └── src │ └── de │ └── persosim │ └── simulator │ └── controller │ └── Activator.java ├── de.persosim.simulator.test ├── .gitignore ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── wsdl │ ├── import │ ├── gen │ │ └── de │ │ │ └── persosim │ │ │ └── simulator │ │ │ └── control │ │ │ └── soap │ │ │ └── service │ │ │ ├── package-info.java │ │ │ ├── PersoSimRemoteControlResult.java │ │ │ └── ObjectFactory.java │ └── PersoSimRemoteControlResult.xsd ├── src │ └── de │ │ └── persosim │ │ └── simulator │ │ ├── utils │ │ └── MutableArrayWrapper.java │ │ ├── protocols │ │ ├── pace │ │ │ ├── TestMasterFile.java │ │ │ └── PaceOidTest.java │ │ ├── ca │ │ │ └── CaOidTest.java │ │ ├── ta │ │ │ └── AuthenticatedAuxiliaryDataTest.java │ │ └── TestTr03110UtilsProvider.java │ │ ├── platform │ │ └── MethodCall.java │ │ ├── perso │ │ ├── Profile02Test.java │ │ ├── Profile03Test.java │ │ ├── Profile04Test.java │ │ ├── Profile05Test.java │ │ ├── Profile06Test.java │ │ ├── Profile07Test.java │ │ ├── Profile08Test.java │ │ ├── Profile09Test.java │ │ ├── Profile10Test.java │ │ ├── Profile11Test.java │ │ ├── ProfileUB01Test.java │ │ ├── ProfileUB02Test.java │ │ ├── ProfileUB03Test.java │ │ ├── ProfileUB04Test.java │ │ ├── ProfileUB05Test.java │ │ └── DefaultPersoGtTest.java │ │ ├── cardobjects │ │ ├── PasswordAuthObjectTest.java │ │ └── NullCardObjectTest.java │ │ ├── crypto │ │ └── KeyDerivationFunctionTest.java │ │ ├── apdu │ │ └── CommandApduImplTest.java │ │ └── test │ │ └── PersoSimTestCase.java ├── .classpath ├── NOTICE ├── pom.xml ├── .project └── META-INF │ └── MANIFEST.MF ├── de.persosim.simulator.integrationtest ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── .gitignore ├── .classpath ├── NOTICE ├── .project ├── pom.xml └── META-INF │ └── MANIFEST.MF ├── de.persosim.simulator.adapter.socket.test ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── build.properties ├── .classpath ├── META-INF │ └── MANIFEST.MF ├── pom.xml └── .project └── .gitattributes /README.md: -------------------------------------------------------------------------------- 1 | PersoSim 2 | ======== 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /target 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /de.persosim.simulator/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | target/ 3 | tmp/ 4 | **/.tycho-consumer-pom.xml 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /target/ 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/.gitignore: -------------------------------------------------------------------------------- 1 | /profiles_overlays/ 2 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | /target 5 | /coverage-report 6 | /tmp 7 | -------------------------------------------------------------------------------- /de.persosim.simulator/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/build.properties: -------------------------------------------------------------------------------- 1 | output.. = bin/ 2 | bin.includes = META-INF/,\ 3 | . 4 | source.. = src/ 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/build.properties: -------------------------------------------------------------------------------- 1 | output.. = bin/ 2 | bin.includes = META-INF/,\ 3 | . 4 | source.. = src/ 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/wsdl/import: -------------------------------------------------------------------------------- 1 | export LANG=C 2 | >wsimport -keep -verbose http://localhost:8890/persosim/PersoSimRemoteControlResult?wsdl -d gen -------------------------------------------------------------------------------- /de.persosim.simulator.ui/persosim_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator.ui/persosim_small.png -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | /logs 4 | /target 5 | /coverage-report 6 | /tmp 7 | /opencard.properties 8 | /socket.log 9 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=false 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/build.properties: -------------------------------------------------------------------------------- 1 | output.. = bin/ 2 | bin.includes = META-INF/,\ 3 | .,\ 4 | plugin.xml 5 | source.. = src/ 6 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=false 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ta/TaProtocol.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ta; 2 | 3 | public class TaProtocol extends DefaultTaProtocol { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /de.persosim.simulator/build.properties: -------------------------------------------------------------------------------- 1 | output.. = bin/ 2 | bin.includes = META-INF/,\ 3 | .,\ 4 | personalization/ 5 | src.includes = personalization/ 6 | source.. = src/ 7 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/file/FileProtocol.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.file; 2 | 3 | public class FileProtocol extends DefaultFileProtocol { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/build.properties: -------------------------------------------------------------------------------- 1 | output.. = bin/ 2 | bin.includes = plugin.xml,\ 3 | META-INF/,\ 4 | .,\ 5 | fragment.e4xmi 6 | source.. = src/ 7 | -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/DETESTeID00005.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/DETESTeID00005.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/utils/MutableArrayWrapper.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.utils; 2 | 3 | public class MutableArrayWrapper { 4 | MutableArrayWrapper next; 5 | byte [] content; 6 | } 7 | -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_KEY_01.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_KEY_01.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_KEY_01.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_KEY_01.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/DV_Key_01_at.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/DV_Key_01_at.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/at_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/at_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_KEY_01.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_KEY_01.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_KEY_01.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_KEY_01.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/DV_Key_01_is.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/DV_Key_01_is.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/is_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/is_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_KEY_01.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_KEY_01.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_KEY_01.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_KEY_01.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/DV_Key_01_st.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/DV_Key_01_st.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/st_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/st_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_Cert_01.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/CVCA_Cert_01.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/dv_at_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/dv_at_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_Cert_01.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/CVCA_Cert_01.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/DV_Key_01_is.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/DV_Key_01_is.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/dv_is_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/dv_is_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_Cert_01.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/CVCA_Cert_01.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/DV_Key_01_st.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/DV_Key_01_st.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/dv_st_cert_1.cvcert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/dv_st_cert_1.cvcert -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/AT_Key_01_default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/AT_Key_01_default.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/IS_Key_01_default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/IS_Key_01_default.bin -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/ST_Key_01_default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/ST_Key_01_default.bin -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/processing/ProcessingState.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.processing; 2 | 3 | public class ProcessingState { 4 | 5 | public ProcessingState() { 6 | super(); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/AT_Key_01_default.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.AT/AT_Key_01_default.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/IS_Key_01_default.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.IS/IS_Key_01_default.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/ST_Key_01_default.pkcs8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator/personalization/gtCertificates/CFG.DFLT.EAC.ST/ST_Key_01_default.pkcs8 -------------------------------------------------------------------------------- /de.persosim.simulator.soap/src/de/persosim/simulator/control/soap/service/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://service.soap.control.simulator.persosim.de/") 2 | package de.persosim.simulator.control.soap.service; 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/wsdl/gen/de/persosim/simulator/control/soap/service/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://service.soap.control.simulator.persosim.de/") 2 | package de.persosim.simulator.control.soap.service; 3 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/protocols/pace/TestMasterFile.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.pace; 2 | 3 | import de.persosim.simulator.cardobjects.MasterFile; 4 | 5 | public class TestMasterFile extends MasterFile { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | .,\ 6 | fragment.e4xmi,\ 7 | persosim_small.png,\ 8 | src/ 9 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/pace/package-info.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.pace; 2 | 3 | /** 4 | * de.persosim.simulator.protocols.pace is a collection of classes used for the implementation of the PACE protocol. 5 | */ 6 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/src/de/persosim/simulator/control/soap/service/PersoSimRemoteControlResult.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator.soap/src/de/persosim/simulator/control/soap/service/PersoSimRemoteControlResult.java -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/utils/PreferenceAccessor.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.utils; 2 | 3 | public interface PreferenceAccessor { 4 | 5 | public void set(String key, String value); 6 | 7 | public String get(String key); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/wsdl/gen/de/persosim/simulator/control/soap/service/PersoSimRemoteControlResult.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersoSim/de.persosim.simulator/HEAD/de.persosim.simulator.test/wsdl/gen/de/persosim/simulator/control/soap/service/PersoSimRemoteControlResult.java -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/BitFieldOutOfBoundsException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | public class BitFieldOutOfBoundsException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ca/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains an implementation of the Chip Authentication (CA) protocol version 2 according to TR-03110. 3 | * 4 | * @author slutters 5 | * 6 | */ 7 | package de.persosim.simulator.protocols.ca; 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/platform/MethodCall.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.platform; 2 | 3 | public class MethodCall { 4 | 5 | public String methodName; 6 | public MethodCall(String methodName, Object... params) { 7 | this.methodName = methodName; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/NotParseableException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | public class NotParseableException extends Exception { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public NotParseableException(String arg0) { 7 | super(arg0); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/AuthObject.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | /** 4 | * This interface describes authentication objects to be used in the object 5 | * store structure. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public interface AuthObject extends CardObject { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/TagNotFoundException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | public class TagNotFoundException extends Exception { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public TagNotFoundException(String message){ 8 | super(message); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CarParameterInvalidException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | public class CarParameterInvalidException extends Exception { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public CarParameterInvalidException(String arg0) { 8 | super(arg0); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ca/CaProtocol.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ca; 2 | 3 | public class CaProtocol extends DefaultCaProtocol { 4 | 5 | public void setStateVar(int value) { 6 | stateVar = value; 7 | } 8 | 9 | public void setStateVarCA_IN_PROGRESS(int value) { 10 | stateVarCA_IN_PROGRESS = value; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/export/OidForSerialization.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso.export; 2 | 3 | import de.persosim.simulator.protocols.GenericOid; 4 | 5 | public class OidForSerialization extends GenericOid 6 | { 7 | 8 | public OidForSerialization(byte[] byteArrayRepresentation) 9 | { 10 | super(byteArrayRepresentation); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/CharacterStringType.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | import java.nio.charset.Charset; 4 | import java.util.regex.Pattern; 5 | 6 | /** 7 | * 8 | */ 9 | public interface CharacterStringType { 10 | 11 | public byte getTag(); 12 | 13 | public Pattern getPattern(); 14 | 15 | public Charset getCharset(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CardException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | */ 7 | public class CardException extends GeneralException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public CardException(short statusWord, String message) { 12 | super(statusWord, message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.compliance=17 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=17 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/ProtocolException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | */ 7 | public abstract class ProtocolException extends GeneralException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ProtocolException(short statusWord, String message) { 12 | super(statusWord, message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/utils/Serialized.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.utils; 2 | 3 | /** 4 | * This interface marks representations of serialized objects and provides type 5 | * safety. Storage of serialized data is implementation specific. 6 | * 7 | * @author mboonk 8 | * 9 | * @param 10 | * the type of the serialized object 11 | */ 12 | public interface Serialized { 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.compliance=17 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=17 8 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/ValidityChecks.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This interface defines static final variables to be used in the context of 5 | * validity checks. 6 | * 7 | * @author slutters 8 | * 9 | */ 10 | public interface ValidityChecks { 11 | public static final boolean PERFORM_VALIDITY_CHECKS = true; 12 | public static final boolean SKIP_VALIDITY_CHECKS = false; 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/src/de/persosim/simulator/adapter/socket/ui/vsmartcard/Commands.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.adapter.socket.ui.vsmartcard; 2 | 3 | public enum Commands { 4 | POWER_OFF((byte) 0), POWER_ON((byte) 1), RESET((byte) 2); 5 | 6 | private byte value; 7 | 8 | private Commands(byte i) { 9 | value = i; 10 | } 11 | 12 | public byte [] getCommand() { 13 | return new byte [] { value }; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecStatusUpdatePropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | 5 | /** 6 | * Container to store new value for the SecStatus and propagate it from protocol 7 | * to the SecStatus 8 | * 9 | * @author amay 10 | * 11 | */ 12 | public abstract class SecStatusUpdatePropagation implements UpdatePropagation { 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/preferences/PreferenceConstants.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.preferences; 2 | 3 | public class PreferenceConstants 4 | { 5 | public static final String PREF_LOG_LEVELS = "LOG_LEVELS"; 6 | public static final String PREF_LOG_TAGS = "LOG_TAGS"; 7 | public static final String PREF_DELIMITER = ":"; 8 | 9 | private PreferenceConstants() 10 | { 11 | // Hide implicit public constructor 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/NotImplementedException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | public class NotImplementedException extends RuntimeException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public NotImplementedException() { 11 | super(); 12 | } 13 | 14 | public NotImplementedException(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.a32 text eol=lf 2 | *.bat text eol=lf 3 | *.classpath text eol=lf 4 | *.dtd text eol=lf 5 | *.html text eol=lf 6 | *.java text eol=lf 7 | *.js text eol=lf 8 | *.md text eol=lf 9 | *.MF text eol=lf 10 | *.properties text eol=lf 11 | *.project text eol=lf 12 | *.sh text eol=lf 13 | *.txt text eol=lf 14 | *.xml text eol=lf 15 | *.xsl text eol=lf 16 | *.gt text eol=lf 17 | *.gtsuite text eol=lf 18 | *.gtspec text eol=lf 19 | LICENSE text eol=lf 20 | NOTICE text eol=lf -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/FileIdentifierIncorrectValueException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This unchecked exception can be thrown for P1P2 contents that depict invalid file identifiers. 5 | * @author mboonk 6 | * 7 | */ 8 | public class FileIdentifierIncorrectValueException extends RuntimeException { 9 | 10 | /** 11 | * 12 | */ 13 | private static final long serialVersionUID = 1L; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.compliance=17 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.release=disabled 8 | org.eclipse.jdt.core.compiler.source=17 9 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/VerificationException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This {@link Exception} can be thrown if a verification (e.g. comparing hashes) fails. 5 | * @author mboonk 6 | * 7 | */ 8 | public class VerificationException extends Exception { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | public VerificationException(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/pace/PaceProtocol.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.pace; 2 | 3 | public class PaceProtocol extends DefaultPaceProtocol { 4 | 5 | public PaceProtocol() { 6 | protocolName = getProtocolName(); 7 | } 8 | 9 | @Override 10 | public String getProtocolName() { 11 | return "PACE"; 12 | } 13 | 14 | @Override 15 | protected PaceOid getOid(byte[] oidRaw) { 16 | return new PaceOid(oidRaw, prefixOid); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.compliance=17 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.release=disabled 8 | org.eclipse.jdt.core.compiler.source=17 9 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/MasterFileIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | 4 | /** 5 | * {@link CardObjectIdentifier} that can be used to search for 6 | * {@link MasterFile}s 7 | * 8 | * @author amay 9 | * 10 | */ 11 | public class MasterFileIdentifier implements CardObjectIdentifier { 12 | 13 | @Override 14 | public boolean matches(CardObject currentObject) { 15 | return (currentObject instanceof MasterFile); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/src/de/persosim/simulator/adapter/socket/ui/PreferenceConstants.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.adapter.socket.ui; 2 | 3 | import de.persosim.simulator.adapter.socket.protocol.VSmartCardProtocol; 4 | 5 | public interface PreferenceConstants { 6 | public static final String VSMARTCARD_PORT = "vsmartcard_port"; 7 | public static final String VSMARTCARD_PORT_DEFAULT = VSmartCardProtocol.DEFAULT_PORT + ""; 8 | public static final String VSMARTCARD_LAST_INTERFACE = "vsmartcard_last_interface"; 9 | } 10 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/src/de/persosim/simulator/adapter/socket/SimulatorProvider.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.adapter.socket; 2 | 3 | import org.globaltester.simulator.Simulator; 4 | 5 | /** 6 | * Implementations of this interface can provide a {@link Simulator} 7 | * implementation. 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public interface SimulatorProvider { 13 | 14 | /** 15 | * @return a {@link Simulator} implementation or null if none is available 16 | */ 17 | abstract Simulator getSimulator(); 18 | } 19 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/AccessDeniedException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This exception is to be thrown if an object or function is accessed and the 5 | * access is not allowed. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class AccessDeniedException extends Exception { 11 | 12 | public AccessDeniedException(String message) { 13 | super(message); 14 | } 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 1L; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /de.persosim.simulator/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 3 | org.eclipse.jdt.core.compiler.compliance=17 4 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 5 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning 8 | org.eclipse.jdt.core.compiler.release=enabled 9 | org.eclipse.jdt.core.compiler.source=17 10 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 3 | org.eclipse.jdt.core.compiler.compliance=17 4 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 5 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning 8 | org.eclipse.jdt.core.compiler.release=enabled 9 | org.eclipse.jdt.core.compiler.source=17 10 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 3 | org.eclipse.jdt.core.compiler.compliance=17 4 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 5 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning 8 | org.eclipse.jdt.core.compiler.release=enabled 9 | org.eclipse.jdt.core.compiler.source=17 10 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Adapter Socket Test 4 | Bundle-SymbolicName: de.persosim.simulator.adapter.socket.test 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-RequiredExecutionEnvironment: JavaSE-17 7 | Require-Bundle: org.junit, 8 | de.persosim.simulator.adapter.socket.ui, 9 | de.persosim.simulator, 10 | de.persosim.simulator.adapter.socket 11 | Bundle-Vendor: secunet Security Networks AG 12 | Automatic-Module-Name: de.persosim.remoteifd.test 13 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecurityEvent.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | /** 4 | * This enum lists all possible events, that can be used by the 5 | * {@link SecStatus} to determine via 6 | * {@link SecMechanism#needsDeletionInCaseOf(SecurityEvent)} if this particular 7 | * algorithm must be removed. 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public enum SecurityEvent { 13 | SECURE_MESSAGING_SESSION_ENDED, 14 | STORE_SESSION_CONTEXT, 15 | RESTORE_SESSION_CONTEXT, 16 | EXTENDED_ACCESS_SESSION_ENDED 17 | } 18 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CertificateUpdateException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This exception is to be thrown when an update of a trust point does not 5 | * finish because of restrictions or errors. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class CertificateUpdateException extends Exception { 11 | 12 | public CertificateUpdateException(String string) { 13 | super(string); 14 | } 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 1L; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/ObjectNotModifiedException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This exception is to be thrown if the tried modification was not possible 5 | * because of access rights, life cycle state or other security conditions. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class ObjectNotModifiedException extends RuntimeException { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | public ObjectNotModifiedException(String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/SecInfoPublicity.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols; 2 | 3 | 4 | /** 5 | * This contains the different level of publicity for the security infos 6 | * returned by protocols. It is used when creating card files containing 7 | * security infos by 8 | * {@link Protocol#getSecInfos(SecInfoPublicity, de.persosim.simulator.cardobjects.MasterFile)} 9 | * . 10 | * 11 | * @author jgoeke 12 | * 13 | */ 14 | public enum SecInfoPublicity { 15 | 16 | PUBLIC, 17 | AUTHENTICATED, 18 | PRIVILEGED 19 | 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/protocols/ca/CaOidTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ca; 2 | 3 | import static org.junit.Assert.assertNull; 4 | 5 | import org.junit.Test; 6 | 7 | import de.persosim.simulator.protocols.pace.Pace; 8 | 9 | public class CaOidTest { 10 | 11 | /** 12 | * Negative test: That null is returned for an Oid that is not an CaOid 13 | */ 14 | @Test 15 | public void testGetStringRepresentation_nonCaOid() { 16 | assertNull (CaOid.id_CA_ECDH_AES_CBC_CMAC_128.getStringRepresentation(Pace.id_PACE_ECDH_GM_AES_CBC_CMAC_128.toByteArray())); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/src/de/persosim/simulator/adapter/socket/ui/handlers/ConfigureVSmartcardHandler.java: -------------------------------------------------------------------------------- 1 | 2 | package de.persosim.simulator.adapter.socket.ui.handlers; 3 | 4 | import org.eclipse.e4.core.di.annotations.Execute; 5 | import org.eclipse.swt.widgets.Shell; 6 | 7 | import de.persosim.simulator.adapter.socket.ui.parts.ConfigVSmartcardDialog; 8 | 9 | public class ConfigureVSmartcardHandler 10 | { 11 | @Execute 12 | public void execute(Shell shell) 13 | { 14 | // configuration dialog 15 | ConfigVSmartcardDialog dialog = new ConfigVSmartcardDialog(shell); 16 | dialog.open(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/protocols/pace/PaceOidTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.pace; 2 | 3 | import static org.junit.Assert.assertNull; 4 | 5 | import org.junit.Test; 6 | 7 | import de.persosim.simulator.protocols.ca.Ca; 8 | 9 | public class PaceOidTest { 10 | 11 | /** 12 | * Negative test: That null is returned for an Oid that is not an PaceOid 13 | */ 14 | @Test 15 | public void testGetStringRepresentation_nonPaceOid() { 16 | assertNull (PaceOid.id_PACE_ECDH_GM_AES_CBC_CMAC_128.getStringRepresentation(Ca.id_CA_DH_AES_CBC_CMAC_128.toByteArray())); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile02Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile02Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile02(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile03Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile03Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile03(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile04Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile04Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile04(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile05Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile05Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile05(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile06Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile06Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile06(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile07Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile07Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile07(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile08Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile08Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile08(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile09Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile09Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile09(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile10Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile10Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile10(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/Profile11Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class Profile11Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new Profile11(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/PersoCreationFailedException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | /** 4 | * This {@link RuntimeException} is used when the instantiation of a 5 | * personalization failes. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class PersoCreationFailedException extends RuntimeException { 11 | private static final long serialVersionUID = 1L; 12 | 13 | public PersoCreationFailedException(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | public PersoCreationFailedException(String message) { 18 | super(message); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/ProfileUB01Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class ProfileUB01Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new ProfileUB01(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/ProfileUB02Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class ProfileUB02Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new ProfileUB02(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/ProfileUB03Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class ProfileUB03Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new ProfileUB03(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/ProfileUB04Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class ProfileUB04Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new ProfileUB04(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/ProfileUB05Test.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class ProfileUB05Test extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException { 18 | 19 | if (perso == null) { 20 | perso = new ProfileUB05(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1DateWrapper.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This class provides support for encoding the wrapped ASN.1 data structure "Date" 5 | */ 6 | public class Asn1DateWrapper extends Asn1ConstructedApplicationWrapper implements Asn1 { 7 | 8 | private static Asn1DateWrapper instance = null; 9 | 10 | private Asn1DateWrapper() { 11 | super(Asn1Date.getInstance()); 12 | } 13 | 14 | public static Asn1DateWrapper getInstance() { 15 | if(instance == null) { 16 | instance = new Asn1DateWrapper(); 17 | } 18 | 19 | return instance; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/TlvValue.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This class implements the value field of any BER-TLV data object. 5 | * 6 | * @author slutters 7 | * 8 | */ 9 | public abstract class TlvValue extends TlvElement { 10 | 11 | /** 12 | * Returns whether this value field is empty, i.e. its length is 0 bytes. 13 | * @return whether this value field is empty 14 | */ 15 | public boolean isEmpty() { 16 | return this.getLength() == 0; 17 | } 18 | 19 | /** 20 | * Returns a clone of the TlvValue 21 | */ 22 | public abstract TlvValue copy(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/src/de/persosim/simulator/adapter/socket/protocol/SocketProtocol.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.adapter.socket.protocol; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.OutputStream; 6 | 7 | public interface SocketProtocol { 8 | 9 | /** 10 | * Handle an established connection. 11 | * 12 | * @param inputStream 13 | * @param outputStream 14 | * @return true, iff the connection should continue 15 | * @throws IOException 16 | */ 17 | boolean handleConnectionExchange(InputStream inputStream, OutputStream outputStream) throws IOException; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/perso/DefaultPersoGtTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.junit.Before; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | 7 | public class DefaultPersoGtTest extends ArtifactPersonalizationTest { 8 | 9 | Personalization perso; 10 | 11 | @Before 12 | public void setUp() throws Exception { 13 | perso = null; 14 | } 15 | 16 | @Override 17 | public Personalization getPerso() throws AccessDeniedException{ 18 | 19 | if (perso == null) { 20 | perso = new DefaultPersoGt(); 21 | } 22 | 23 | return perso; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/src/de/persosim/simulator/ui/handlers/SelectPersoFromTemplateHandler.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.ui.handlers; 2 | 3 | import jakarta.inject.Named; 4 | 5 | import org.eclipse.e4.core.di.annotations.Execute; 6 | 7 | /** 8 | * This class implements the handler for the select personalization from template menu entries. 9 | * 10 | * @author slutters 11 | * 12 | */ 13 | public class SelectPersoFromTemplateHandler extends SelectPersoHandler { 14 | @Execute 15 | public void execute(@Named("de.persosim.simulator.ui.commandparameter.persoSet") String param) { 16 | loadPersonalization(param, true); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/ProcessingException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | */ 7 | public class ProcessingException extends GeneralException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ProcessingException(short statusWord, String message) { 12 | super(statusWord, message); 13 | } 14 | 15 | public static void throwIt(short reason) { 16 | throw new ProcessingException(reason, ""); 17 | } 18 | 19 | public static void throwIt(short reason, String info) { 20 | throw new ProcessingException(reason, info); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=17 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=17 12 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=17 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=17 12 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1Date.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | import java.nio.charset.Charset; 4 | 5 | /** 6 | * This class provides support for encoding the ASN.1 data structure "Date" 7 | */ 8 | public class Asn1Date extends Asn1Primitive implements Asn1 { 9 | 10 | private static Asn1Date instance = null; 11 | 12 | private Asn1Date() { 13 | super(new TlvTag(UNIVERSAL_NUMERIC_STRING), REGEX_PATTERN_DATE, Charset.forName("US-ASCII")); 14 | } 15 | 16 | public static Asn1Date getInstance() { 17 | if(instance == null) { 18 | instance = new Asn1Date(); 19 | } 20 | 21 | return instance; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CertificateNotParseableException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This exception is thrown when unrecoverable errors occur while parsing a 5 | * {@link CardVerifiableCertificate} encoding. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class CertificateNotParseableException extends Exception { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | public CertificateNotParseableException(String message) { 15 | super(message); 16 | } 17 | 18 | public CertificateNotParseableException(String message, Exception e) { 19 | super(message, e); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/AbstractSecMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | /** 4 | * This is the parent class for all {@link SecMechanism} implementations and 5 | * provides the default behavior for deletion in case of any event. 6 | * 7 | * @author mboonk 8 | * 9 | */ 10 | public class AbstractSecMechanism implements SecMechanism { 11 | 12 | @Override 13 | public boolean needsDeletionInCaseOf(SecurityEvent event) { 14 | return !SecurityEvent.EXTENDED_ACCESS_SESSION_ENDED.equals(event); 15 | } 16 | 17 | @Override 18 | public Class getKey() { 19 | return this.getClass(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1IcaoStringWrapper.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This class provides support for encoding the wrapped ASN.1 data structure "ICAOString" 5 | */ 6 | public class Asn1IcaoStringWrapper extends Asn1ConstructedApplicationWrapper implements Asn1 { 7 | 8 | private static Asn1IcaoStringWrapper instance = null; 9 | 10 | private Asn1IcaoStringWrapper() { 11 | super(Asn1IcaoString.getInstance()); 12 | } 13 | 14 | public static Asn1IcaoStringWrapper getInstance() { 15 | if(instance == null) { 16 | instance = new Asn1IcaoStringWrapper(); 17 | } 18 | 19 | return instance; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1Utf8StringWrapper.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This class provides support for encoding the wrapped ASN.1 data structure "UTF8String" 5 | */ 6 | public class Asn1Utf8StringWrapper extends Asn1ConstructedApplicationWrapper implements Asn1 { 7 | 8 | private static Asn1Utf8StringWrapper instance = null; 9 | 10 | private Asn1Utf8StringWrapper() { 11 | super(Asn1Utf8String.getInstance()); 12 | } 13 | 14 | public static Asn1Utf8StringWrapper getInstance() { 15 | if(instance == null) { 16 | instance = new Asn1Utf8StringWrapper(); 17 | } 18 | 19 | return instance; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/cardobjects/PasswordAuthObjectTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import static org.junit.Assert.assertArrayEquals; 4 | 5 | import org.junit.Test; 6 | 7 | import de.persosim.simulator.test.PersoSimTestCase; 8 | 9 | /** 10 | * @author mboonk 11 | * 12 | */ 13 | public class PasswordAuthObjectTest extends PersoSimTestCase { 14 | @Test 15 | public void testGetPassword(){ 16 | byte [] content = new byte [] {1,2,3}; 17 | PasswordAuthObject password = new PasswordAuthObject(new AuthObjectIdentifier(2), content); 18 | 19 | //call mut 20 | assertArrayEquals(content, password.getPassword()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/MasterFile.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | 4 | 5 | /** 6 | * This represents the automatically created master file 7 | * @author mboonk 8 | * 9 | */ 10 | public class MasterFile extends DedicatedFile { 11 | 12 | public MasterFile() { 13 | this(null, null); 14 | } 15 | 16 | public MasterFile(FileIdentifier fileIdentifier, DedicatedFileIdentifier dedicatedFileName) { 17 | super(fileIdentifier, dedicatedFileName); 18 | } 19 | 20 | public void setIdentity(FileIdentifier identifier, DedicatedFileIdentifier name) { 21 | fileIdentifier = identifier; 22 | dedicatedFileName = name; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/documents/MrzTD1.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.documents; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | * Note: this class is under construction and will only provide basic functionality 7 | */ 8 | public class MrzTD1 extends Mrz { 9 | /* 3 lines of 30 characters each --> total length: 90 */ 10 | public static final String[] defaultMRZ = new String[]{ 11 | "P total length: 88 */ 10 | public static final String[] defaultMRZ = new String[]{ 11 | "P. 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (C) secunet Security Networks AG 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (C) secunet Security Networks AG 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/CardFile.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import de.persosim.simulator.tlv.ConstructedTlvDataObject; 4 | 5 | /** 6 | * This interface represents an ISO7816-4 compliant file in the object hierarchy 7 | * on the card. 8 | * 9 | * @author amay 10 | * 11 | */ 12 | public interface CardFile extends CardObject { 13 | 14 | /** 15 | * @return the file control parameter data object as specified in ISO78164 5.3.3 16 | */ 17 | ConstructedTlvDataObject getFileControlParameterDataObject(); 18 | 19 | /** 20 | * @return the file management data object as specified in ISO78164 5.3.3 21 | */ 22 | ConstructedTlvDataObject getFileManagementDataObject(); 23 | } 24 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (C) secunet Security Networks AG 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (C) secunet Security Networks AG 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/documents/MrzFactory.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.documents; 2 | 3 | /** 4 | * 5 | */ 6 | public class MrzFactory { 7 | 8 | private MrzFactory() {}; 9 | 10 | public static Mrz parseMrz(String mrzString) { 11 | 12 | if (mrzString == null) 13 | throw new IllegalArgumentException("No MRZ given"); 14 | 15 | mrzString = mrzString.replaceAll("\\s", ""); 16 | 17 | int length = mrzString.length(); 18 | 19 | switch (length) { 20 | case 90: return new MrzTD1(mrzString); 21 | case 72: return new MrzTD2(mrzString); 22 | case 88: return new MrzTD3(mrzString); 23 | default: throw new IllegalArgumentException("Unsupported length of MRZ"); 24 | } 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/documents/MrzTD2.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.documents; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | * Note: this class is under construction and will only provide basic functionality 7 | */ 8 | public class MrzTD2 extends Mrz { 9 | /* 2 lines of 36 characters each --> total length: 72 */ 10 | public static final String[] defaultMRZ = new String[]{ 11 | "ITD<. 15 | 16 | 17 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=17 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=17 13 | -------------------------------------------------------------------------------- /de.persosim.simulator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/KeyIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | 4 | /** 5 | * This class implements an identifier for key objects using their key reference. 6 | * 7 | * @author slutters 8 | * 9 | */ 10 | public class KeyIdentifier extends IntegerIdentifier { 11 | 12 | 13 | public KeyIdentifier(byte[] idBytes) { 14 | super(idBytes); 15 | } 16 | 17 | public KeyIdentifier(int keyReference) { 18 | super(keyReference); 19 | } 20 | 21 | public KeyIdentifier() { 22 | super(); 23 | } 24 | 25 | public int getKeyReference() { 26 | return getInteger(); 27 | } 28 | 29 | @Override 30 | public String getNameOfIdentifiedObject() { 31 | return "key reference"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/securemessaging/SmDataProviderGenerator.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.securemessaging; 2 | 3 | import de.persosim.simulator.secstatus.SecMechanism; 4 | 5 | /** 6 | * This interface describes the behavior of a SM data provider generator able 7 | * to generate a fully functional {@link SmDataProvider}. Classes implementing 8 | * this interface are expected to be immutable. 9 | * 10 | * @author slutters 11 | * 12 | */ 13 | public interface SmDataProviderGenerator extends SecMechanism { 14 | 15 | /** 16 | * This method generates a fully functional {@link SmDataProvider}. 17 | * @return a fully functional {@link SmDataProvider} 18 | */ 19 | public SmDataProvider generateSmDataProvider(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1PrintableString.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | import java.nio.charset.Charset; 4 | 5 | /** 6 | * This class provides support for encoding the ASN.1 data structure "PrintableString" 7 | */ 8 | public class Asn1PrintableString extends Asn1Primitive implements Asn1 { 9 | 10 | private static Asn1PrintableString instance = null; 11 | 12 | private Asn1PrintableString() { 13 | super(new TlvTag(UNIVERSAL_PRINTABLE_STRING), REGEX_PATTERN_PRINTABLESTRING, Charset.forName("US-ASCII")); 14 | } 15 | 16 | public static Asn1PrintableString getInstance() { 17 | if(instance == null) { 18 | instance = new Asn1PrintableString(); 19 | } 20 | 21 | return instance; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.ui 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.soap 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.basics 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1DocumentType.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | import java.nio.charset.Charset; 4 | 5 | /** 6 | * This class provides support for encoding the ASN.1 data structure "DocumentType" 7 | */ 8 | public class Asn1DocumentType extends Asn1ConstructedApplicationWrapper implements Asn1 { 9 | 10 | private static Asn1DocumentType instance = null; 11 | 12 | private Asn1DocumentType() { 13 | super(new Asn1Primitive(new TlvTag(UNIVERSAL_PRINTABLE_STRING), REGEX_PATTERN_DOCUMENTTYPE, Charset.forName("US-ASCII")){}); 14 | } 15 | 16 | public static Asn1DocumentType getInstance() { 17 | if(instance == null) { 18 | instance = new Asn1DocumentType(); 19 | } 20 | 21 | return instance; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent.test 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent.test/ 9 | 10 | de.persosim 11 | de.persosim.simulator.test 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator/personalization/profiles_overlays.preferences: -------------------------------------------------------------------------------- 1 | # 2 | # Root path of profiles overlays files 3 | # Default: /../profiles_overlays 4 | # Possible values: Absolute file path. Additionally, $HOME for user's home directory is supported, too. 5 | # 6 | # profiles_overlays_root_path=$HOME/persosim/profiles_overlays 7 | 8 | # 9 | # Create all missing profiles overlays files (if not exist) 10 | # Default: true 11 | # 12 | # create_missing_profiles_overlays=false 13 | 14 | # 15 | # Overlay all profile values with that of related profile overlay file 16 | # Default: true 17 | # 18 | # overlay_all=false 19 | 20 | # 21 | # Format *.json profile (overlay/export) files in human-readable format 22 | # Default: false 23 | # 24 | pretty_print=true 25 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/NeverSecCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | import java.util.Collections; 5 | 6 | import de.persosim.simulator.secstatus.SecMechanism; 7 | 8 | /** 9 | * This class implements a {@link SecCondition} always returning false. 10 | * 11 | * @author mboonk 12 | * 13 | */ 14 | public final class NeverSecCondition implements SecCondition { 15 | 16 | public NeverSecCondition() { 17 | } 18 | 19 | @Override 20 | public boolean check(Collection mechanisms) { 21 | return false; 22 | } 23 | 24 | @Override 25 | public Collection> getNeededMechanisms() { 26 | return Collections.emptySet(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.controller 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.adapter.socket 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent/ 9 | 10 | de.persosim 11 | de.persosim.simulator.adapter.socket.ui 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent.test 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent.test/ 9 | 10 | de.persosim 11 | de.persosim.simulator.adapter.socket.test 12 | 1.4.0-SNAPSHOT 13 | eclipse-plugin 14 | 15 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/Personalization.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import java.util.List; 4 | 5 | import de.persosim.simulator.platform.CommandProcessor; 6 | import de.persosim.simulator.platform.Layer; 7 | 8 | /** 9 | * This interface describes all essential aspects of a simulated SmartCard 10 | * within the PersoSim architecture. 11 | * 12 | * An instance of this interface is provided to the generic {@link CommandProcessor} 13 | * during initialization and creates a consistent behavior. 14 | * 15 | * @author amay 16 | * 17 | */ 18 | public interface Personalization { 19 | 20 | /** 21 | * Returns the list of layers to be used. 22 | * 23 | * @return 24 | */ 25 | List getLayerList(); 26 | 27 | public void initialize(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/utils/XstreamSerialized.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.utils; 2 | 3 | import com.thoughtworks.xstream.XStream; 4 | 5 | /** 6 | * This {@link Serialized} implementation stores serialized data as a 7 | * {@link XStream} string. 8 | * 9 | * @author mboonk 10 | * 11 | * @param 12 | */ 13 | public class XstreamSerialized implements Serialized { 14 | 15 | private String serialization; 16 | 17 | /** 18 | * @return the serialized object as {@link XStream} string 19 | */ 20 | public String getSerialization() { 21 | return serialization; 22 | } 23 | 24 | /** 25 | * @param serialization the string created by {@link XStream} 26 | */ 27 | public XstreamSerialized(String serialization) { 28 | this.serialization = serialization; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.adapter.socket 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.integrationtest 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.globaltester 6 | org.globaltester.parent.crossover 7 | 4.1.4-SNAPSHOT 8 | ../../org.globaltester.parent/org.globaltester.parent.crossover 9 | 10 | de.persosim 11 | de.persosim.simulator.integrationtest 12 | 1.4.0-SNAPSHOT 13 | eclipse-test-plugin 14 | 15 | 16 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/export/OverlayProfile.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso.export; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 7 | 8 | @JsonPropertyOrder({ // 9 | "keys" }) 10 | public class OverlayProfile extends ProfileBase 11 | { 12 | private List keys = new ArrayList<>(); 13 | 14 | 15 | public OverlayProfile() 16 | { 17 | // do nothing; default constructor necessary for JSON (de-)serialization 18 | } 19 | 20 | public OverlayProfile(List keys) 21 | { 22 | if (keys != null) 23 | this.keys = keys; 24 | } 25 | 26 | public List getKeys() 27 | { 28 | return keys; 29 | } 30 | 31 | public void setKeys(List keys) 32 | { 33 | this.keys = keys; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecStatusEventUpdatePropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | 5 | /** 6 | * This {@link UpdatePropagation} is used to propagate {@link SecurityEvent}s 7 | * into the {@link SecStatus}. 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public class SecStatusEventUpdatePropagation extends SecStatusUpdatePropagation { 13 | 14 | SecurityEvent event; 15 | 16 | public SecStatusEventUpdatePropagation(SecurityEvent event) { 17 | this.event = event; 18 | } 19 | 20 | @Override 21 | public Class getKey() { 22 | return SecStatusEventUpdatePropagation.class; 23 | } 24 | 25 | public SecurityEvent getEvent() { 26 | return event; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.adapter.socket.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Controller 4 | Bundle-SymbolicName: de.persosim.simulator.controller;singleton:=true 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-Vendor: secunet Security Networks AG 7 | Bundle-RequiredExecutionEnvironment: JavaSE-17 8 | Bundle-ClassPath: . 9 | Eclipse-BundleShape: dir 10 | Bundle-ActivationPolicy: lazy 11 | Bundle-Activator: 12 | de.persosim.simulator.controller.Activator 13 | Require-Bundle: 14 | de.persosim.simulator.basics, 15 | de.persosim.simulator.soap, 16 | org.eclipse.core.runtime, 17 | org.eclipse.equinox.app, 18 | org.eclipse.osgi, 19 | org.globaltester.logging 20 | Automatic-Module-Name: de.persosim.simulator.controller 21 | Export-Package: de.persosim.simulator.controller 22 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.adapter.socket.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/statemachine/AbstractStateMachine.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.statemachine; 2 | 3 | 4 | /** 5 | * Generic super class for Sinelabore generated statemachine code. This 6 | * implements methods required by {@link StateMachine} interface and not created 7 | * by code generation. 8 | * 9 | * @author amay 10 | * 11 | */ 12 | public abstract class AbstractStateMachine implements StateMachine { 13 | private boolean initialized = false; 14 | 15 | @Override 16 | public void init() { 17 | reset(); 18 | initialized = true; 19 | } 20 | 21 | @Override 22 | public boolean isInitialized() { 23 | return initialized; 24 | } 25 | 26 | @Override 27 | public void reset() { 28 | reInitialize(); 29 | processEvent((byte) 0xFF); // handle the first transition 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/DomainParameterSetIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | /** 4 | * This class implements an identifier for domain parameters using their domain parameter id. 5 | * 6 | * @author slutters 7 | * 8 | */ 9 | public class DomainParameterSetIdentifier extends IntegerIdentifier { 10 | 11 | public DomainParameterSetIdentifier(int domainParameterId) { 12 | super(domainParameterId); 13 | } 14 | 15 | public DomainParameterSetIdentifier() { 16 | super(); 17 | } 18 | 19 | public DomainParameterSetIdentifier(byte[] idBytes) { 20 | super(idBytes); 21 | }public int getDomainParameterId() { 22 | return getInteger(); 23 | } 24 | 25 | @Override 26 | public String getNameOfIdentifiedObject() { 27 | return "domain parameter id"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/OrSecCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.secstatus.SecMechanism; 6 | 7 | /** 8 | * This class implements a {@link SecCondition} representing the boolean OR 9 | * operation on {@link SecCondition} 10 | * 11 | * @author slutters 12 | * 13 | */ 14 | public final class OrSecCondition extends OperatorSecCondition { 15 | 16 | public OrSecCondition(SecCondition... secConditions) { 17 | super(secConditions); 18 | } 19 | 20 | @Override 21 | public boolean check(Collection mechanisms) { 22 | for(SecCondition secCondition:secConditions) { 23 | if(secCondition.check(mechanisms)) { 24 | return true; 25 | } 26 | } 27 | return false; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/CAPAUsedPasswordMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.cardobjects.PasswordAuthObject; 4 | 5 | /** 6 | * This {@link SecMechanism} is used to communicate password used for CAPA. 7 | */ 8 | public class CAPAUsedPasswordMechanism extends AbstractSecMechanism { 9 | 10 | private PasswordAuthObject usedPassword; 11 | 12 | public CAPAUsedPasswordMechanism(PasswordAuthObject usedPassword) { 13 | this.usedPassword = usedPassword; 14 | } 15 | 16 | /** 17 | * @return the password, that was used to execute CAPA 18 | */ 19 | public PasswordAuthObject getUsedPassword() { 20 | return usedPassword; 21 | } 22 | 23 | @Override 24 | public boolean needsDeletionInCaseOf(SecurityEvent event) { 25 | return true; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/AndSecCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.secstatus.SecMechanism; 6 | 7 | /** 8 | * This class implements a {@link SecCondition} representing the boolean AND 9 | * operation on {@link SecCondition} 10 | * 11 | * @author slutters 12 | * 13 | */ 14 | public final class AndSecCondition extends OperatorSecCondition { 15 | 16 | public AndSecCondition(SecCondition... secConditions) { 17 | super(secConditions); 18 | } 19 | 20 | @Override 21 | public boolean check(Collection mechanisms) { 22 | for(SecCondition secCondition:secConditions) { 23 | if(!secCondition.check(mechanisms)) { 24 | return false; 25 | } 26 | } 27 | return true; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Basics 4 | Bundle-SymbolicName: de.persosim.simulator.basics;singleton:=true 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-Vendor: secunet Security Networks AG 7 | Bundle-RequiredExecutionEnvironment: JavaSE-17 8 | Export-Package: 9 | de.persosim.simulator.exception, 10 | de.persosim.simulator.log, 11 | de.persosim.simulator.preferences, 12 | de.persosim.simulator.utils 13 | Bundle-ClassPath: . 14 | Import-Package: 15 | org.osgi.framework, 16 | org.osgi.service.log 17 | Bundle-ActivationPolicy: lazy 18 | Require-Bundle: 19 | org.eclipse.osgi, 20 | org.globaltester.base, 21 | org.globaltester.lib.xstream, 22 | org.globaltester.logging, 23 | jakarta.annotation-api 24 | Automatic-Module-Name: de.persosim.simulator.basics 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 9 | 10 | 11 | 14 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/ShouldSerializeMemberImpl.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso; 2 | 3 | import org.globaltester.lib.xstream.ShouldSerializeMemberInstruction; 4 | 5 | public class ShouldSerializeMemberImpl implements ShouldSerializeMemberInstruction { 6 | 7 | @Override 8 | @SuppressWarnings("rawtypes") 9 | public byte shouldSerializeMember(Class definedIn, String fieldName) { 10 | 11 | //suppress all fields defined in AbstractProfile 12 | if (definedIn.getName().equals("de.persosim.simulator.perso.AbstractProfile")) { 13 | return DO_NOT_SERIALIZE; 14 | } 15 | 16 | //suppress CryptoProviderCache 17 | if (definedIn.getName().equals("de.persosim.simulator.protocols.ca.CaOid") && fieldName.equals("cryptoSupportCache")) { 18 | return DO_NOT_SERIALIZE; 19 | } 20 | 21 | return NO_DECISION; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/PaceUsedPasswordMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.cardobjects.PasswordAuthObject; 4 | 5 | /** 6 | * This {@link SecMechanism} is used to communicate password used for PACE. 7 | * 8 | * @author cstroh 9 | * 10 | */ 11 | public class PaceUsedPasswordMechanism extends AbstractSecMechanism { 12 | 13 | private PasswordAuthObject usedPassword; 14 | 15 | public PaceUsedPasswordMechanism(PasswordAuthObject usedPassword){ 16 | this.usedPassword = usedPassword; 17 | } 18 | 19 | /** 20 | * @return the password, that was used to execute PACE 21 | */ 22 | public PasswordAuthObject getUsedPassword() { 23 | return usedPassword; 24 | } 25 | 26 | @Override 27 | public boolean needsDeletionInCaseOf(SecurityEvent event) { 28 | return true; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Socket Adapter 4 | Bundle-SymbolicName: de.persosim.simulator.adapter.socket 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-Activator: de.persosim.simulator.adapter.socket.Activator 7 | Bundle-Vendor: secunet Security Networks AG 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Require-Bundle: 10 | org.eclipse.core.runtime, 11 | de.persosim.simulator, 12 | de.persosim.simulator.basics, 13 | org.globaltester.simulator, 14 | org.globaltester.logging, 15 | de.persosim.driver.connector 16 | Bundle-ActivationPolicy: lazy 17 | Export-Package: 18 | de.persosim.simulator.adapter.socket, 19 | de.persosim.simulator.adapter.socket.protocol 20 | Import-Package: org.osgi.util.tracker 21 | Automatic-Module-Name: de.persosim.simulator.adapter.socket 22 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ta/RelativeAuthorization.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ta; 2 | 3 | import de.persosim.simulator.utils.BitField; 4 | 5 | /** 6 | * This contains the relative authorization used for terminal authentication as 7 | * described in TR-03110 v2.10 Part 3 Appendix C.4 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public class RelativeAuthorization extends Authorization { 13 | 14 | public RelativeAuthorization() { 15 | } 16 | 17 | public RelativeAuthorization(BitField authorization) { 18 | super(authorization); 19 | } 20 | 21 | public RelativeAuthorization(CertificateRole role, BitField authorization) { 22 | this(authorization.concatenate(role.getField())); 23 | } 24 | 25 | public CertificateRole getRole() { 26 | return CertificateRole.getFromMostSignificantBits(authorization); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/ISO7816Exception.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | */ 7 | 8 | public class ISO7816Exception extends GeneralException { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | protected String info; 13 | 14 | public ISO7816Exception(short statusWord, String message) { 15 | super(statusWord, message); 16 | } 17 | 18 | public static void throwIt(short reason) { 19 | throw new ISO7816Exception(reason, ""); 20 | } 21 | 22 | public static void throwIt(short reason, String info) { 23 | throw new ISO7816Exception(reason, info); 24 | } 25 | 26 | /** 27 | * @return the info 28 | */ 29 | public String getInfo() { 30 | return this.info; 31 | } 32 | 33 | @Override 34 | public String getTypeOfError() { 35 | return "ISO7816"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/auxVerification/AuxOid.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.auxVerification; 2 | 3 | import de.persosim.simulator.protocols.GenericOid; 4 | import de.persosim.simulator.protocols.Oid; 5 | import de.persosim.simulator.protocols.Tr03110; 6 | 7 | /** 8 | * This contains OIDs used in the context of auxiliary data verification. 9 | * @author mboonk 10 | * 11 | */ 12 | public class AuxOid { 13 | 14 | public static final Oid id_AuxiliaryData = new GenericOid(Tr03110.id_BSI, new byte[]{0x03, 0x01, 0x04}); 15 | 16 | public static final Oid id_DateOfBirth = new GenericOid(id_AuxiliaryData, (byte) 0x01); 17 | public static final Oid id_DateOfExpiry = new GenericOid(id_AuxiliaryData, (byte) 0x02); 18 | public static final Oid id_CommunityID = new GenericOid(id_AuxiliaryData, (byte) 0x03); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/wsdl/PersoSimRemoteControlResult.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/apdu/InterindustryCommandApdu.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.apdu; 2 | 3 | /** 4 | * This interface extends {@link CommandApdu} by adding further functionality 5 | * relevant in the context of interindustry command APDUs represented by this 6 | * interface. 7 | * 8 | * @author slutters 9 | * 10 | */ 11 | public interface InterindustryCommandApdu extends CommandApdu, IsoSecureMessagingCommandApdu { 12 | 13 | /** 14 | * This method returns true iff chaining is set for this command APDU, otherwise false is returned 15 | * @return true iff chaining is set for this command APDU, otherwise false is returned 16 | */ 17 | boolean isChaining(); 18 | 19 | /** 20 | * This method returns the channel which is set for this command APDU 21 | * @return the channel which is set for this command APDU 22 | */ 23 | byte getChannel(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/NotSecCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.secstatus.SecMechanism; 6 | 7 | /** 8 | * This class implements a {@link SecCondition} representing the boolean NOT 9 | * operation on {@link SecCondition} 10 | * 11 | * @author amay 12 | * 13 | */ 14 | public final class NotSecCondition extends OperatorSecCondition { 15 | 16 | public NotSecCondition(SecCondition secCondition) { 17 | super(secCondition); 18 | } 19 | 20 | @Override 21 | public boolean check(Collection mechanisms) { 22 | if (secConditions.length != 1) return false; 23 | return !secConditions[0].check(mechanisms); 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return getClass().getSimpleName() + "[" + secConditions[0] + "]"; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/src/de/persosim/simulator/ui/handlers/SelectPersoFromFileHandler.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.ui.handlers; 2 | 3 | import java.io.File; 4 | 5 | import org.eclipse.e4.core.di.annotations.Execute; 6 | import org.eclipse.swt.widgets.FileDialog; 7 | import org.eclipse.swt.widgets.Shell; 8 | 9 | /** 10 | * This class implements the handler for the select personalization from file menu entry. 11 | * 12 | * @author slutters 13 | * 14 | */ 15 | public class SelectPersoFromFileHandler extends SelectPersoHandler 16 | { 17 | @Execute 18 | public void execute(Shell shell) 19 | { 20 | FileDialog dialog = new FileDialog(shell); 21 | dialog.open(); 22 | 23 | String fileName = dialog.getFileName(); 24 | 25 | if (fileName.length() > 0) { 26 | String pathName = dialog.getFilterPath() + File.separator + fileName; 27 | loadPersonalization(pathName, false); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/CardObjectWrapper.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import de.persosim.simulator.perso.Personalization; 4 | 5 | /** 6 | * This interface allows wrapping existing CardObjects. See inheritance 7 | * hierarchy for available object types. 8 | * 9 | * This can be usefull to add additional behavior to exisitng objects in 10 | * existing {@link Personalization}s without the need to define new Objects and 11 | * copy content/state. 12 | * 13 | * @author amay 14 | * 15 | */ 16 | public interface CardObjectWrapper extends CardObject { 17 | 18 | /** 19 | * Set the object to be wrapped. 20 | * 21 | * Removing that object from its tree and adding the wrapper appropriately 22 | * shall be handled externaly. 23 | * 24 | * @param cardObjectToWrap 25 | */ 26 | void setWrappedObject(CardObject cardObjectToWrap); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SessionContextIdMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | /** 4 | * This Mechanism contains the Identifier that should be used to store the 5 | * session context. The ID for the Default Context (ID=0) is set at the end of 6 | * the PACE protocol. Other IDs are provided during MSE: set AT commands in tag 7 | * E0. The storing of the default context happens before the CA initializes new 8 | * Secure Messaging. Storing of other contexts happens before restoring old ones. 9 | * 10 | * @author jkoch 11 | * 12 | */ 13 | public class SessionContextIdMechanism extends AbstractSecMechanism{ 14 | 15 | private int sessionContextId; 16 | 17 | public SessionContextIdMechanism(int sessionContextId) { 18 | this.sessionContextId = sessionContextId; 19 | } 20 | 21 | public int getSessionContextId() { 22 | return sessionContextId; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/src/de/persosim/simulator/ui/handlers/RemoveCardHandler.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.ui.handlers; 2 | 3 | import static org.globaltester.logging.BasicLogger.log; 4 | 5 | import org.eclipse.e4.core.di.annotations.Execute; 6 | import org.eclipse.swt.widgets.Shell; 7 | import org.globaltester.logging.BasicLogger; 8 | import org.globaltester.logging.tags.LogLevel; 9 | import org.globaltester.logging.tags.LogTag; 10 | 11 | import de.persosim.driver.connector.SimulatorManager; 12 | import de.persosim.simulator.log.PersoSimLogTags; 13 | 14 | public class RemoveCardHandler 15 | { 16 | /** 17 | * This method stops the simulator. 18 | */ 19 | @Execute 20 | public void execute(Shell shell) 21 | { 22 | SimulatorManager.getSim().stopSimulator(); 23 | 24 | log("Finished stopping of simulator", LogLevel.INFO, new LogTag(BasicLogger.LOG_TAG_TAG_ID, PersoSimLogTags.SYSTEM_TAG_ID)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /de.persosim.simulator/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/crypto/KeyDerivationFunctionTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto; 2 | 3 | import static org.junit.Assert.assertArrayEquals; 4 | 5 | import org.junit.Test; 6 | 7 | import de.persosim.simulator.utils.HexString; 8 | 9 | public class KeyDerivationFunctionTest { 10 | @Test 11 | public void testDeriveEnc() { 12 | KeyDerivationFunction kdf = new KeyDerivationFunction(16); 13 | byte [] result = kdf.deriveENC(HexString.toByteArray("239AB9CB282DAF66231DC5A4DF6BFBAE")); 14 | assertArrayEquals(HexString.toByteArray("AB94FCEDF2664EDFB9B291F85D7F77F2"), result); 15 | } 16 | @Test 17 | public void testDeriveMac() { 18 | KeyDerivationFunction kdf = new KeyDerivationFunction(16); 19 | byte [] result = kdf.deriveMAC(HexString.toByteArray("239AB9CB282DAF66231DC5A4DF6BFBAE")); 20 | assertArrayEquals(HexString.toByteArray("7862D9ECE03C1BCD4D77089DCF131442"), result); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/DateTimeCardObject.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import java.util.Date; 4 | 5 | 6 | /** 7 | * This {@link CardObject} stores a date and time. 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public class DateTimeCardObject extends AbstractCardObject { 13 | 14 | Date currentDate; 15 | 16 | public DateTimeCardObject(Date date) { 17 | currentDate = new Date(date.getTime()); 18 | } 19 | 20 | /** 21 | * @return the stored date 22 | */ 23 | public Date getDate(){ 24 | return new Date(currentDate.getTime()); 25 | } 26 | 27 | /** 28 | * @param the new date to store 29 | */ 30 | public void update(Date date){ 31 | // IMPL check update access rights here 32 | currentDate = new Date(date.getTime()); 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "DateTimeCardObject (" + currentDate + ")"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/processing/ProcessingStateUpdate.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.processing; 2 | 3 | import org.globaltester.logging.InfoSource; 4 | 5 | /** 6 | * Container class for storing the history of {@link ProcessingData} and its state updates. 7 | * @author amay 8 | * 9 | */ 10 | public class ProcessingStateUpdate { 11 | 12 | private InfoSource source; 13 | private String message; 14 | private ProcessingStateDelta stateDelta; 15 | 16 | public ProcessingStateUpdate(InfoSource initiator, String msg, ProcessingStateDelta stateDelta) { 17 | this.source = initiator; 18 | this.stateDelta = stateDelta; 19 | this.message = msg; 20 | } 21 | 22 | public String getInitiatorId() { 23 | return source.getIDString(); 24 | } 25 | 26 | public ProcessingStateDelta getStateDelta() { 27 | return stateDelta; 28 | } 29 | 30 | public String getMessage(){ 31 | return message; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.controller 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 12 | 13 | 14 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CryptoException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * This exception is meant to channel exceptions resulting from cryptographic operations. 5 | * As this product is shipped with a crypto provider supporting all required operations 6 | * any exception like NoSuchAlgorithmException or InvalidPaddingException strongly indicates 7 | * that the wrong crypto provider is being used. This is considered as a configuration error 8 | * on RuntimeException level. 9 | * 10 | * @author slutters 11 | * 12 | */ 13 | public class CryptoException extends RuntimeException { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | public CryptoException(Throwable cause) { 18 | super("operation NOT supported by crypto provider", cause); 19 | } 20 | 21 | public CryptoException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /de.persosim.simulator/ReadMe.md: -------------------------------------------------------------------------------- 1 | # ReadMe PersoSim 2 | 3 | ## Start a RCP runtime from sources 4 | The RCP product can be started in a development environment using the checked out source. They have to be imported into an eclipse IDE and can then be run by starting a correct launch config. Such a config can be generated by performing the following steps: 5 | 6 | - Open the `de.persosim.rcp.product` file in the project of same name in the Product Configuration Editor 7 | - Click the `Launch an eclipse Application` link in the `Testing`-Section on the `Overview`-Tab 8 | 9 | The generated config has the name `de.persosim.rcp.product`. 10 | 11 | ## Build a PersoSim product release 12 | The release artifacts are created using a Maven 3 build. To create the product for all supported platforms run `mvn clean verify` in the `de.persosim.rcp.releng` folder. The products can then, after a successful build, be found in the `de.persosim.rcp.product/target/products` folder. 13 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/CommandParameterUndefinedException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | /** 4 | * @author slutters 5 | * 6 | */ 7 | public class CommandParameterUndefinedException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public CommandParameterUndefinedException() { 12 | super(); 13 | } 14 | 15 | public CommandParameterUndefinedException(String reason) { 16 | super(reason); 17 | } 18 | 19 | /** 20 | * Throws the JavaCard runtime environment-owned instance of the 21 | * ISOException class with the specified reason. 22 | * 23 | * @param reason 24 | * the reason for throwing an exception 25 | */ 26 | public static void throwIt(String reason) { 27 | throw new CommandParameterUndefinedException(reason); 28 | } 29 | 30 | public static void throwIt() { 31 | throw new CommandParameterUndefinedException(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/AuxDataObject.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.exception.AccessDeniedException; 6 | import de.persosim.simulator.protocols.Oid; 7 | import de.persosim.simulator.protocols.ta.AuthenticatedAuxiliaryData; 8 | 9 | public abstract class AuxDataObject extends AbstractCardObject { 10 | protected OidIdentifier identifier; 11 | 12 | public AuxDataObject(OidIdentifier identifier){ 13 | this.identifier = identifier; 14 | } 15 | 16 | @Override 17 | public Collection getAllIdentifiers() { 18 | Collection result = super.getAllIdentifiers(); 19 | result.add(identifier); 20 | return result; 21 | } 22 | 23 | public Oid getOid(){ 24 | return identifier.getOid(); 25 | } 26 | 27 | public abstract boolean verify(AuthenticatedAuxiliaryData current) throws AccessDeniedException; 28 | } 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator SOAP 4 | Bundle-SymbolicName: de.persosim.simulator.soap;singleton:=true 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-Vendor: secunet Security Networks AG 7 | Bundle-RequiredExecutionEnvironment: JavaSE-17 8 | Export-Package: 9 | de.persosim.simulator.control.soap.service, 10 | de.persosim.simulator.soap 11 | Bundle-ClassPath: . 12 | Import-Package: 13 | javax.jws, 14 | javax.jws.soap, 15 | javax.xml.ws, 16 | org.osgi.framework, 17 | org.osgi.service.log 18 | Bundle-ActivationPolicy: lazy 19 | Bundle-Activator: de.persosim.simulator.soap.Activator 20 | Require-Bundle: 21 | de.persosim.simulator.basics, 22 | org.eclipse.osgi, 23 | org.globaltester.base, 24 | org.globaltester.lib.xstream, 25 | org.globaltester.logging, 26 | jakarta.annotation-api, 27 | org.globaltester.control.soap 28 | Automatic-Module-Name: de.persosim.simulator.soap 29 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/protocols/ta/AuthenticatedAuxiliaryDataTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ta; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.junit.Test; 6 | 7 | import static org.junit.Assert.assertArrayEquals; 8 | 9 | import de.persosim.simulator.protocols.RoleOid; 10 | import de.persosim.simulator.test.PersoSimTestCase; 11 | 12 | public class AuthenticatedAuxiliaryDataTest extends PersoSimTestCase { 13 | @Test 14 | public void testGetDiscretionaryDataImmutability() { 15 | byte[] data = new byte[] { 1, 2, 3, 4, 5 }; 16 | byte[] expected = Arrays.copyOf(data, data.length); 17 | 18 | AuthenticatedAuxiliaryData authData = new AuthenticatedAuxiliaryData(RoleOid.id_AT, data); 19 | 20 | data[0] = 2; 21 | 22 | byte[] result = authData.getDiscretionaryData(); 23 | 24 | assertArrayEquals(expected, result); 25 | 26 | result[0] = 3; 27 | 28 | assertArrayEquals(expected, authData.getDiscretionaryData()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecStatusStoreUpdatePropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | 5 | /** 6 | * This {@link UpdatePropagation} is used to propagate store and restore session context events 7 | * into the {@link SecStatus}. 8 | * 9 | * @author jgoeke 10 | * 11 | */ 12 | public final class SecStatusStoreUpdatePropagation extends SecStatusEventUpdatePropagation { 13 | 14 | private final int sessionContextIdentifier; 15 | 16 | public SecStatusStoreUpdatePropagation(SecurityEvent event, int sessionContextIdentifier) { 17 | super(event); 18 | this.sessionContextIdentifier = sessionContextIdentifier; 19 | } 20 | 21 | @Override 22 | public Class getKey() { 23 | return SecStatusStoreUpdatePropagation.class; 24 | } 25 | 26 | public int getSessionContextIdentifier() { 27 | return sessionContextIdentifier; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/src/de/persosim/simulator/ui/utils/FileComparator.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.ui.utils; 2 | 3 | import java.io.File; 4 | import java.util.Comparator; 5 | 6 | /** 7 | * This Comparator compares objects of type {@link File}. 8 | * If one of the provided parameter objects is a file while the other is a folder, folders will be treated as being "smaller" than files, sorting them in front of files. 9 | * If both provided parameter objects are files or folders the return value is the the of o1.compareTo(o2). 10 | * 11 | * @author slutters 12 | * 13 | */ 14 | public class FileComparator implements Comparator { 15 | 16 | @Override 17 | public int compare(File o1, File o2) { 18 | if(o1.isDirectory()) { 19 | if(o2.isDirectory()) { 20 | return o1.compareTo(o2); 21 | } else { 22 | return -1; 23 | } 24 | } else { 25 | if(o2.isDirectory()) { 26 | return 1; 27 | } else { 28 | return o1.compareTo(o2); 29 | } 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/CardObjectIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | /** 4 | * Identifier for a CardObject. Primary used for identifying objects within 5 | * trees, should correspond to FileIdentifier from ISO7816 or similar 6 | * concepts. 7 | * 8 | * Implementing objects are expected to be immutable (at least wrt to the 9 | * methods defined here). 10 | * 11 | * @author amay 12 | * 13 | */ 14 | public interface CardObjectIdentifier { 15 | 16 | /** 17 | * Checks whether a given {@link CardObject} resp. one of its 18 | * {@link CardObjectIdentifier}s fulfills the requirements expressed by this 19 | * {@link CardObjectIdentifier}. 20 | * 21 | * @see #matches(CardObjectIdentifier) 22 | * 23 | * @param obj 24 | * {@link CardObject} to match against 25 | * @return true iff the given object matches all criteria of this identifier 26 | */ 27 | boolean matches(CardObject currentObject); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/pace/MappingResultGm.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.pace; 2 | 3 | import java.security.KeyPair; 4 | 5 | import de.persosim.simulator.crypto.DomainParameterSet; 6 | 7 | public class MappingResultGm extends MappingResult { 8 | 9 | // the public key pair according to the unmapped domain parameters 10 | protected KeyPair keyPairPiccUnmapped; 11 | 12 | public MappingResultGm(DomainParameterSet domainParametersUnmapped, DomainParameterSet domainParametersMapped, KeyPair keyPairPiccUnmapped, KeyPair keyPairPiccMapped) { 13 | super(domainParametersUnmapped, domainParametersMapped, keyPairPiccMapped); 14 | this.keyPairPiccUnmapped = keyPairPiccUnmapped; 15 | } 16 | 17 | public KeyPair getKeyPairPiccUnmapped() { 18 | return keyPairPiccUnmapped; 19 | } 20 | 21 | @Override 22 | public byte[] getMappingResponse() { 23 | return domainParametersUnmapped.encodePublicKey(keyPairPiccUnmapped.getPublic()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/exception/GeneralException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | import de.persosim.simulator.utils.HexString; 4 | 5 | /** 6 | * @author slutters 7 | * 8 | */ 9 | public abstract class GeneralException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | protected short statusWord; 14 | 15 | public GeneralException(short statusWord, String message) { 16 | super(message); 17 | this.statusWord = statusWord; 18 | } 19 | 20 | public GeneralException(short statusWord) { 21 | this(statusWord, ""); 22 | } 23 | 24 | public short getStatusWord() { 25 | return this.statusWord; 26 | } 27 | 28 | public String getStatusWordAsString() { 29 | return HexString.hexifyShort(this.statusWord); 30 | } 31 | 32 | public boolean bearsMessage() { 33 | return this.getMessage().length() > 0; 34 | } 35 | 36 | public String getTypeOfError() { 37 | return "general"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ca3/ChipAuthentication3Mechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ca3; 2 | 3 | import java.security.KeyPair; 4 | import java.security.PublicKey; 5 | 6 | import de.persosim.simulator.protocols.ca.CaOid; 7 | import de.persosim.simulator.protocols.ca.ChipAuthenticationMechanism; 8 | import de.persosim.simulator.utils.Serialized; 9 | import de.persosim.simulator.utils.Serializer; 10 | 11 | public class ChipAuthentication3Mechanism extends ChipAuthenticationMechanism { 12 | 13 | private Serialized ephemeralKeyPairPicc; 14 | 15 | public ChipAuthentication3Mechanism(CaOid caOid, int keyReference, PublicKey uncompressedPublicKey, KeyPair ephemeralKeyPairPicc) { 16 | super(caOid, keyReference, uncompressedPublicKey); 17 | this.ephemeralKeyPairPicc = Serializer.serialize(ephemeralKeyPairPicc); 18 | } 19 | 20 | public KeyPair getEphemeralKeyPairPicc() { 21 | return Serializer.deserialize(ephemeralKeyPairPicc); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/crypto/certificates/CvOid.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto.certificates; 2 | 3 | import java.security.Signature; 4 | 5 | import de.persosim.simulator.protocols.Oid; 6 | 7 | /** 8 | * This interface can be implemented by OID classes to indicate their capability 9 | * of being used for public private key signing and verifying operations in the 10 | * context of CV certificates. 11 | * 12 | * @author slutters 13 | * 14 | */ 15 | public interface CvOid extends Oid { 16 | 17 | /** 18 | * This method returns the signature algorithm suitable e.g. for 19 | * instantiating a {@link Signature} object for generating or verifying 20 | * signatures. 21 | * 22 | * @return a signature algorithm 23 | */ 24 | public String getSignatureString(); 25 | 26 | /** 27 | * This methods allows to retrieve the key type encoded by this {@link Oid}. 28 | * 29 | * @return the identifier for the key type 30 | */ 31 | public String getKeyType(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/AbstractCardObjectIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | /** 4 | * Abstract super class for all object identifiers, contains the generic 5 | * matching logic on card objects which evaluates to true if the object has a 6 | * {@link CardObjectIdentifier} associated on which this{@link #equals(Object)} 7 | * evaluates to true. 8 | *

9 | * Note: This implies that all subclasses need to define correct implementations 10 | * for the {@link #hashCode()} and {@link #equals(Object)} methods. 11 | * 12 | * @author mboonk 13 | * 14 | */ 15 | public abstract class AbstractCardObjectIdentifier implements 16 | CardObjectIdentifier { 17 | 18 | @Override 19 | public boolean matches(CardObject currentObject) { 20 | for (CardObjectIdentifier currentIdentifier : currentObject 21 | .getAllIdentifiers()) { 22 | if (this.equals(currentIdentifier)) { 23 | return true; 24 | } 25 | } 26 | return false; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/file/CurrentFileSecMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.file; 2 | 3 | import de.persosim.simulator.cardobjects.CardFile; 4 | import de.persosim.simulator.secstatus.AbstractSecMechanism; 5 | import de.persosim.simulator.secstatus.SecurityEvent; 6 | 7 | /** 8 | * SecMechanism that stores the currently selected file. 9 | * 10 | * @author amay 11 | * 12 | */ 13 | public class CurrentFileSecMechanism extends AbstractSecMechanism { 14 | 15 | private CardFile curFile; 16 | 17 | public CurrentFileSecMechanism(CardFile currentFile) { 18 | curFile = currentFile; 19 | } 20 | 21 | @Override 22 | public boolean needsDeletionInCaseOf(SecurityEvent event) { 23 | // no need to be deleted in any case, the only known case when the 24 | // current file selection gets lost is on reset, but in this case the 25 | // SecStatus is cleared anyway 26 | return false; 27 | } 28 | 29 | public CardFile getCurrentFile() { 30 | return curFile; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/Iso7816LifeCycle.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import de.persosim.simulator.exception.AccessDeniedException; 4 | import de.persosim.simulator.exception.LifeCycleChangeException; 5 | 6 | /** 7 | * This interface describes objects, that have an ISO7816-conform life cycle. 8 | * 9 | * @author mboonk 10 | * 11 | */ 12 | public interface Iso7816LifeCycle { 13 | Iso7816LifeCycleState getLifeCycleState(); 14 | 15 | /** 16 | * Update the life cycle state of this object. 17 | * 18 | * @param state 19 | * the new life cycle state 20 | * @throws LifeCycleChangeException 21 | * if the desired state change is not allowed (due to ISO7816 22 | * restrictions on the state machine or access conditions at the 23 | * discretion of the implementing class) 24 | * @throws AccessDeniedException 25 | */ 26 | void updateLifeCycleState(Iso7816LifeCycleState state) 27 | throws AccessDeniedException; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/platform/HardwareCommandApduPropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.platform; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | 5 | /** 6 | * This UpdatePropagation holds the original APDU as received from hardware 7 | * layer and provides it to the upper layers during processing. 8 | * 9 | * This is the initial content of the ProcessingData and shall be transformed to 10 | * a new CommandApdu by the first Layer (IoManager). 11 | * 12 | * @author amay 13 | * 14 | */ 15 | public class HardwareCommandApduPropagation implements UpdatePropagation { 16 | 17 | @Override 18 | public Class getKey() { 19 | return HardwareCommandApduPropagation.class; 20 | } 21 | 22 | byte[] commandApdu = null; 23 | 24 | public HardwareCommandApduPropagation(byte[] commandApdu) { 25 | super(); 26 | this.commandApdu = commandApdu; 27 | } 28 | 29 | public byte[] getCommandApdu() { 30 | return commandApdu; 31 | } 32 | 33 | 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/CAPASecurityCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | import java.util.HashSet; 5 | 6 | import de.persosim.simulator.secstatus.CAPAMechanism; 7 | import de.persosim.simulator.secstatus.SecMechanism; 8 | 9 | /** 10 | * This condition can be used to check for past executions of CAPA. 11 | * 12 | */ 13 | public class CAPASecurityCondition implements SecCondition { 14 | 15 | @Override 16 | public boolean check(Collection mechanisms) { 17 | for (SecMechanism mechanism : mechanisms) { 18 | if (mechanism instanceof CAPAMechanism) { 19 | return true; 20 | } 21 | } 22 | return false; 23 | } 24 | 25 | @Override 26 | public Collection> getNeededMechanisms() { 27 | HashSet> result = new HashSet<>(); 28 | result.add(CAPAMechanism.class); 29 | return result; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return getClass().getSimpleName(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /de.persosim.simulator.integrationtest/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Integration Test 4 | Bundle-SymbolicName: de.persosim.simulator.integrationtest 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-RequiredExecutionEnvironment: JavaSE-17 7 | Require-Bundle: org.junit, 8 | org.globaltester.cryptoprovider.bc, 9 | de.persosim.simulator, 10 | org.globaltester.simulator, 11 | org.globaltester.cryptoprovider, 12 | de.persosim.simulator.adapter.socket, 13 | org.globaltester.logging, 14 | org.eclipse.core.resources, 15 | org.globaltester.base, 16 | com.secunet.globaltester.testcontrol.callback.soap.provider, 17 | org.globaltester.logging.legacy, 18 | de.persosim.simulator.test, 19 | org.globaltester.sampleconfiguration, 20 | org.eclipse.core.runtime 21 | Import-Package: com.secunet.globaltester.epassport.certificates, 22 | org.eclipse.ui.keys, 23 | org.osgi.framework 24 | Bundle-Vendor: secunet Security Networks AG 25 | Bundle-ActivationPolicy: lazy 26 | Automatic-Module-Name: de.persosim.simulator.integrationtest 27 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/CommandParserResult.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator; 2 | 3 | public class CommandParserResult 4 | { 5 | private boolean ok; 6 | private String message; 7 | private String resultAsHex; 8 | private Exception exception; 9 | 10 | public CommandParserResult(boolean ok, String message) 11 | { 12 | this.ok = ok; 13 | this.message = message; 14 | } 15 | 16 | public CommandParserResult(boolean ok, String message, String resultAsHex) 17 | { 18 | this.ok = ok; 19 | this.message = message; 20 | this.resultAsHex = resultAsHex; 21 | } 22 | 23 | public CommandParserResult(boolean ok, String message, Exception exception) 24 | { 25 | this.ok = ok; 26 | this.message = message; 27 | this.exception = exception; 28 | } 29 | 30 | public boolean isOk() 31 | { 32 | return ok; 33 | } 34 | 35 | public String getMessage() 36 | { 37 | return message; 38 | } 39 | 40 | public String getResultAsHex() 41 | { 42 | return resultAsHex; 43 | } 44 | 45 | public Exception getException() 46 | { 47 | return exception; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecStatusMechanismUpdatePropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | import de.persosim.simulator.secstatus.SecStatus.SecContext; 5 | 6 | /** 7 | * Container to store a new mechanism for the SecStatus and propagate it from 8 | * protocol to the SecStatus. 9 | * 10 | * @author amay 11 | * 12 | */ 13 | public class SecStatusMechanismUpdatePropagation extends SecStatusUpdatePropagation { 14 | 15 | private SecContext context; 16 | private SecMechanism mechanism; 17 | 18 | @Override 19 | public Class getKey() { 20 | return SecStatusMechanismUpdatePropagation.class; 21 | } 22 | 23 | public SecStatusMechanismUpdatePropagation(SecContext context, 24 | SecMechanism mechanism) { 25 | super(); 26 | this.context = context; 27 | this.mechanism = mechanism; 28 | } 29 | 30 | public SecContext getContext() { 31 | return context; 32 | } 33 | 34 | public SecMechanism getMechanism() { 35 | return mechanism; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/src/de/persosim/simulator/log/PersoSimTagFilter.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.log; 2 | 3 | import org.globaltester.logging.BasicLogger; 4 | import org.globaltester.logging.Message; 5 | import org.globaltester.logging.filter.LogFilter; 6 | import org.globaltester.logging.filter.TagFilter; 7 | import org.globaltester.logging.tags.LogTag; 8 | 9 | public class PersoSimTagFilter extends TagFilter implements LogFilter 10 | { 11 | public PersoSimTagFilter(String logTagId, String... data) 12 | { 13 | super(logTagId, data); 14 | } 15 | 16 | @Override 17 | public boolean matches(Message msg) 18 | { 19 | if (msg != null) { 20 | for (LogTag curTag : msg.getLogTags()) { 21 | if (curTag.getId().equals(logTagId)) { 22 | return checkTagForData(curTag); 23 | } 24 | } 25 | } 26 | // Handle NO_TAGS_AVAILABLE_INFO 27 | if (BasicLogger.LOG_TAG_TAG_ID.equals(logTagId)) { 28 | for (String current : logTagData) { 29 | if (PersoSimLogFormatter.NO_TAGS_AVAILABLE_INFO.equals(current)) 30 | return true; 31 | } 32 | } 33 | return false; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/PaceSecurityCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | import java.util.HashSet; 5 | 6 | import de.persosim.simulator.secstatus.PaceMechanism; 7 | import de.persosim.simulator.secstatus.SecMechanism; 8 | 9 | 10 | 11 | /** 12 | * This condition can be used to check for past executions of PACE. 13 | * @author mboonk 14 | * 15 | */ 16 | public class PaceSecurityCondition implements SecCondition { 17 | 18 | @Override 19 | public boolean check(Collection mechanisms) { 20 | for (SecMechanism mechanism : mechanisms){ 21 | if (mechanism instanceof PaceMechanism){ 22 | return true; 23 | } 24 | } 25 | return false; 26 | } 27 | 28 | @Override 29 | public Collection> getNeededMechanisms() { 30 | HashSet> result = new HashSet<>(); 31 | result.add(PaceMechanism.class); 32 | return result; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return getClass().getSimpleName(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /de.persosim.simulator.adapter.socket.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Socket Adapter UI 4 | Bundle-SymbolicName: de.persosim.simulator.adapter.socket.ui;singleton:=true 5 | Bundle-Version: 1.4.0.qualifier 6 | Require-Bundle: org.eclipse.osgi, 7 | org.globaltester.logging, 8 | de.persosim.simulator, 9 | de.persosim.simulator.basics, 10 | org.eclipse.swt, 11 | org.eclipse.e4.ui.workbench, 12 | org.eclipse.e4.core.di.annotations, 13 | de.persosim.driver.connector.ui, 14 | org.eclipse.e4.ui.model.workbench, 15 | jakarta.inject.jakarta.inject-api, 16 | de.persosim.driver.connector, 17 | org.globaltester.simulator, 18 | de.persosim.simulator.adapter.socket, 19 | org.eclipse.jface, 20 | de.persosim.lib.qrcodegen 21 | Bundle-Vendor: secunet Security Networks AG 22 | Bundle-RequiredExecutionEnvironment: JavaSE-17 23 | Bundle-ActivationPolicy: lazy 24 | Bundle-Activator: de.persosim.simulator.adapter.socket.ui.Activator 25 | Automatic-Module-Name: de.persosim.remoteifd.ui 26 | Export-Package: de.persosim.simulator.adapter.socket.ui.vsmartcard 27 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/apdu/CommandApduImplTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.apdu; 2 | 3 | import static org.junit.Assert.assertArrayEquals; 4 | 5 | import org.junit.Test; 6 | 7 | import de.persosim.simulator.test.PersoSimTestCase; 8 | import de.persosim.simulator.tlv.TlvValue; 9 | import de.persosim.simulator.tlv.TlvValuePlain; 10 | import de.persosim.simulator.utils.HexString; 11 | 12 | public class CommandApduImplTest extends PersoSimTestCase { 13 | 14 | @Test 15 | public void testImmutability() { 16 | byte[] cApduData = HexString.toByteArray("0022000003010203"); 17 | CommandApduImpl cApdu = new CommandApduImpl(cApduData); 18 | 19 | byte[] cApduDataExpected = cApdu.toByteArray(); 20 | 21 | TlvValue cDataTlvValue = cApdu.getCommandData(); 22 | TlvValuePlain cDataTlvValuePlain = (TlvValuePlain) cDataTlvValue; 23 | 24 | cDataTlvValuePlain.setValueField(new TlvValuePlain(HexString.toByteArray("AABBCCDD"))); 25 | 26 | byte[] cApduDataReceived = cApdu.toByteArray(); 27 | 28 | assertArrayEquals(cApduDataExpected, cApduDataReceived); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /de.persosim.simulator.basics/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.basics 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | org.eclipse.pde.PluginNature 37 | org.eclipse.jdt.core.javanature 38 | 39 | 40 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | de.persosim.simulator.soap 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | org.eclipse.pde.PluginNature 37 | org.eclipse.jdt.core.javanature 38 | 39 | 40 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/crypto/certificates/ExtensionOid.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto.certificates; 2 | 3 | import de.persosim.simulator.protocols.GenericOid; 4 | import de.persosim.simulator.protocols.Oid; 5 | import de.persosim.simulator.protocols.RoleOid; 6 | import de.persosim.simulator.protocols.Tr03110; 7 | 8 | /** 9 | * This OID contains the {@link Oid} instances used for certificate extensions. 10 | * @author mboonk 11 | * 12 | */ 13 | public class ExtensionOid { 14 | public static final Oid id_Extensions = new GenericOid(Tr03110.id_BSI, new byte[]{0x03, 0x01, 0x03}); 15 | 16 | public static final Oid id_Description = new GenericOid(id_Extensions, (byte) 0x01); 17 | public static final Oid id_Sector = new GenericOid(id_Extensions, (byte) 0x02); 18 | 19 | public static final Oid id_eIDAccess = new GenericOid(RoleOid.id_AT, (byte) 0x01); 20 | public static final Oid id_specialFunctions = new GenericOid(RoleOid.id_AT, (byte) 0x02); 21 | 22 | public static final Oid id_Ps_Sector = new GenericOid(id_Extensions, (byte) 0x03); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/platform/CommandProcessor.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.platform; 2 | 3 | 4 | import java.util.List; 5 | 6 | import de.persosim.simulator.cardobjects.MasterFile; 7 | import de.persosim.simulator.exception.AccessDeniedException; 8 | import de.persosim.simulator.perso.Personalization; 9 | import de.persosim.simulator.protocols.Protocol; 10 | import de.persosim.simulator.secstatus.SecStatus; 11 | 12 | /** 13 | * This class realizes a generic means to provide a {@link Personalization} that 14 | * fills a CommandProcessor with content and concrete behavior. 15 | * 16 | * @author amay 17 | * 18 | */ 19 | public class CommandProcessor extends CommandProcessorStateMachine { 20 | 21 | public CommandProcessor(List protocolList, MasterFile mf) throws AccessDeniedException { 22 | //initialize object tree with SecStatus 23 | this.masterFile = mf; 24 | this.securityStatus = new SecStatus(); 25 | masterFile.setSecStatus(securityStatus); 26 | 27 | //register protocols 28 | for (Protocol curProtocol : protocolList) { 29 | addProtocol(curProtocol); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/NullCardObject.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import java.util.Collection; 4 | import java.util.Collections; 5 | 6 | /** 7 | * CardObject that does neither represent an existing CardObject nor does 8 | * anything specifically useful but intelligently returning "nothing". Mainly 9 | * intended to be returned instead of null, when no object is available or 10 | * accessible. 11 | * 12 | * @author amay 13 | * 14 | */ 15 | public class NullCardObject extends AbstractCardObject { 16 | 17 | @Override 18 | public CardObject getParent() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public Collection getChildren() { 24 | return Collections.emptySet(); 25 | } 26 | 27 | @Override 28 | public Iso7816LifeCycleState getLifeCycleState() { 29 | return Iso7816LifeCycleState.UNDEFINED; 30 | } 31 | 32 | @Override 33 | public void updateLifeCycleState(Iso7816LifeCycleState state) { 34 | 35 | } 36 | 37 | @Override 38 | public Collection getAllIdentifiers() { 39 | return Collections.emptySet(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /de.persosim.simulator.controller/src/de/persosim/simulator/controller/Activator.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.controller; 2 | 3 | //import org.globaltester.logging.BasicLogger; 4 | //import org.globaltester.logging.tags.LogLevel; 5 | import org.osgi.framework.BundleActivator; 6 | import org.osgi.framework.BundleContext; 7 | 8 | import de.persosim.simulator.preferences.EclipsePreferenceAccessor; 9 | import de.persosim.simulator.preferences.PersoSimPreferenceManager; 10 | 11 | public class Activator implements BundleActivator 12 | { 13 | 14 | @Override 15 | public void start(BundleContext context) throws Exception 16 | { 17 | // BasicLogger.log("START Activator Simulator Controller", LogLevel.TRACE); 18 | PersoSimPreferenceManager.setPreferenceAccessorIfNotAvailable(new EclipsePreferenceAccessor()); 19 | PersoSimPreferenceManager.storePreference("PREF_NON_INTERACTIVE", Boolean.TRUE.toString(), false); // Set to non-gui-based mode 20 | // BasicLogger.log("END Activator Simulator Controller", LogLevel.TRACE); 21 | } 22 | 23 | @Override 24 | public void stop(BundleContext context) throws Exception 25 | { 26 | // nothing to do 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ca3/Ps.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ca3; 2 | 3 | import de.persosim.simulator.protocols.GenericOid; 4 | import de.persosim.simulator.protocols.Oid; 5 | 6 | /** 7 | * This interface provides constants used in the context of the Pseudonymous Signatures according to TR-03110. 8 | * 9 | * @author slutters 10 | * 11 | */ 12 | public interface Ps extends de.persosim.simulator.protocols.Tr03110 { 13 | 14 | public static final Oid id_PS = new GenericOid(id_BSI, new byte[] {0x02, 0x02, 0x0B }); 15 | public static final Oid id_PS_PK = new GenericOid(id_BSI, new byte[] {0x02, 0x02, 0x01, 0x03 }); 16 | public static final Oid id_PS_PK_ECDH_ECSchnorr = new GenericOid(id_PS_PK, new byte[] {0x02}); 17 | public static final Oid id_EC_PSPUBLIC_KEY = new GenericOid(id_BSI, new byte[] {0x01, 0x01, 0x02, 0x03 }); 18 | 19 | public static final byte ECDH = (byte) 0x02; 20 | public static final byte SHA_256 = (byte) 0x03; 21 | 22 | public static final String id_PS_STRING = "id-PS"; 23 | public static final String ECDH_STRING = "ECDH"; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ca3/Psa.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols.ca3; 2 | 3 | import de.persosim.simulator.cardobjects.OidIdentifier; 4 | import de.persosim.simulator.protocols.GenericOid; 5 | import de.persosim.simulator.protocols.Oid; 6 | 7 | /** 8 | * This interface provides constants used in the context of the PSA protocol according to TR-03110. 9 | */ 10 | public interface Psa extends Ps { 11 | 12 | public final static Oid id_PSA = new GenericOid(id_PS, new byte[] {0x01}); 13 | public final static Oid id_PSA_ECDH_ECSchnorr = new GenericOid(id_PSA, new byte[] {0x02}); 14 | 15 | public final static String id_PSA_ECDH_ECSchnorr_SHA_256_STRING = "id-PSA-ECDH-SHA-256"; 16 | 17 | /* id-PSA-ECDH-ECSchnorr */ 18 | public final static PsaOid id_PSA_ECDH_ECSchnorr_SHA_256 = new PsaOid(id_PSA_ECDH_ECSchnorr, SHA_256); 19 | 20 | /* OidIdentifier PsaOid */ 21 | public final static OidIdentifier OID_IDENTIFIER_id_PSA_ECDH_ECSchnorr_SHA_256 = new OidIdentifier(id_PSA_ECDH_ECSchnorr_SHA_256); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/platform/ProtocolMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.platform; 2 | 3 | import de.persosim.simulator.protocols.Protocol; 4 | import de.persosim.simulator.secstatus.AbstractSecMechanism; 5 | import de.persosim.simulator.secstatus.SecMechanism; 6 | import de.persosim.simulator.secstatus.SecurityEvent; 7 | 8 | /** 9 | * This {@link SecMechanism} is used to communicate all useful information 10 | * about the currently active protocol. 11 | * 12 | * @author slutters 13 | * 14 | */ 15 | public class ProtocolMechanism extends AbstractSecMechanism { 16 | 17 | protected Class currentlyActiveProtocol; 18 | 19 | public ProtocolMechanism(Class protocolClass) { 20 | currentlyActiveProtocol = protocolClass; 21 | } 22 | 23 | @Override 24 | public boolean needsDeletionInCaseOf(SecurityEvent event) { 25 | if(event.equals(SecurityEvent.SECURE_MESSAGING_SESSION_ENDED)) { 26 | return true; 27 | } else{ 28 | return false; 29 | } 30 | } 31 | 32 | public Class getCurrentlyActiveProtocol() { 33 | return currentlyActiveProtocol; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/apdu/IsoCompatibleProprietaryCommandApdu.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.apdu; 2 | 3 | import de.persosim.simulator.platform.Iso7816; 4 | import de.persosim.simulator.utils.Utils; 5 | 6 | 7 | /** 8 | * This class represents the proprietary class APDU that is used for the 9 | * verify-command as described in TR-03110 v2.10 Part 3 B.11.8. using secure 10 | * messaging and no chaining. 11 | * 12 | * @author mboonk 13 | * 14 | */ 15 | public class IsoCompatibleProprietaryCommandApdu extends InterindustryCommandApduImpl { 16 | 17 | IsoCompatibleProprietaryCommandApdu(byte[] apdu, CommandApdu previousCommandApdu) { 18 | super(apdu, previousCommandApdu); 19 | } 20 | 21 | @Override 22 | public byte getSecureMessaging() { 23 | return (byte) ((byte) (super.getCla() & (byte) 0b00001100) >> 2); 24 | } 25 | 26 | @Override 27 | public CommandApdu rewrapApdu(byte newSmStatus, byte[] commandData) { 28 | byte [] newApdu = Utils.concatByteArrays(header, commandData); 29 | newApdu[Iso7816.OFFSET_CLA] = (byte) ((byte) (getCla() & 0b11110011) | newSmStatus << 2); 30 | return new IsoCompatibleProprietaryCommandApdu(newApdu, this); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/secstatus/SecMechanism.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.secstatus; 2 | 3 | /** 4 | * Classes that implement this interface are used to store relevant data for the 5 | * given SecurityMechanism within the SecStatus. 6 | * 7 | * The state of SecMechanisms can be queried from the SecStatus, which returns 8 | * the genuine SecMechanism as is. SecMechanisms are expected to be immutable to 9 | * ensure the consistency of the SecStatus. 10 | * 11 | * SecConditions can refer to SecMechanisms and rely on the provided data to 12 | * perform the condition checking. 13 | * 14 | * @author amay 15 | * 16 | */ 17 | public interface SecMechanism { 18 | /** 19 | * Decide if this {@link SecMechanism} needs to be deleted if the 20 | * {@link SecStatus} receives the given event. 21 | * 22 | * @param event 23 | * @return true, if deletion is necessary 24 | */ 25 | boolean needsDeletionInCaseOf(SecurityEvent event); 26 | 27 | /** 28 | * This function returns the key which identifies the {@link SecMechanism} 29 | * @return a class object which identifies the {@link SecMechanism} 30 | */ 31 | public Class getKey(); 32 | } 33 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ResponseData.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols; 2 | 3 | /** 4 | * This class is a container that combines a status word with a detailed note 5 | * why this status word has been selected or what it is to indicate if the 6 | * status word itself is ambiguous. 7 | * 8 | * If additionally to a status word there is response data to be transmitted 9 | * this can be achieved by extending this class to also store this data. Both 10 | * classes, i.e. this and the extended one could offer a function 11 | * getResponseApdu(). This class would generate a response APDU solely with the 12 | * status word while the extending class would also incorporate the additional 13 | * data. The method getStatusWord may become obsolete then. 14 | * 15 | * @author slutters 16 | */ 17 | public class ResponseData { 18 | 19 | protected short statusWord; 20 | protected String response; 21 | 22 | public ResponseData(short sw, String note) { 23 | statusWord = sw; 24 | response = note; 25 | } 26 | 27 | public short getStatusWord() { 28 | return statusWord; 29 | } 30 | 31 | public String getResponse() { 32 | return response; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator Test 4 | Bundle-SymbolicName: de.persosim.simulator.test 5 | Bundle-Version: 1.4.0.qualifier 6 | Bundle-Vendor: secunet Security Networks AG 7 | Bundle-RequiredExecutionEnvironment: JavaSE-17 8 | Require-Bundle: 9 | org.junit, 10 | org.globaltester.cryptoprovider.bc, 11 | de.persosim.simulator, 12 | de.persosim.simulator.basics, 13 | de.persosim.simulator.soap, 14 | de.persosim.editor.ui, 15 | org.globaltester.simulator, 16 | org.globaltester.cryptoprovider, 17 | org.globaltester.logging, 18 | org.globaltester.lib.xstream, 19 | org.globaltester.base, 20 | org.hamcrest.library, 21 | org.globaltester.base.test, 22 | com.fasterxml.jackson.core.jackson-core, 23 | com.fasterxml.jackson.core.jackson-databind, 24 | com.fasterxml.jackson.core.jackson-annotations 25 | Export-Package: 26 | de.persosim.simulator, 27 | de.persosim.simulator.perso, 28 | de.persosim.simulator.protocols.ca3, 29 | de.persosim.simulator.test 30 | Import-Package: 31 | jakarta.annotation, 32 | org.eclipse.ui.keys, 33 | org.osgi.framework 34 | Bundle-ClassPath: . 35 | Automatic-Module-Name: de.persosim.simulator.test 36 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/export/File.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso.export; 2 | 3 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 4 | 5 | @JsonPropertyOrder({ // 6 | "fileId", // 7 | "shortFileId", // 8 | "content" // 9 | }) 10 | public class File 11 | { 12 | private String fileId; 13 | private String shortFileId; 14 | private String content; 15 | 16 | public File() 17 | { 18 | // do nothing; default constructor necessary for JSON (de-)serialization 19 | } 20 | 21 | public File(String fileId, String shortFileId, String content) 22 | { 23 | this.fileId = fileId; 24 | this.shortFileId = shortFileId; 25 | this.content = content; 26 | } 27 | 28 | public String getFileId() 29 | { 30 | return fileId; 31 | } 32 | 33 | public void setFileId(String fileId) 34 | { 35 | this.fileId = fileId; 36 | } 37 | 38 | public String getShortFileId() 39 | { 40 | return shortFileId; 41 | } 42 | 43 | public void setShortFileId(String shortFileId) 44 | { 45 | this.shortFileId = shortFileId; 46 | } 47 | 48 | public String getContent() 49 | { 50 | return content; 51 | } 52 | 53 | public void setContent(String content) 54 | { 55 | this.content = content; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/AuthObjectIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import de.persosim.simulator.utils.Utils; 4 | 5 | /** 6 | * Identifier using an integer ID for matching authentication objects. 7 | * @author mboonk 8 | * 9 | */ 10 | public class AuthObjectIdentifier extends AbstractCardObjectIdentifier { 11 | 12 | int identifier; 13 | 14 | public AuthObjectIdentifier(byte[] identifier) { 15 | this(Utils.getIntFromUnsignedByteArray(identifier)); 16 | } 17 | 18 | public AuthObjectIdentifier(int identifier) { 19 | this.identifier = identifier; 20 | } 21 | 22 | public int getIdentifier() { 23 | return identifier; 24 | } 25 | 26 | @Override 27 | public int hashCode() { 28 | final int prime = 31; 29 | int result = 1; 30 | result = prime * result + identifier; 31 | return result; 32 | } 33 | 34 | @Override 35 | public boolean equals(Object obj) { 36 | if (this == obj) 37 | return true; 38 | if (obj == null) 39 | return false; 40 | if (getClass() != obj.getClass()) 41 | return false; 42 | AuthObjectIdentifier other = (AuthObjectIdentifier) obj; 43 | if (identifier != other.identifier) 44 | return false; 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/protocols/TestTr03110UtilsProvider.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols; 2 | 3 | import java.security.Key; 4 | import java.security.PublicKey; 5 | 6 | import de.persosim.simulator.crypto.DomainParameterSet; 7 | import de.persosim.simulator.crypto.certificates.CvPublicKey; 8 | import de.persosim.simulator.tlv.ConstructedTlvDataObject; 9 | import de.persosim.simulator.tlv.TlvDataObjectContainer; 10 | 11 | final class TestTr03110UtilsProvider implements Tr03110UtilsProvider { 12 | private final Object parseCvPublicKeyResult; 13 | 14 | TestTr03110UtilsProvider(Object parseCvPublicKeyResult) { 15 | this.parseCvPublicKeyResult = parseCvPublicKeyResult; 16 | } 17 | 18 | @Override 19 | public CvPublicKey parseCvPublicKey(ConstructedTlvDataObject publicKeyData) { 20 | if (parseCvPublicKeyResult instanceof RuntimeException) throw (RuntimeException) parseCvPublicKeyResult; 21 | return (CvPublicKey) parseCvPublicKeyResult; 22 | } 23 | 24 | @Override 25 | public DomainParameterSet getDomainParameterSetFromKey(Key key) { 26 | return null; 27 | } 28 | 29 | @Override 30 | public TlvDataObjectContainer encodePublicKey(Oid oid, PublicKey pk, boolean includeConditionalObjects) { 31 | return null; 32 | } 33 | } -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/protocols/ProtocolUpdate.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.protocols; 2 | 3 | import de.persosim.simulator.platform.CommandProcessor; 4 | import de.persosim.simulator.processing.UpdatePropagation; 5 | 6 | /** 7 | * This UpdatePropagation stores and provides update information about currently 8 | * active protocols. The information stored herein is common for all protocols 9 | * and does not relate to any protocol specifics. To provide protocol specific 10 | * information provide a own UpdatePropagation. 11 | * 12 | * It's main use case is to carry this information between the {@link CommandProcessor} and 13 | * the protocols. 14 | * 15 | * @author amay 16 | * 17 | */ 18 | public class ProtocolUpdate implements UpdatePropagation { 19 | 20 | private boolean isFinished; 21 | 22 | public ProtocolUpdate(boolean isFinished) { 23 | super(); 24 | this.isFinished = isFinished; 25 | } 26 | 27 | /** 28 | * If this method returns true the {@link CommandProcessor} will remove the 29 | * {@link Protocol} from the stack. 30 | */ 31 | public boolean isFinished() { 32 | return isFinished; 33 | } 34 | 35 | @Override 36 | public Class getKey() { 37 | return getClass(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/platform/HardwareResponseApduPropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.platform; 2 | 3 | import de.persosim.simulator.processing.UpdatePropagation; 4 | 5 | /** 6 | * 7 | * This UpdatePropagation holds the response APDU as provided by the upper 8 | * layers and to be transmitted by the hardware layer. 9 | * 10 | * The PersoSimKernel expects to find one of these UpdatePropagations in the 11 | * ProcessingData when processing was finished. The lowest layer (IoManager) is 12 | * responsible to convert the ResponseAPDU stored in the processingData to the 13 | * hardware compatible format. 14 | * 15 | * PersoSimKernel wil use the last provided response or return 6F00 if no 16 | * response is available. 17 | * 18 | * @author amay 19 | * 20 | */ 21 | public class HardwareResponseApduPropagation implements UpdatePropagation { 22 | 23 | @Override 24 | public Class getKey() { 25 | return HardwareResponseApduPropagation.class; 26 | } 27 | 28 | byte[] responseApdu = null; 29 | 30 | public HardwareResponseApduPropagation(byte[] responseApdu) { 31 | super(); 32 | this.responseApdu = responseApdu; 33 | } 34 | 35 | public byte[] getResponseApdu() { 36 | return responseApdu; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/CAPAWithPasswordSecurityCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.secstatus.CAPAMechanism; 6 | import de.persosim.simulator.secstatus.SecMechanism; 7 | 8 | /** 9 | * This condition can be used to check for past executions of CAPA. The used 10 | * password can be checked as well as the success. 11 | */ 12 | public class CAPAWithPasswordSecurityCondition extends CAPASecurityCondition { 13 | String neededPassword; 14 | 15 | public CAPAWithPasswordSecurityCondition() { 16 | } 17 | 18 | public CAPAWithPasswordSecurityCondition(String passwordName) { 19 | this.neededPassword = passwordName; 20 | } 21 | 22 | @Override 23 | public boolean check(Collection mechanisms) { 24 | if (super.check(mechanisms)) { 25 | for (SecMechanism mechanism : mechanisms) { 26 | if (mechanism instanceof CAPAMechanism 27 | && ((CAPAMechanism) mechanism).getUsedPassword().getPasswordName().equals(neededPassword)) { 28 | return true; 29 | } 30 | } 31 | } 32 | return false; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return getClass().getSimpleName() + "[" + neededPassword + "]"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /de.persosim.simulator.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PersoSim Simulator UI 4 | Bundle-SymbolicName: de.persosim.simulator.ui;singleton:=true 5 | Bundle-Version: 1.4.0.qualifier 6 | Require-Bundle: org.eclipse.swt, 7 | org.eclipse.jface, 8 | org.eclipse.e4.core.di, 9 | org.eclipse.e4.ui.workbench, 10 | jakarta.inject.jakarta.inject-api, 11 | jakarta.annotation-api, 12 | org.eclipse.e4.ui.di, 13 | org.eclipse.e4.ui.model.workbench, 14 | org.eclipse.core.runtime, 15 | org.eclipse.e4.ui.services, 16 | org.eclipse.e4.core.contexts, 17 | de.persosim.simulator, 18 | de.persosim.simulator.basics, 19 | org.eclipse.e4.core.commands, 20 | org.eclipse.e4.core.services, 21 | org.eclipse.osgi, 22 | org.globaltester.logging, 23 | de.persosim.driver.connector, 24 | org.globaltester.simulator, 25 | org.eclipse.osgi 26 | Bundle-RequiredExecutionEnvironment: JavaSE-17 27 | Bundle-ActivationPolicy: lazy 28 | Bundle-Activator: de.persosim.simulator.ui.Activator 29 | Export-Package: 30 | de.persosim.simulator.ui, 31 | de.persosim.simulator.ui.parts, 32 | de.persosim.simulator.ui.utils 33 | Import-Package: de.persosim.driver.connector.service 34 | Bundle-Vendor: secunet Security Networks AG 35 | Automatic-Module-Name: de.persosim.simulator.ui 36 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/crypto/SignatureOids.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto; 2 | 3 | import de.persosim.simulator.protocols.GenericOid; 4 | import de.persosim.simulator.protocols.Oid; 5 | import de.persosim.simulator.utils.HexString; 6 | import de.persosim.simulator.utils.Utils; 7 | 8 | public class SignatureOids { 9 | public final static Oid id_Pkcs1 = new GenericOid(HexString.toByteArray("2A864886F70D0101")); 10 | 11 | public final static Oid id_sha1withrsaencryption = new GenericOid(Utils.appendBytes(id_Pkcs1.toByteArray(), new byte[] { 0x05 })); 12 | public final static Oid id_sha256withrsaencryption = new GenericOid(Utils.appendBytes(id_Pkcs1.toByteArray(), new byte[] { 0x0b })); 13 | public final static Oid id_rsassapss = new GenericOid(Utils.appendBytes(id_Pkcs1.toByteArray(), new byte[] { 0x0a })); 14 | public final static Oid id_ecdsawithSHA224 = new GenericOid(HexString.toByteArray("2A8648CE3D040301")); 15 | public final static Oid id_ecdsawithSHA256 = new GenericOid(HexString.toByteArray("2A8648CE3D040302")); 16 | public final static Oid id_ecdsawithSHA384 = new GenericOid(HexString.toByteArray("2A8648CE3D040303")); 17 | public final static Oid id_ecdsawithSHA512 = new GenericOid(HexString.toByteArray("2A8648CE3D040304")); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/crypto/certificates/CertificateExtension.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto.certificates; 2 | 3 | import de.persosim.simulator.protocols.Oid; 4 | import de.persosim.simulator.tlv.ConstructedTlvDataObject; 5 | import de.persosim.simulator.tlv.TlvDataObjectContainer; 6 | 7 | 8 | /** 9 | * This class implements the basic functionalities of any certificate extension. 10 | * 11 | * @author slutters 12 | * 13 | */ 14 | public abstract class CertificateExtension { 15 | 16 | protected Oid objectIdentifier; 17 | 18 | public CertificateExtension(Oid objectIdentifier) { 19 | this.objectIdentifier = objectIdentifier; 20 | } 21 | 22 | /** 23 | * Get the OID for this extension. 24 | * 25 | * @return the OID for this extension 26 | */ 27 | public Oid getObjectIdentifier() { 28 | return objectIdentifier; 29 | } 30 | 31 | abstract public ConstructedTlvDataObject toTlv(); 32 | 33 | /** 34 | * Get the context specific data objects contained in this extension. 35 | * 36 | * @return the context specific data objects contained in this extension 37 | */ 38 | abstract public TlvDataObjectContainer getDataObjects(); 39 | 40 | @Override 41 | public String toString() { 42 | return toTlv().toString(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/xstream/EncodedByteArrayConverter.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso.xstream; 2 | 3 | import com.thoughtworks.xstream.converters.Converter; 4 | import com.thoughtworks.xstream.converters.MarshallingContext; 5 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 6 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 7 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 8 | 9 | import de.persosim.simulator.utils.*; 10 | 11 | /** 12 | * This class is a converter which is responsible for converting all byte-arrays in hexstrings and back. 13 | * 14 | * @author jgoeke 15 | * 16 | */ 17 | 18 | public class EncodedByteArrayConverter implements Converter { 19 | 20 | public boolean canConvert(@SuppressWarnings("rawtypes") Class type) { 21 | return type.isArray() && type.getComponentType().equals(byte.class); 22 | } 23 | 24 | public void marshal(Object value, HierarchicalStreamWriter writer, 25 | MarshallingContext context) { 26 | writer.setValue(HexString.encode((byte[])value)); 27 | } 28 | 29 | public Object unmarshal(HierarchicalStreamReader reader, 30 | UnmarshallingContext context) { 31 | 32 | String data = reader.getValue(); 33 | return HexString.toByteArray(data); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/apdumatching/ApduSpecificationConstants.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.apdumatching; 2 | 3 | /** 4 | * This interface defines constants to be used in the area of APDU or TLV data 5 | * object specification. 6 | * 7 | * @author slutters 8 | * 9 | */ 10 | public interface ApduSpecificationConstants { 11 | 12 | /* 13 | * These variables are used within APDUSpecification to indicate whether a 14 | * variable is expected to match/mismatch another certain variable or there 15 | * is no expectation at all. 16 | */ 17 | public static final byte REQ_MISMATCH = -1; 18 | public static final byte REQ_OPTIONAL = 0; 19 | public static final byte REQ_MATCH = +1; 20 | 21 | /* 22 | * These variables are used within APDUSpecification to indicate whether 23 | * occurrences of unspecified tags are tolerated. 24 | */ 25 | public static final boolean DO_NOT_ALLOW_FURTHER_TAGS = false; 26 | public static final boolean ALLOW_FURTHER_TAGS = true; 27 | 28 | /* 29 | * These variables are used within APDUSpecification to indicate whether 30 | * some operation is to obey a certain order of objects during execution. 31 | */ 32 | public static final boolean STRICT_ORDER = true; 33 | public static final boolean ARBITRARY_ORDER = false; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/test/PersoSimTestCase.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.test; 2 | 3 | import java.io.File; 4 | 5 | import org.globaltester.cryptoprovider.Crypto; 6 | import org.globaltester.cryptoprovider.bc.ProviderBc; 7 | import org.globaltester.logging.InfoSource; 8 | import org.junit.BeforeClass; 9 | 10 | import de.persosim.simulator.platform.Iso7816; 11 | 12 | /** 13 | * Superclass for all test cases PersoSim. 14 | * 15 | * This class provides a generic implementation of InfoSource suitable during test execution. 16 | * 17 | * The {@link #setUpClass()} method handles correct setup of BasicLogger for the test execution. 18 | * 19 | * @author amay 20 | * 21 | */ 22 | public class PersoSimTestCase implements InfoSource, Iso7816 { 23 | 24 | private static final String TMP_FOLDER = "tmp"; 25 | 26 | @Override 27 | public String getIDString() { 28 | return getClass().getCanonicalName(); 29 | } 30 | 31 | public static File getTmpFolder() { 32 | File tmpFolder = new File(TMP_FOLDER); 33 | if (!tmpFolder.isDirectory()) 34 | tmpFolder.mkdirs(); 35 | return tmpFolder; 36 | } 37 | 38 | @BeforeClass 39 | public static void setupClass(){ 40 | Crypto.setCryptoProvider(ProviderBc.getInstance().getCryptoProviderObject()); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/crypto/StandardizedDomainParameterProvider.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.crypto; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * This interface is used to modularize the standard domain parameter 7 | * implementation. It provides functions that are used to get and use domain 8 | * parameters. 9 | * 10 | * @author mboonk 11 | * 12 | */ 13 | public interface StandardizedDomainParameterProvider { 14 | 15 | /** 16 | * This returns the collection of domain parameter IDs supported by the 17 | * implementation 18 | * 19 | * @return the IDs as Integer 20 | */ 21 | Collection getSupportedDomainParameters(); 22 | 23 | /** 24 | * This method provides domain parameters for a given ID 25 | * 26 | * @param id 27 | * the ID of the domain parameter set 28 | * @return the domain parameter set or null if not supported 29 | */ 30 | DomainParameterSet getDomainParameterSet(int id); 31 | 32 | /** 33 | * This method provides a mapping between the encoded domain parameters and 34 | * their integer ID. 35 | * 36 | * @param algorithmId 37 | * the encoded domain parameters as a hexadecimal string 38 | * @return the domain parameter id or null if not supported 39 | */ 40 | Integer getSimplifiedAlgorithm(String algorithmId); 41 | } 42 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/seccondition/PaceWithPasswordSecurityCondition.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.seccondition; 2 | 3 | import java.util.Collection; 4 | 5 | import de.persosim.simulator.secstatus.PaceMechanism; 6 | import de.persosim.simulator.secstatus.SecMechanism; 7 | 8 | /** 9 | * This condition can be used to check for past executions of PACE. The used 10 | * password can be checked as well as the success. 11 | * 12 | * @author mboonk 13 | * 14 | */ 15 | public class PaceWithPasswordSecurityCondition extends PaceSecurityCondition { 16 | String neededPassword; 17 | 18 | public PaceWithPasswordSecurityCondition() { 19 | } 20 | 21 | public PaceWithPasswordSecurityCondition(String passwordName) { 22 | this.neededPassword = passwordName; 23 | } 24 | 25 | @Override 26 | public boolean check(Collection mechanisms) { 27 | if (super.check(mechanisms)) { 28 | for (SecMechanism mechanism : mechanisms) { 29 | if (mechanism instanceof PaceMechanism 30 | && ((PaceMechanism) mechanism) 31 | .getUsedPassword().getPasswordName().equals(neededPassword)) { 32 | return true; 33 | } 34 | } 35 | } 36 | return false; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return getClass().getSimpleName() + "[" + neededPassword + "]"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/perso/xstream/NullConverter.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.perso.xstream; 2 | 3 | import com.thoughtworks.xstream.converters.Converter; 4 | import com.thoughtworks.xstream.converters.MarshallingContext; 5 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 6 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 7 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 8 | 9 | import de.persosim.simulator.perso.PersonalizationFactory; 10 | 11 | /** 12 | * Intentionally empty converter. This class can convert nothing but providing 13 | * it as Converter via OSGi service will make its classloader available to 14 | * the CompositeClassloader used in PersoSim {@link PersonalizationFactory} 15 | * 16 | * @author amay 17 | * 18 | */ 19 | public abstract class NullConverter implements Converter { 20 | @Override 21 | public boolean canConvert(@SuppressWarnings("rawtypes") Class arg0) { 22 | return false; //we convert nothing 23 | } 24 | 25 | @Override 26 | public void marshal(Object arg0, HierarchicalStreamWriter arg1, MarshallingContext arg2) { 27 | // intentionally do nothing 28 | } 29 | 30 | @Override 31 | public Object unmarshal(HierarchicalStreamReader arg0, UnmarshallingContext arg1) { 32 | // intentionally do nothing 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/Asn1BitString.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | import java.util.Arrays; 4 | 5 | import de.persosim.simulator.utils.BitField; 6 | 7 | public class Asn1BitString { 8 | 9 | private BitField bits; 10 | 11 | public Asn1BitString(byte[] encoded) { 12 | TlvDataObject tlv = TlvDataObjectFactory.createTLVDataObject(encoded); 13 | if (!TlvConstants.TAG_BIT_STRING.equals(tlv.getTlvTag())) throw new IllegalArgumentException("Tag mismatch"); 14 | 15 | byte[] tlvValue = tlv.getValueField(); 16 | byte unusedBits = tlvValue[0]; 17 | byte[] bytes = Arrays.copyOfRange(tlvValue, 1, tlvValue.length); 18 | int bitLength = bytes.length*8-unusedBits; 19 | boolean[] bitsToStore = new boolean[bitLength]; 20 | 21 | bitLength--; //used for offset calculations 22 | for (int i = 0; i < bitsToStore.length; i++) { 23 | int byteNum = (bitLength-i) / 8; 24 | int position = (i+unusedBits)%8; 25 | int bitValue = (bytes[byteNum] >> position) & 1; 26 | bitsToStore[i] = bitValue > 0; 27 | } 28 | 29 | bits = new BitField(bitsToStore); 30 | } 31 | 32 | /** 33 | * returns the value of the indicated bit 34 | * @param i 35 | * @return 36 | */ 37 | public Object getBit(int i) { 38 | return bits.getBit(i); 39 | } 40 | 41 | public Object getNumberOfBits() { 42 | return bits.getNumberOfBits(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/exception/LifeCycleChangeException.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.exception; 2 | 3 | import de.persosim.simulator.cardobjects.Iso7816LifeCycleState; 4 | 5 | /** 6 | * This Exception is thrown if the desired state change is not allowed (due to 7 | * ISO7816 restrictions on the state machine or access conditions at the 8 | * discretion of the implementing class) 9 | * 10 | * @author mboonk 11 | * 12 | */ 13 | public class LifeCycleChangeException extends AccessDeniedException { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private Iso7816LifeCycleState oldState; 18 | private Iso7816LifeCycleState newState; 19 | 20 | public LifeCycleChangeException(String message, Iso7816LifeCycleState oldState, Iso7816LifeCycleState newState) { 21 | super(message); 22 | this.oldState = oldState; 23 | this.newState = newState; 24 | } 25 | 26 | /** 27 | * This returns the state that was current, when the forbidden state change 28 | * was tried. 29 | * 30 | * @return the current state 31 | */ 32 | public Iso7816LifeCycleState getOldState() { 33 | return oldState; 34 | } 35 | 36 | /** 37 | * This returns the state, that the forbidden state change tried to reach. 38 | * @return the target state 39 | */ 40 | public Iso7816LifeCycleState getNewState() { 41 | return newState; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/processing/UpdatePropagation.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.processing; 2 | 3 | /** 4 | * Instances of this interface carry data to update other entities within the 5 | * card according to result of apdu processing. They are stored within the 6 | * ProcessingData and referenced by their type. 7 | * 8 | * This provides a loose coupling between entities defining UpdatePropagation 9 | * types and those who want to provide information within these updates. Also 10 | * this allows the receiving entities to enforce conditions regarding their 11 | * updates or to allow further propagation of this information in order to 12 | * update other entities within the system with the same data. 13 | * 14 | * As an {@link UpdatePropagation} is passed to several entities within the 15 | * system instances of this interface are expected to be immutable. 16 | * 17 | * @author amay 18 | * 19 | */ 20 | public interface UpdatePropagation { 21 | 22 | /** 23 | * Returns the class used as key of this update. 24 | * 25 | * Generally this should be this.getClass(). Under some circumstances it may 26 | * be useful to rely on a superclass/super interface as key. 27 | * 28 | * Usage of a key that this instance is not "instanceof" is not allowed. 29 | * 30 | * @return 31 | */ 32 | public Class getKey(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/cardobjects/TrustPointIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | 4 | import de.persosim.simulator.protocols.ta.TerminalType; 5 | 6 | /** 7 | * This is the implementation of an identifier for stored trust points using 8 | * their terminal type. 9 | * 10 | * @author mboonk 11 | * 12 | */ 13 | public class TrustPointIdentifier extends AbstractCardObjectIdentifier { 14 | 15 | TerminalType terminalType; 16 | 17 | public TrustPointIdentifier() { 18 | } 19 | 20 | public TrustPointIdentifier(TerminalType terminalType) { 21 | this.terminalType = terminalType; 22 | } 23 | 24 | /** 25 | * @return the terminal type used in this identifier 26 | */ 27 | public TerminalType getTerminalType() { 28 | return terminalType; 29 | } 30 | 31 | @Override 32 | public int hashCode() { 33 | final int prime = 31; 34 | int result = 1; 35 | result = prime * result + ((terminalType == null) ? 0 : terminalType.hashCode()); 36 | return result; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object obj) { 41 | if (this == obj) 42 | return true; 43 | if (obj == null) 44 | return false; 45 | if (getClass() != obj.getClass()) 46 | return false; 47 | TrustPointIdentifier other = (TrustPointIdentifier) obj; 48 | if (terminalType != other.terminalType) 49 | return false; 50 | return true; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/src/de/persosim/simulator/cardobjects/NullCardObjectTest.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.cardobjects; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | import static org.junit.Assert.assertNull; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | import de.persosim.simulator.test.PersoSimTestCase; 10 | 11 | public class NullCardObjectTest extends PersoSimTestCase { 12 | NullCardObject nullCardObject; 13 | 14 | @Before 15 | public void setUp() { 16 | nullCardObject = new NullCardObject(); 17 | } 18 | 19 | @Test 20 | public void testGetParent() { 21 | assertNull(nullCardObject.getParent()); 22 | } 23 | 24 | @Test 25 | public void testGetChildren() { 26 | assertEquals(0, nullCardObject.getChildren().size()); 27 | } 28 | 29 | @Test 30 | public void testGetLifeCycle() { 31 | assertEquals(Iso7816LifeCycleState.UNDEFINED, 32 | nullCardObject.getLifeCycleState()); 33 | } 34 | 35 | @Test 36 | public void testSetLifeCycle() { 37 | nullCardObject.updateLifeCycleState(Iso7816LifeCycleState.CREATION); 38 | assertEquals(Iso7816LifeCycleState.UNDEFINED, 39 | nullCardObject.getLifeCycleState()); 40 | } 41 | 42 | /** 43 | * The {@link NullCardObject} is expected to deliver an empty collection. 44 | */ 45 | @Test 46 | public void testGetAllIdentifier() { 47 | assertEquals(0 , nullCardObject.getAllIdentifiers().size()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /de.persosim.simulator/src/de/persosim/simulator/tlv/TlvTagIdentifier.java: -------------------------------------------------------------------------------- 1 | package de.persosim.simulator.tlv; 2 | 3 | /** 4 | * This class describes a segment of a {@link TlvPath}. It contains a TlvTag to 5 | * be searched and an optional occurrence. 6 | *

7 | * If the occurrence is specified this {@link TlvTagIdentifier} identifies the 8 | * zero-based occurrence of the given tag in its container. Otherwise the first 9 | * occurrence is identified. 10 | * 11 | * @author amay 12 | * 13 | */ 14 | public class TlvTagIdentifier { 15 | 16 | private TlvTag tag; 17 | private int noOfPreviousOccurrences = 0; 18 | 19 | /** 20 | * Create an identifier matching the given tag (and the first occurrence). 21 | * @param tag TlvTag to be matched 22 | */ 23 | public TlvTagIdentifier(TlvTag tag) { 24 | this(tag, 0); 25 | } 26 | 27 | /** 28 | * Create an identifier matching the given tag (and the first occurrence). 29 | * @param tag TlvTag to be matched 30 | * @param noOfPreviousOccurrences number of previous occurrences of the given TlvTag 31 | */ 32 | public TlvTagIdentifier(TlvTag tag, int noOfPreviousOccurrences) { 33 | this.tag = tag; 34 | this.noOfPreviousOccurrences = noOfPreviousOccurrences; 35 | } 36 | 37 | public TlvTag getTag() { 38 | return tag; 39 | } 40 | 41 | public int getNoOfPreviousOccurrences() { 42 | return noOfPreviousOccurrences; 43 | } 44 | 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /de.persosim.simulator.soap/src/de/persosim/simulator/control/soap/service/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | 2 | package de.persosim.simulator.control.soap.service; 3 | 4 | import javax.xml.bind.annotation.XmlRegistry; 5 | 6 | 7 | /** 8 | * This object contains factory methods for each 9 | * Java content interface and Java element interface 10 | * generated in the de.persosim.simulator.control.soap.service package. 11 | *

An ObjectFactory allows you to programatically 12 | * construct new instances of the Java representation 13 | * for XML content. The Java representation of XML 14 | * content can consist of schema derived interfaces 15 | * and classes representing the binding of schema 16 | * type definitions, element declarations and model 17 | * groups. Factory methods for each of these are 18 | * provided in this class. 19 | * 20 | */ 21 | @XmlRegistry 22 | public class ObjectFactory { 23 | 24 | 25 | /** 26 | * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: de.persosim.simulator.control.soap.service 27 | * 28 | */ 29 | public ObjectFactory() { 30 | } 31 | 32 | /** 33 | * Create an instance of {@link PersoSimRemoteControlResult } 34 | * 35 | */ 36 | public PersoSimRemoteControlResult createPersoSimRemoteControlResult() { 37 | return new PersoSimRemoteControlResult(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /de.persosim.simulator.test/wsdl/gen/de/persosim/simulator/control/soap/service/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | 2 | package de.persosim.simulator.control.soap.service; 3 | 4 | import javax.xml.bind.annotation.XmlRegistry; 5 | 6 | 7 | /** 8 | * This object contains factory methods for each 9 | * Java content interface and Java element interface 10 | * generated in the de.persosim.simulator.control.soap.service package. 11 | *

An ObjectFactory allows you to programatically 12 | * construct new instances of the Java representation 13 | * for XML content. The Java representation of XML 14 | * content can consist of schema derived interfaces 15 | * and classes representing the binding of schema 16 | * type definitions, element declarations and model 17 | * groups. Factory methods for each of these are 18 | * provided in this class. 19 | * 20 | */ 21 | @XmlRegistry 22 | public class ObjectFactory { 23 | 24 | 25 | /** 26 | * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: de.persosim.simulator.control.soap.service 27 | * 28 | */ 29 | public ObjectFactory() { 30 | } 31 | 32 | /** 33 | * Create an instance of {@link PersoSimRemoteControlResult } 34 | * 35 | */ 36 | public PersoSimRemoteControlResult createPersoSimRemoteControlResult() { 37 | return new PersoSimRemoteControlResult(); 38 | } 39 | 40 | } 41 | --------------------------------------------------------------------------------