From 324a9d576eed2cb9c19347d12a439b708e04830a Mon Sep 17 00:00:00 2001 From: Andrei Cristea Date: Mon, 27 Nov 2023 17:26:37 +0100 Subject: [PATCH] release 2.0.0 --- 1.8.1-SNAPSHOT/api_class_diagram.puml | 531 ------------------ 1.8.1-SNAPSHOT/api_class_diagram.svg | 1 - .../api_class_diagram.puml | 0 .../api_class_diagram.svg | 0 2.1.0-SNAPSHOT/api_class_diagram.puml | 436 ++++++++++++++ 2.1.0-SNAPSHOT/api_class_diagram.svg | 1 + 6 files changed, 437 insertions(+), 532 deletions(-) delete mode 100644 1.8.1-SNAPSHOT/api_class_diagram.puml delete mode 100644 1.8.1-SNAPSHOT/api_class_diagram.svg rename {2.0.0-SNAPSHOT => 2.0.0}/api_class_diagram.puml (100%) rename {2.0.0-SNAPSHOT => 2.0.0}/api_class_diagram.svg (100%) create mode 100644 2.1.0-SNAPSHOT/api_class_diagram.puml create mode 100644 2.1.0-SNAPSHOT/api_class_diagram.svg diff --git a/1.8.1-SNAPSHOT/api_class_diagram.puml b/1.8.1-SNAPSHOT/api_class_diagram.puml deleted file mode 100644 index 521e327..0000000 --- a/1.8.1-SNAPSHOT/api_class_diagram.puml +++ /dev/null @@ -1,531 +0,0 @@ -@startuml -title - Calypsonet - calypsonet-terminal-calypso-java-api - 1.8.+ (2023-03-13) -end title - -' == THEME == - -'Couleurs issues de : https://htmlcolorcodes.com/fr/tableau-de-couleur/tableau-de-couleur-design-plat/ -!define C_GREY1 F8F9F9 -!define C_GREY2 F2F3F4 -!define C_GREY3 E5E7E9 -!define C_GREY4 D7DBDD -!define C_GREY5 CACFD2 -!define C_GREY6 BDC3C7 -!define C_LINK 3498DB -!define C_USE 27AE60 - -' -- Styles that don't work with new version of plantuml -- -skinparam stereotypeABorderColor #A9DCDF -skinparam stereotypeIBorderColor #B4A7E5 -skinparam stereotypeCBorderColor #ADD1B2 -skinparam stereotypeEBorderColor #EB93DF -' -- END -- - -skinparam ClassBorderThickness 2 -skinparam ArrowThickness 2 - -' Yellow -skinparam ClassBackgroundColor #FEFECE -skinparam ClassBorderColor #D4AC0D -' Red -skinparam ClassBackgroundColor<> #FDEDEC -skinparam ClassBorderColor<> #E74C3C -hide <> stereotype -' Purple -skinparam ClassBackgroundColor<> #F4ECF7 -skinparam ClassBorderColor<> #8E44AD -hide <> stereotype -' blue -skinparam ClassBackgroundColor<> #EBF5FB -skinparam ClassBorderColor<> #3498DB -hide <> stereotype -' Green -skinparam ClassBackgroundColor<> #E9F7EF -skinparam ClassBorderColor<> #27AE60 -hide <> stereotype -' Grey -skinparam ClassBackgroundColor<> #EAECEE -skinparam ClassBorderColor<> #2C3E50 -hide <> stereotype - -' == CONTENT == - -legend top - __Colors legend__ : - * __External public API references__ : - ** **calypsonet-terminal-reader-java-api** -end legend - -package "org.calypsonet.terminal.calypso" as api { - - +class "**final** CalypsoApiProperties" as ApiProperties { - +{static} **final** String VERSION - } - +enum WriteAccessLevel { - PERSONALIZATION - LOAD - DEBIT - } - +enum "WriteAccessLevel" as WriteAccessLevel2 { - PERSONALIZATION - LOAD - DEBIT - } - +enum SelectFileControl { - FIRST_EF - NEXT_EF - CURRENT_DF - } - +enum GetDataTag { - FCP_FOR_CURRENT_FILE - FCI_FOR_CURRENT_DF - EF_LIST - TRACEABILITY_INFORMATION - } - package spi { - +interface SamRevocationServiceSpi { - +boolean isSamRevoked (byte[] serialNumber) - +boolean isSamRevoked (byte[] serialNumber, int counterValue) - } - } - package card { - +interface "<<CardSelection>>\nCalypsoCardSelection" as CalypsoCardSelection { - +CalypsoCardSelection filterByCardProtocol (String cardProtocol) - - +CalypsoCardSelection filterByPowerOnData (String powerOnDataRegex) - - +CalypsoCardSelection filterByDfName (byte[] aid) - +CalypsoCardSelection filterByDfName (String aid) - +CalypsoCardSelection setFileOccurrence (FileOccurrence fileOccurrence) - +CalypsoCardSelection setFileControlInformation (FileControlInformation fileControlInformation) - +CalypsoCardSelection addSuccessfulStatusWord (int statusWord) - - +CalypsoCardSelection acceptInvalidatedCard () - - +CalypsoCardSelection prepareSelectFile (byte[] lid) - +CalypsoCardSelection prepareSelectFile (short lid) - +CalypsoCardSelection prepareSelectFile (SelectFileControl selectControl) - - +CalypsoCardSelection prepareGetData (GetDataTag tag) - - +CalypsoCardSelection prepareReadRecordFile (byte sfi, int recordNumber) - +CalypsoCardSelection prepareReadRecord (byte sfi, int recordNumber) - +CalypsoCardSelection prepareReadBinary (byte sfi, int offset, int nbBytesToRead) - +CalypsoCardSelection prepareReadCounter (byte sfi, int nbCountersToRead) - - +CalypsoCardSelection preparePreOpenSecureSession (WriteAccessLevel writeAccessLevel) - } - +enum FileOccurrence { - FIRST - LAST - NEXT - PREVIOUS - } - +enum FileControlInformation { - FCI - NO_RESPONSE - } - +interface "<<SmartCard>>\nCalypsoCard" as CalypsoCard { - +ProductType getProductType () - +boolean isHce () - - +boolean isDfInvalidated () - - +byte[] getDfName () - +byte[] getApplicationSerialNumber () - - +byte[] getStartupInfoRawData () - +byte getPlatform () - +byte getApplicationType () - +byte getApplicationSubtype () - +byte getSoftwareIssuer () - +byte getSoftwareVersion () - +byte getSoftwareRevision () - +byte getSessionModification () - - +byte[] getTraceabilityInformation () - - +DirectoryHeader getDirectoryHeader () - +ElementaryFile getFileBySfi (byte sfi) - +ElementaryFile getFileByLid (short lid) - +Map getAllFiles () - +Set getFiles () - - +boolean isDfRatified () - +int getTransactionCounter () - - +boolean isPkiModeSupported () - +boolean isExtendedModeSupported () - +boolean isRatificationOnDeselectSupported () - - +boolean isPinFeatureAvailable () - +boolean isPinBlocked () - +int getPinAttemptRemaining () - - +boolean isSvFeatureAvailable () - +int getSvBalance () - +int getSvLastTNum () - +SvLoadLogRecord getSvLoadLogRecord () - +SvDebitLogRecord getSvDebitLogLastRecord () - +List getSvDebitLogAllRecords () - } - +interface DirectoryHeader { - +short getLid () - +Byte getDfStatus () - - +byte[] getAccessConditions () - +byte[] getKeyIndexes () - - +byte getKif (WriteAccessLevel writeAccessLevel) - +byte getKvc (WriteAccessLevel writeAccessLevel) - } - +interface ElementaryFile { - +byte getSfi () - +FileHeader getHeader () - +FileData getData () - } - +interface FileHeader { - +short getLid () - +byte getDfStatus () - +ElementaryFile.Type getEfType () - - +int getRecordsNumber () - +int getRecordSize () - - +byte[] getAccessConditions () - +byte[] getKeyIndexes () - - +Short getSharedReference () - } - +enum "Type" as FileType { - LINEAR - BINARY - CYCLIC - COUNTERS - SIMULATED_COUNTERS - } - +interface FileData { - +byte[] getContent () - +byte[] getContent (int numRecord) - +byte[] getContent (int numRecord, int dataOffset, int dataLength) - +SortedMap getAllRecordsContent () - - +Integer getContentAsCounterValue (int numCounter) - +SortedMap getAllCountersValue () - } - +enum "ProductType" as CardProductType { - PRIME_REVISION_1 - PRIME_REVISION_2 - PRIME_REVISION_3 - LIGHT - BASIC - UNKNOWN - } - +interface SvLoadLogRecord { - +byte[] getRawData () - - +byte[] getLoadDate () - +byte[] getLoadTime () - - +int getAmount () - +int getBalance () - +byte[] getFreeData () - - +byte getKvc () - +byte[] getSamId () - +int getSamTNum () - +int getSvTNum () - } - +interface SvDebitLogRecord { - +byte[] getRawData () - - +byte[] getDebitDate () - +byte[] getDebitTime () - - +int getAmount () - +int getBalance () - - +byte getKvc () - +byte[] getSamId () - +int getSamTNum () - +int getSvTNum () - } - } - package sam { - +interface "<<CardSelection>>\nCalypsoSamSelection" as CalypsoSamSelection { - +CalypsoSamSelection filterByProductType (CalypsoSam.ProductType productType) - +CalypsoSamSelection filterBySerialNumber (String serialNumberRegex) - - +CalypsoSamSelection setUnlockData (String unlockData) - } - +interface "<<SmartCard>>\nCalypsoSam" as CalypsoSam { - +ProductType getProductType () - +String getProductInfo () - - +byte[] getSerialNumber () - +byte getPlatform () - +byte getApplicationType () - +byte getApplicationSubType () - +byte getSoftwareIssuer () - +byte getSoftwareVersion () - +byte getSoftwareRevision () - } - +enum "ProductType" as SamProductType { - SAM_C1 - HSM_C1 - SAM_S1E1 - SAM_S1Dx - CSAM_F - UNKNOWN - } - } - package transaction { - ' Common to Card and SAM - +interface CommonTransactionManager,\nS extends CommonSecuritySetting> { - +S getSecuritySetting () - +List getTransactionAuditData () - - +T prepareComputeSignature (CommonSignatureComputationData data) - +T prepareVerifySignature (CommonSignatureVerificationData data) - - +T processCommands () - +T processCommands (boolean closePhysicalChannel) - } - +interface CommonSignatureComputationData> { - +T setData (byte[] data, byte kif, byte kvc) - +T setSignatureSize (int size) - +T setKeyDiversifier (byte[] diversifier) - - +byte[] getSignature () - } - +interface BasicSignatureComputationData extends CommonSignatureComputationData { - } - +interface TraceableSignatureComputationData extends CommonSignatureComputationData { - +TraceableSignatureComputationData withSamTraceabilityMode (int offset, boolean usePartialSamSerialNumber) - +TraceableSignatureComputationData withoutBusyMode () - - +byte[] getSignedData () - } - +interface CommonSignatureVerificationData> { - +T setData (byte[] data, byte[] signature, byte kif, byte kvc) - +T setKeyDiversifier (byte[] diversifier) - - +boolean isSignatureValid () - } - +interface BasicSignatureVerificationData extends CommonSignatureVerificationData { - } - +interface TraceableSignatureVerificationData extends CommonSignatureVerificationData { - +TraceableSignatureVerificationData withSamTraceabilityMode (int offset, boolean isPartialSamSerialNumber, boolean checkSamRevocationStatus) - +TraceableSignatureVerificationData withoutBusyMode () - } - +interface CommonSecuritySetting> { - +S setControlSamResource (CardReader samReader, CalypsoSam calypsoSam) - +S setSamRevocationServiceSpi (SamRevocationServiceSpi service) - } - ' Card - +interface CardTransactionManager extends CommonTransactionManager { - +CardReader getCardReader () - +CalypsoCard getCalypsoCard () - +CardSecuritySetting getCardSecuritySetting () - - +CardTransactionManager prepareSelectFile (byte[] lid) - +CardTransactionManager prepareSelectFile (short lid) - +CardTransactionManager prepareSelectFile (SelectFileControl selectFileControl) - - +CardTransactionManager prepareGetData (GetDataTag tag) - - +CardTransactionManager prepareReadRecordFile (byte sfi, int recordNumber) - +CardTransactionManager prepareReadRecordFile (byte sfi, int firstRecordNumber, int numberOfRecords, int recordSize) - +CardTransactionManager prepareReadCounterFile (byte sfi, int countersNumber) - +CardTransactionManager prepareReadRecord (byte sfi, int recordNumber) - +CardTransactionManager prepareReadRecords (byte sfi, int fromRecordNumber, int toRecordNumber, int recordSize) - +CardTransactionManager prepareReadRecordsPartially (byte sfi, int fromRecordNumber, int toRecordNumber, int offset, int nbBytesToRead) - +CardTransactionManager prepareReadBinary (byte sfi, int offset, int nbBytesToRead) - +CardTransactionManager prepareReadCounter (byte sfi, int nbCountersToRead) - - +CardTransactionManager prepareSearchRecords (SearchCommandData data) - - +CardTransactionManager prepareCheckPinStatus () - - +CardTransactionManager prepareAppendRecord (byte sfi, byte[] recordData) - +CardTransactionManager prepareUpdateRecord (byte sfi, int recordNumber, byte[] recordData) - +CardTransactionManager prepareWriteRecord (byte sfi, int recordNumber, byte[] recordData) - - +CardTransactionManager prepareUpdateBinary (byte sfi, int offset, byte[] data) - +CardTransactionManager prepareWriteBinary (byte sfi, int offset, byte[] data) - - +CardTransactionManager prepareIncreaseCounter (byte sfi, int counterNumber, int incValue) - +CardTransactionManager prepareIncreaseCounters(byte sfi, Map counterNumberToIncValueMap) - +CardTransactionManager prepareDecreaseCounter (byte sfi, int counterNumber, int decValue) - +CardTransactionManager prepareDecreaseCounters(byte sfi, Map counterNumberToDecValueMap) - +CardTransactionManager prepareSetCounter (byte sfi, int counterNumber, int newValue) - - +CardTransactionManager prepareSvGet (SvOperation svOperation, SvAction svAction) - +CardTransactionManager prepareSvReload (int amount, byte[] date, byte[] time, byte[] free) - +CardTransactionManager prepareSvReload (int amount) - +CardTransactionManager prepareSvDebit (int amount, byte[] date, byte[] time) - +CardTransactionManager prepareSvDebit (int amount) - +CardTransactionManager prepareSvReadAllLogs () - - +CardTransactionManager prepareInvalidate () - +CardTransactionManager prepareRehabilitate () - - +CardTransactionManager prepareEarlyMutualAuthentication () - +CardTransactionManager prepareActivateEncryption () - +CardTransactionManager prepareDeactivateEncryption () - - +CardTransactionManager prepareReleaseCardChannel () - - +CardTransactionManager processCardCommands () - - +CardTransactionManager processVerifyPin (byte[] pin) - +CardTransactionManager prepareVerifyPin (byte[] pin) - +CardTransactionManager processChangePin (byte[] newPin) - +CardTransactionManager prepareChangePin (byte[] newPin) - - +CardTransactionManager processChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc) - +CardTransactionManager prepareChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc) - - +CardTransactionManager processOpening (WriteAccessLevel writeAccessLevel) - +CardTransactionManager prepareOpenSecureSession (WriteAccessLevel writeAccessLevel) - +CardTransactionManager processClosing () - +CardTransactionManager prepareCloseSecureSession () - +CardTransactionManager processCancel () - +CardTransactionManager prepareCancelSecureSession () - - +void initSamContextForNextTransaction () - } - +enum SvOperation { - RELOAD - DEBIT - } - +enum SvAction { - DO - UNDO - } - +interface CardSecuritySetting extends CommonSecuritySetting { - +CardSecuritySetting setSamResource (CardReader samReader, CalypsoSam calypsoSam) - - +CardSecuritySetting enableMultipleSession () - +CardSecuritySetting enableRatificationMechanism () - +CardSecuritySetting enablePinPlainTransmission () - +CardSecuritySetting enableSvLoadAndDebitLog () - +CardSecuritySetting authorizeSvNegativeBalance () - +CardSecuritySetting disableReadOnSessionOpening () - - +CardSecuritySetting assignKif (WriteAccessLevel writeAccessLevel, byte kvc, byte kif) - +CardSecuritySetting assignDefaultKif (WriteAccessLevel writeAccessLevel, byte kif) - +CardSecuritySetting assignDefaultKvc (WriteAccessLevel writeAccessLevel, byte kvc) - - +CardSecuritySetting addAuthorizedSessionKey (byte kif, byte kvc) - +CardSecuritySetting addAuthorizedSvKey (byte kif, byte kvc) - - +CardSecuritySetting setPinVerificationCipheringKey (byte kif, byte kvc) - +CardSecuritySetting setPinModificationCipheringKey (byte kif, byte kvc) - } - +interface SearchCommandData { - +SearchCommandData setSfi (byte sfi) - +SearchCommandData startAtRecord (int recordNumber) - +SearchCommandData setOffset (int offset) - +SearchCommandData enableRepeatedOffset () - +SearchCommandData setSearchData (byte[] data) - +SearchCommandData setMask (byte[] mask) - +SearchCommandData fetchFirstMatchingResult () - - +List getMatchingRecordNumbers () - } - ' SAM - +interface "SamTransactionManager" as SamTransactionManager extends CommonTransactionManager { - +CardReader getSamReader () - +CalypsoSam getCalypsoSam () - } - +interface "SamSecuritySetting" as SamSecuritySetting extends CommonSecuritySetting { - } - ' Exceptions - +class "<>" as RuntimeException { - +**SessionBufferOverflowException**: Session buffer would overflow for atomic session. - +**UnauthorizedKeyException** - +**CardRevokedException** - +**SamRevokedException** - +**InconsistentDataException**: Number of R-APDUs != number of C-APDUs **or** data read in session != data read outside session. - +**InvalidSignatureException**: R-APDU of PSO Verify Signature = 6988. - +**InvalidCardSignatureException**: R-APDU of DigestAuthenticate = 6988 **or** R-APDU of SvCheck = 6988. - +**CardSignatureNotVerifiableException**: R-APDU of CloseSecureSession = 9000 but SAM is no more available. - +**SelectFileException**: R-APDU of SelectFile = 6A82. - +**UnexpectedCommandStatusException** - +**ReaderIOException**: Card reader and/or SAM reader communication is broken. - +**CardIOException** - +**SamIOException** - } - } -} - -' Associations - -CommonTransactionManager .up.> CommonSignatureComputationData #C_USE : use > -CommonTransactionManager .up.> CommonSignatureVerificationData #C_USE : use > -CommonTransactionManager ..> CommonSecuritySetting #C_LINK : provide > - -CommonSecuritySetting .left.> SamRevocationServiceSpi #C_USE : use > -CommonSecuritySetting .left.> CalypsoSam #C_USE : use > - -CalypsoCardSelection +-- FileOccurrence -CalypsoCardSelection ..> FileOccurrence #C_LINK : provide > -CalypsoCardSelection +-- FileControlInformation -CalypsoCardSelection ..> FileControlInformation #C_LINK : provide > - -CardTransactionManager ..> WriteAccessLevel #C_USE : use > -CardTransactionManager ..> SvOperation #C_USE : use > -CardTransactionManager ..> SvAction #C_USE : use > -CardTransactionManager .up.> SelectFileControl #C_USE : use > -CardTransactionManager .up.> GetDataTag #C_USE : use > -CardTransactionManager .right.> SearchCommandData #C_USE : use > -CardTransactionManager .right.> CalypsoCard #C_LINK : use and provide up to date content > -CardTransactionManager ..> CardSecuritySetting #C_LINK : provide > - -CardSecuritySetting ..> WriteAccessLevel #C_USE : use > - -CalypsoSamSelection ..> SamProductType #C_USE : use > - -SamTransactionManager ..> CalypsoSam #C_LINK : provide > -SamTransactionManager ..> SamSecuritySetting #C_LINK : provide > - -CalypsoSam +-- SamProductType -CalypsoSam ..> SamProductType #C_LINK : provide > - -CalypsoCardSelection .up.> SelectFileControl #C_USE : use > -CalypsoCardSelection .up.> GetDataTag #C_USE : use > -CalypsoCardSelection .up.> WriteAccessLevel2 #C_USE : use > - -CalypsoCard ..> DirectoryHeader #C_LINK : provide > -CalypsoCard ..> ElementaryFile #C_LINK : provide > -CalypsoCard +-- CardProductType -CalypsoCard ..> CardProductType #C_LINK : provide > -CalypsoCard ..> SvLoadLogRecord #C_LINK : provide > -CalypsoCard ..> SvDebitLogRecord #C_LINK : provide > - -DirectoryHeader ..> WriteAccessLevel #C_USE : use > - -ElementaryFile +-- FileType -ElementaryFile ..> FileHeader #C_LINK : provide > -ElementaryFile ..> FileData #C_LINK : provide > - -FileHeader .right.> FileType #C_LINK : provide > - -' == LAYOUT == - -'CommonSignatureComputationData -[hidden]- CommonSignatureVerificationData -'CardSecuritySetting -[hidden]- CalypsoSam -'SamSecuritySetting -[hidden]- CalypsoSam - -' == STYLE == - -package api #C_GREY1 {} -package api.spi #C_GREY2 {} -package api.card #C_GREY2 {} -package api.sam #C_GREY2 {} -package api.transaction #C_GREY2 {} - - -@enduml \ No newline at end of file diff --git a/1.8.1-SNAPSHOT/api_class_diagram.svg b/1.8.1-SNAPSHOT/api_class_diagram.svg deleted file mode 100644 index 3b05c94..0000000 --- a/1.8.1-SNAPSHOT/api_class_diagram.svg +++ /dev/null @@ -1 +0,0 @@ -Calypsonet - calypsonet-terminal-calypso-java-api - 1.8.+ (2023-03-13)Colors legend:External public API references:calypsonet-terminal-reader-java-apiorg.calypsonet.terminal.calypsospicardsamtransactionfinalCalypsoApiPropertiesfinalString VERSIONWriteAccessLevelPERSONALIZATIONLOADDEBITWriteAccessLevelPERSONALIZATIONLOADDEBITSelectFileControlFIRST_EFNEXT_EFCURRENT_DFGetDataTagFCP_FOR_CURRENT_FILEFCI_FOR_CURRENT_DFEF_LISTTRACEABILITY_INFORMATIONSamRevocationServiceSpiboolean isSamRevoked (byte[] serialNumber)boolean isSamRevoked (byte[] serialNumber, int counterValue)<<CardSelection>>CalypsoCardSelectionCalypsoCardSelection filterByCardProtocol (String cardProtocol) CalypsoCardSelection filterByPowerOnData (String powerOnDataRegex) CalypsoCardSelection filterByDfName (byte[] aid)CalypsoCardSelection filterByDfName (String aid)CalypsoCardSelection setFileOccurrence (FileOccurrence fileOccurrence)CalypsoCardSelection setFileControlInformation (FileControlInformation fileControlInformation)CalypsoCardSelection addSuccessfulStatusWord (int statusWord) CalypsoCardSelection acceptInvalidatedCard () CalypsoCardSelection prepareSelectFile (byte[] lid)CalypsoCardSelection prepareSelectFile (short lid)CalypsoCardSelection prepareSelectFile (SelectFileControl selectControl) CalypsoCardSelection prepareGetData (GetDataTag tag) CalypsoCardSelection prepareReadRecordFile (byte sfi, int recordNumber)CalypsoCardSelection prepareReadRecord (byte sfi, int recordNumber)CalypsoCardSelection prepareReadBinary (byte sfi, int offset, int nbBytesToRead)CalypsoCardSelection prepareReadCounter (byte sfi, int nbCountersToRead) CalypsoCardSelection preparePreOpenSecureSession (WriteAccessLevel writeAccessLevel)FileOccurrenceFIRSTLASTNEXTPREVIOUSFileControlInformationFCINO_RESPONSE<<SmartCard>>CalypsoCardProductType getProductType ()boolean isHce () boolean isDfInvalidated () byte[] getDfName ()byte[] getApplicationSerialNumber () byte[] getStartupInfoRawData ()byte getPlatform ()byte getApplicationType ()byte getApplicationSubtype ()byte getSoftwareIssuer ()byte getSoftwareVersion ()byte getSoftwareRevision ()byte getSessionModification () byte[] getTraceabilityInformation () DirectoryHeader getDirectoryHeader ()ElementaryFile getFileBySfi (byte sfi)ElementaryFile getFileByLid (short lid)Map<Byte, ElementaryFile> getAllFiles ()Set<ElementaryFile> getFiles () boolean isDfRatified ()int getTransactionCounter () boolean isPkiModeSupported ()boolean isExtendedModeSupported ()boolean isRatificationOnDeselectSupported () boolean isPinFeatureAvailable ()boolean isPinBlocked ()int getPinAttemptRemaining () boolean isSvFeatureAvailable ()int getSvBalance ()int getSvLastTNum ()SvLoadLogRecord getSvLoadLogRecord ()SvDebitLogRecord getSvDebitLogLastRecord ()List<SvDebitLogRecord> getSvDebitLogAllRecords ()DirectoryHeadershort getLid ()Byte getDfStatus () byte[] getAccessConditions ()byte[] getKeyIndexes () byte getKif (WriteAccessLevel writeAccessLevel)byte getKvc (WriteAccessLevel writeAccessLevel)ElementaryFilebyte getSfi ()FileHeader getHeader ()FileData getData ()FileHeadershort getLid ()byte getDfStatus ()ElementaryFile.Type getEfType () int getRecordsNumber ()int getRecordSize () byte[] getAccessConditions ()byte[] getKeyIndexes () Short getSharedReference ()TypeLINEARBINARYCYCLICCOUNTERSSIMULATED_COUNTERSFileDatabyte[] getContent ()byte[] getContent (int numRecord)byte[] getContent (int numRecord, int dataOffset, int dataLength)SortedMap<Integer, byte[]> getAllRecordsContent () Integer getContentAsCounterValue (int numCounter)SortedMap<Integer, Integer> getAllCountersValue ()ProductTypePRIME_REVISION_1PRIME_REVISION_2PRIME_REVISION_3LIGHTBASICUNKNOWNSvLoadLogRecordbyte[] getRawData () byte[] getLoadDate ()byte[] getLoadTime () int getAmount ()int getBalance ()byte[] getFreeData () byte getKvc ()byte[] getSamId ()int getSamTNum ()int getSvTNum ()SvDebitLogRecordbyte[] getRawData () byte[] getDebitDate ()byte[] getDebitTime () int getAmount ()int getBalance () byte getKvc ()byte[] getSamId ()int getSamTNum ()int getSvTNum ()<<CardSelection>>CalypsoSamSelectionCalypsoSamSelection filterByProductType (CalypsoSam.ProductType productType)CalypsoSamSelection filterBySerialNumber (String serialNumberRegex) CalypsoSamSelection setUnlockData (String unlockData)<<SmartCard>>CalypsoSamProductType getProductType ()String getProductInfo () byte[] getSerialNumber ()byte getPlatform ()byte getApplicationType ()byte getApplicationSubType ()byte getSoftwareIssuer ()byte getSoftwareVersion ()byte getSoftwareRevision ()ProductTypeSAM_C1HSM_C1SAM_S1E1SAM_S1DxCSAM_FUNKNOWNCommonTransactionManagerT extends CommonTransactionManager<T, S>,S extends CommonSecuritySetting<S>S getSecuritySetting ()List<byte[]> getTransactionAuditData () T prepareComputeSignature (CommonSignatureComputationData<?> data)T prepareVerifySignature (CommonSignatureVerificationData<?> data) T processCommands ()T processCommands (boolean closePhysicalChannel)CommonSignatureComputationDataT extends CommonSignatureComputationData<T>T setData (byte[] data, byte kif, byte kvc)T setSignatureSize (int size)T setKeyDiversifier (byte[] diversifier) byte[] getSignature ()BasicSignatureComputationDataTraceableSignatureComputationDataTraceableSignatureComputationData withSamTraceabilityMode (int offset, boolean usePartialSamSerialNumber)TraceableSignatureComputationData withoutBusyMode () byte[] getSignedData ()CommonSignatureVerificationDataT extends CommonSignatureVerificationData<T>T setData (byte[] data, byte[] signature, byte kif, byte kvc)T setKeyDiversifier (byte[] diversifier) boolean isSignatureValid ()BasicSignatureVerificationDataTraceableSignatureVerificationDataTraceableSignatureVerificationData withSamTraceabilityMode (int offset, boolean isPartialSamSerialNumber, boolean checkSamRevocationStatus)TraceableSignatureVerificationData withoutBusyMode ()CommonSecuritySettingS extends CommonSecuritySetting<S>S setControlSamResource (CardReadersamReader, CalypsoSam calypsoSam)S setSamRevocationServiceSpi (SamRevocationServiceSpi service)CardTransactionManagerCardReadergetCardReader ()CalypsoCard getCalypsoCard ()CardSecuritySetting getCardSecuritySetting () CardTransactionManager prepareSelectFile (byte[] lid)CardTransactionManager prepareSelectFile (short lid)CardTransactionManager prepareSelectFile (SelectFileControl selectFileControl) CardTransactionManager prepareGetData (GetDataTag tag) CardTransactionManager prepareReadRecordFile (byte sfi, int recordNumber)CardTransactionManager prepareReadRecordFile (byte sfi, int firstRecordNumber, int numberOfRecords, int recordSize)CardTransactionManager prepareReadCounterFile (byte sfi, int countersNumber)CardTransactionManager prepareReadRecord (byte sfi, int recordNumber)CardTransactionManager prepareReadRecords (byte sfi, int fromRecordNumber, int toRecordNumber, int recordSize)CardTransactionManager prepareReadRecordsPartially (byte sfi, int fromRecordNumber, int toRecordNumber, int offset, int nbBytesToRead)CardTransactionManager prepareReadBinary (byte sfi, int offset, int nbBytesToRead)CardTransactionManager prepareReadCounter (byte sfi, int nbCountersToRead) CardTransactionManager prepareSearchRecords (SearchCommandData data) CardTransactionManager prepareCheckPinStatus () CardTransactionManager prepareAppendRecord (byte sfi, byte[] recordData)CardTransactionManager prepareUpdateRecord (byte sfi, int recordNumber, byte[] recordData)CardTransactionManager prepareWriteRecord (byte sfi, int recordNumber, byte[] recordData) CardTransactionManager prepareUpdateBinary (byte sfi, int offset, byte[] data)CardTransactionManager prepareWriteBinary (byte sfi, int offset, byte[] data) CardTransactionManager prepareIncreaseCounter (byte sfi, int counterNumber, int incValue)CardTransactionManager prepareIncreaseCounters(byte sfi, Map<Integer, Integer> counterNumberToIncValueMap)CardTransactionManager prepareDecreaseCounter (byte sfi, int counterNumber, int decValue)CardTransactionManager prepareDecreaseCounters(byte sfi, Map<Integer, Integer> counterNumberToDecValueMap)CardTransactionManager prepareSetCounter (byte sfi, int counterNumber, int newValue) CardTransactionManager prepareSvGet (SvOperation svOperation, SvAction svAction)CardTransactionManager prepareSvReload (int amount, byte[] date, byte[] time, byte[] free)CardTransactionManager prepareSvReload (int amount)CardTransactionManager prepareSvDebit (int amount, byte[] date, byte[] time)CardTransactionManager prepareSvDebit (int amount)CardTransactionManager prepareSvReadAllLogs () CardTransactionManager prepareInvalidate ()CardTransactionManager prepareRehabilitate () CardTransactionManager prepareEarlyMutualAuthentication ()CardTransactionManager prepareActivateEncryption ()CardTransactionManager prepareDeactivateEncryption () CardTransactionManager prepareReleaseCardChannel () CardTransactionManager processCardCommands () CardTransactionManager processVerifyPin (byte[] pin)CardTransactionManager prepareVerifyPin (byte[] pin)CardTransactionManager processChangePin (byte[] newPin)CardTransactionManager prepareChangePin (byte[] newPin) CardTransactionManager processChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc)CardTransactionManager prepareChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc) CardTransactionManager processOpening (WriteAccessLevel writeAccessLevel)CardTransactionManager prepareOpenSecureSession (WriteAccessLevel writeAccessLevel)CardTransactionManager processClosing ()CardTransactionManager prepareCloseSecureSession ()CardTransactionManager processCancel ()CardTransactionManager prepareCancelSecureSession () void initSamContextForNextTransaction ()SvOperationRELOADDEBITSvActionDOUNDOCardSecuritySettingCardSecuritySetting setSamResource (CardReadersamReader, CalypsoSam calypsoSam) CardSecuritySetting enableMultipleSession ()CardSecuritySetting enableRatificationMechanism ()CardSecuritySetting enablePinPlainTransmission ()CardSecuritySetting enableSvLoadAndDebitLog ()CardSecuritySetting authorizeSvNegativeBalance ()CardSecuritySetting disableReadOnSessionOpening () CardSecuritySetting assignKif (WriteAccessLevel writeAccessLevel, byte kvc, byte kif)CardSecuritySetting assignDefaultKif (WriteAccessLevel writeAccessLevel, byte kif)CardSecuritySetting assignDefaultKvc (WriteAccessLevel writeAccessLevel, byte kvc) CardSecuritySetting addAuthorizedSessionKey (byte kif, byte kvc)CardSecuritySetting addAuthorizedSvKey (byte kif, byte kvc) CardSecuritySetting setPinVerificationCipheringKey (byte kif, byte kvc)CardSecuritySetting setPinModificationCipheringKey (byte kif, byte kvc)SearchCommandDataSearchCommandData setSfi (byte sfi)SearchCommandData startAtRecord (int recordNumber)SearchCommandData setOffset (int offset)SearchCommandData enableRepeatedOffset ()SearchCommandData setSearchData (byte[] data)SearchCommandData setMask (byte[] mask)SearchCommandData fetchFirstMatchingResult () List<Integer> getMatchingRecordNumbers ()SamTransactionManagerCardReadergetSamReader ()CalypsoSam getCalypsoSam ()SamSecuritySetting«RuntimeException»SessionBufferOverflowException: Session buffer would overflow for atomic session.UnauthorizedKeyExceptionCardRevokedExceptionSamRevokedExceptionInconsistentDataException: Number of R-APDUs != number of C-APDUsordata read in session != data read outside session.InvalidSignatureException: R-APDU of PSO Verify Signature = 6988.InvalidCardSignatureException: R-APDU of DigestAuthenticate = 6988orR-APDU of SvCheck = 6988.CardSignatureNotVerifiableException: R-APDU of CloseSecureSession = 9000 but SAM is no more available.SelectFileException: R-APDU of SelectFile = 6A82.UnexpectedCommandStatusExceptionReaderIOException: Card reader and/or SAM reader communication is broken.CardIOExceptionSamIOExceptionuseuseprovideuseuseprovideprovideuseuseuseuseuseuseuse and provide up to date contentprovideuseuseprovideprovideprovideuseuseuseprovideprovideprovideprovideprovideuseprovideprovideprovide \ No newline at end of file diff --git a/2.0.0-SNAPSHOT/api_class_diagram.puml b/2.0.0/api_class_diagram.puml similarity index 100% rename from 2.0.0-SNAPSHOT/api_class_diagram.puml rename to 2.0.0/api_class_diagram.puml diff --git a/2.0.0-SNAPSHOT/api_class_diagram.svg b/2.0.0/api_class_diagram.svg similarity index 100% rename from 2.0.0-SNAPSHOT/api_class_diagram.svg rename to 2.0.0/api_class_diagram.svg diff --git a/2.1.0-SNAPSHOT/api_class_diagram.puml b/2.1.0-SNAPSHOT/api_class_diagram.puml new file mode 100644 index 0000000..669ab54 --- /dev/null +++ b/2.1.0-SNAPSHOT/api_class_diagram.puml @@ -0,0 +1,436 @@ +@startuml +title + + + Terminal Calypso Card API 2.1.+ (2023-11-06) +end title + +' == THEME == + +'Couleurs issues de : https://htmlcolorcodes.com/fr/tableau-de-couleur/tableau-de-couleur-design-plat/ +!define C_GREY1 F8F9F9 +!define C_GREY2 F2F3F4 +!define C_GREY3 E5E7E9 +!define C_GREY4 D7DBDD +!define C_GREY5 CACFD2 +!define C_GREY6 BDC3C7 +!define C_LINK 3498DB +!define C_USE 27AE60 +!define C_THROW 2C3E50 + +' -- Styles that don't work with new version of plantuml -- +skinparam stereotypeABorderColor #A9DCDF +skinparam stereotypeIBorderColor #B4A7E5 +skinparam stereotypeCBorderColor #ADD1B2 +skinparam stereotypeEBorderColor #EB93DF +' -- END -- + +skinparam ClassBorderThickness 2 +skinparam ArrowThickness 2 + +' Yellow +skinparam ClassBackgroundColor #FEFECE +skinparam ClassBorderColor #D4AC0D +' Red +skinparam ClassBackgroundColor<> #FDEDEC +skinparam ClassBorderColor<> #E74C3C +hide <> stereotype +' Purple +skinparam ClassBackgroundColor<> #F4ECF7 +skinparam ClassBorderColor<> #8E44AD +hide <> stereotype +' blue +skinparam ClassBackgroundColor<> #EBF5FB +skinparam ClassBorderColor<> #3498DB +hide <> stereotype +' Green +skinparam ClassBackgroundColor<> #E9F7EF +skinparam ClassBorderColor<> #27AE60 +hide <> stereotype +' Grey +skinparam ClassBackgroundColor<> #EAECEE +skinparam ClassBorderColor<> #2C3E50 +hide <> stereotype + +' == CONTENT == + +legend top + __Colors legend__ : + * Work in progress... + * __External public API references__ : + ** **Calypsonet Terminal Reader API** +end legend + +package "calypso.card" as calypsoCard { + ++class "**final** CalypsoCardApiProperties" as ApiProperties <> { + +{static} **final** String VERSION +} ++interface "CalypsoCardApiFactory" as CalypsoCardApiFactory <> { + +CalypsoCardSelectionExtension createCalypsoCardSelectionExtension () + + +SymmetricCryptoSecuritySetting createSymmetricCryptoSecuritySetting (SymmetricCryptoCardTransactionManagerFactory cryptoCardTransactionManagerFactory) + +AsymmetricCryptoSecuritySetting createAsymmetricCryptoSecuritySetting (AsymmetricCryptoCardTransactionManagerFactory cryptoCardTransactionManagerFactory) + + +FreeTransactionManager createFreeTransactionManager (CardReader cardReader, CalypsoCard card) + +SecureRegularModeTransactionManager createSecureRegularModeTransactionManager (CardReader cardReader, CalypsoCard card, SymmetricCryptoSecuritySetting securitySetting) + +SecureExtendedModeTransactionManager createSecureExtendedModeTransactionManager (CardReader cardReader, CalypsoCard card, SymmetricCryptoSecuritySetting securitySetting) + +SecurePkiModeTransactionManager createSecurePkiModeTransactionManager (CardReader cardReader, CalypsoCard card, AsymmetricCryptoSecuritySetting securitySetting) + + +SearchCommandData createSearchCommandData () +} ++enum WriteAccessLevel <> { + PERSONALIZATION + LOAD + DEBIT +} ++enum SelectFileControl <> { + FIRST_EF + NEXT_EF + CURRENT_DF +} ++enum GetDataTag <> { + FCP_FOR_CURRENT_FILE + FCI_FOR_CURRENT_DF + EF_LIST + TRACEABILITY_INFORMATION +} +package "card" as card { + +interface "<<CardSelectionExtension>>\nCalypsoCardSelectionExtension" as CalypsoCardSelectionExtension <> { + +CalypsoCardSelectionExtension acceptInvalidatedCard () + + +CalypsoCardSelectionExtension prepareSelectFile (short lid) + +CalypsoCardSelectionExtension prepareSelectFile (SelectFileControl selectControl) + + +CalypsoCardSelectionExtension prepareGetData (GetDataTag tag) + + +CalypsoCardSelectionExtension prepareReadRecord (byte sfi, int recordNumber) + +CalypsoCardSelectionExtension prepareReadBinary (byte sfi, int offset, int nbBytesToRead) + +CalypsoCardSelectionExtension prepareReadCounter (byte sfi, int nbCountersToRead) + + +CalypsoCardSelectionExtension preparePreOpenSecureSession (WriteAccessLevel writeAccessLevel) + +CalypsoCardSelectionExtension preparePreOpenSecureSessionInPkiMode () + } + +interface "<<IsoSmartCard>>\nCalypsoCard" as CalypsoCard { + +ProductType getProductType () + +boolean isHce () + + +boolean isDfInvalidated () + + +byte[] getDfName () + +byte[] getApplicationSerialNumber () + + +byte[] getStartupInfoRawData () + +byte getPlatform () + +byte getApplicationType () + +byte getApplicationSubtype () + +byte getSoftwareIssuer () + +byte getSoftwareVersion () + +byte getSoftwareRevision () + +byte getSessionModification () + + +byte[] getTraceabilityInformation () + + +DirectoryHeader getDirectoryHeader () + +ElementaryFile getFileBySfi (byte sfi) + +ElementaryFile getFileByLid (short lid) + +Set getFiles () + + +boolean isDfRatified () + +int getTransactionCounter () + + +boolean isPkiModeSupported () + +boolean isExtendedModeSupported () + +boolean isRatificationOnDeselectSupported () + + +boolean isPinFeatureAvailable () + +boolean isPinBlocked () + +int getPinAttemptRemaining () + + +boolean isSvFeatureAvailable () + +int getSvBalance () + +int getSvLastTNum () + +SvLoadLogRecord getSvLoadLogRecord () + +SvDebitLogRecord getSvDebitLogLastRecord () + +List getSvDebitLogAllRecords () + } + +interface DirectoryHeader { + +short getLid () + +Byte getDfStatus () + + +byte[] getAccessConditions () + +byte[] getKeyIndexes () + + +byte getKif (WriteAccessLevel writeAccessLevel) + +byte getKvc (WriteAccessLevel writeAccessLevel) + } + +interface ElementaryFile { + +byte getSfi () + +FileHeader getHeader () + +FileData getData () + } + +interface FileHeader { + +short getLid () + +byte getDfStatus () + +ElementaryFile.Type getEfType () + + +int getRecordsNumber () + +int getRecordSize () + + +byte[] getAccessConditions () + +byte[] getKeyIndexes () + + +Short getSharedReference () + } + +enum "Type" as FileType <> { + LINEAR + BINARY + CYCLIC + COUNTERS + SIMULATED_COUNTERS + } + +interface FileData { + +byte[] getContent () + +byte[] getContent (int numRecord) + +byte[] getContent (int numRecord, int dataOffset, int dataLength) + +SortedMap getAllRecordsContent () + + +Integer getContentAsCounterValue (int numCounter) + +SortedMap getAllCountersValue () + } + +enum "ProductType" as CardProductType <> { + PRIME_REVISION_1 + PRIME_REVISION_2 + PRIME_REVISION_3 + LIGHT + BASIC + UNKNOWN + } + +interface SvLoadLogRecord { + +byte[] getRawData () + + +byte[] getLoadDate () + +byte[] getLoadTime () + + +int getAmount () + +int getBalance () + +byte[] getFreeData () + + +byte getKvc () + +byte[] getSamId () + +int getSamTNum () + +int getSvTNum () + } + +interface SvDebitLogRecord { + +byte[] getRawData () + + +byte[] getDebitDate () + +byte[] getDebitTime () + + +int getAmount () + +int getBalance () + + +byte getKvc () + +byte[] getSamId () + +int getSamTNum () + +int getSvTNum () + } +} +package "transaction" as transaction { + ' Card + +interface "TransactionManager" as TransactionManager> { + +T prepareSelectFile (short lid) + +T prepareSelectFile (SelectFileControl selectFileControl) + + +T prepareGetData (GetDataTag tag) + + +T prepareReadRecord (byte sfi, int recordNumber) + +T prepareReadRecords (byte sfi, int fromRecordNumber, int toRecordNumber, int recordSize) + +T prepareReadRecordsPartially (byte sfi, int fromRecordNumber, int toRecordNumber, int offset, int nbBytesToRead) + +T prepareReadBinary (byte sfi, int offset, int nbBytesToRead) + +T prepareReadCounter (byte sfi, int nbCountersToRead) + + +T prepareSearchRecords (SearchCommandData data) + + +T prepareCheckPinStatus () + + +T prepareAppendRecord (byte sfi, byte[] recordData) + +T prepareUpdateRecord (byte sfi, int recordNumber, byte[] recordData) + +T prepareWriteRecord (byte sfi, int recordNumber, byte[] recordData) + + +T prepareUpdateBinary (byte sfi, int offset, byte[] data) + +T prepareWriteBinary (byte sfi, int offset, byte[] data) + + +T prepareIncreaseCounter (byte sfi, int counterNumber, int incValue) + +T prepareIncreaseCounters (byte sfi, Map counterNumberToIncValueMap) + +T prepareDecreaseCounter (byte sfi, int counterNumber, int decValue) + +T prepareDecreaseCounters (byte sfi, Map counterNumberToDecValueMap) + +T prepareSetCounter (byte sfi, int counterNumber, int newValue) + + +T prepareSvReadAllLogs () + + +T prepareVerifyPin (byte[] pin) + +T prepareChangePin (byte[] newPin) + + +T processCommands (ChannelControl channelControl) + + +List getTransactionAuditData () + } + +enum "ChannelControl" as ChannelControl <> { + KEEP_OPEN + CLOSE_AFTER + } + +interface "FreeTransactionManager" as FreeTransactionManager <> extends TransactionManager { + } + +interface "SecureTransactionManager" as SecureTransactionManager> extends TransactionManager { + + E getCryptoExtension (Class cryptoExtensionClass) + + +T prepareCloseSecureSession () + +T prepareCancelSecureSession () + } + +interface "SecureSymmetricCryptoTransactionManager" as SecureSymmetricCryptoTransactionManager> extends SecureTransactionManager { + +T prepareOpenSecureSession (WriteAccessLevel writeAccessLevel) + + +T prepareSvGet (SvOperation svOperation, SvAction svAction) + +T prepareSvReload (int amount, byte[] date, byte[] time, byte[] free) + +T prepareSvReload (int amount) + +T prepareSvDebit (int amount, byte[] date, byte[] time) + +T prepareSvDebit (int amount) + + +T prepareInvalidate () + +T prepareRehabilitate () + + +T prepareChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc) + } + +interface "SecureRegularModeTransactionManager" as SecureRegularModeTransactionManager <> extends SecureSymmetricCryptoTransactionManager { + } + +interface "SecureExtendedModeTransactionManager" as SecureExtendedModeTransactionManager <> extends SecureSymmetricCryptoTransactionManager { + +SecureExtendedModeTransactionManager prepareEarlyMutualAuthentication () + +SecureExtendedModeTransactionManager prepareActivateEncryption () + +SecureExtendedModeTransactionManager prepareDeactivateEncryption () + } + +interface "SecurePkiModeTransactionManager" as SecurePkiModeTransactionManager <> extends SecureTransactionManager { + +SecurePkiModeTransactionManager prepareOpenSecureSession () + } + + +enum SvOperation <> { + RELOAD + DEBIT + } + +enum SvAction <> { + DO + UNDO + } + together { + +interface "AsymmetricCryptoSecuritySetting" as AsymmetricCryptoSecuritySetting <> { + +AsymmetricCryptoSecuritySetting setAuthorityPublicKey (byte[] publicKey) + +AsymmetricCryptoSecuritySetting setAuthorityCertificate (X509Certificate certificate) + +AsymmetricCryptoSecuritySetting enableUnsignedPublicKeyUsage () + } + +interface "SymmetricCryptoSecuritySetting" as SymmetricCryptoSecuritySetting <> { + +SymmetricCryptoSecuritySetting enableMultipleSession () + +SymmetricCryptoSecuritySetting enableRatificationMechanism () + +SymmetricCryptoSecuritySetting enablePinPlainTransmission () + +SymmetricCryptoSecuritySetting enableSvLoadAndDebitLog () + +SymmetricCryptoSecuritySetting authorizeSvNegativeBalance () + +SymmetricCryptoSecuritySetting disableReadOnSessionOpening () + + +SymmetricCryptoSecuritySetting assignKif (WriteAccessLevel writeAccessLevel, byte kvc, byte kif) + +SymmetricCryptoSecuritySetting assignDefaultKif (WriteAccessLevel writeAccessLevel, byte kif) + +SymmetricCryptoSecuritySetting assignDefaultKvc (WriteAccessLevel writeAccessLevel, byte kvc) + + +SymmetricCryptoSecuritySetting addAuthorizedSessionKey (byte kif, byte kvc) + +SymmetricCryptoSecuritySetting addAuthorizedSvKey (byte kif, byte kvc) + + +SymmetricCryptoSecuritySetting setPinVerificationCipheringKey (byte kif, byte kvc) + +SymmetricCryptoSecuritySetting setPinModificationCipheringKey (byte kif, byte kvc) + + +void initCryptoContextForNextTransaction () + } + } + +interface SearchCommandData <> { + +SearchCommandData setSfi (byte sfi) + +SearchCommandData startAtRecord (int recordNumber) + +SearchCommandData setOffset (int offset) + +SearchCommandData enableRepeatedOffset () + +SearchCommandData setSearchData (byte[] data) + +SearchCommandData setMask (byte[] mask) + +SearchCommandData fetchFirstMatchingResult () + + +List getMatchingRecordNumbers () + } + ' Exceptions + +class "<>" as RuntimeException <> { + +**SessionBufferOverflowException**: Session buffer would overflow for atomic session. + +**UnauthorizedKeyException** + +**InvalidPinException** + +**CardRevokedException** + +**InconsistentDataException**: Number of R-APDUs != number of C-APDUs **or** data read in session != data read outside session. + +**InvalidCardSignatureException** + +**CardSignatureNotVerifiableException**: CloseSecureSession is successful but crypto resource is no more available to check the card MAC. + +**SelectFileException** + +**UnexpectedCommandStatusException** + +**ReaderIOException**: Card reader and/or Crypto reader communication is broken. + +**CardIOException** + +**CryptoException** + +**CryptoIOException** + } + package "spi" as spi { + +interface "AsymmetricCryptoCardTransactionManagerFactory" as AsymmetricCryptoCardTransactionManagerFactory <> { + } + +interface "SymmetricCryptoCardTransactionManagerFactory" as SymmetricCryptoCardTransactionManagerFactory <> { + } + +interface "CardTransactionCryptoExtension" as CardTransactionCryptoExtension <> { + } + } +} + +} + +' Associations + +TransactionManager .up.> SelectFileControl #C_USE : use > +TransactionManager .up.> GetDataTag #C_USE : use > +TransactionManager .left.> ChannelControl #C_USE : use > +TransactionManager .right.> SearchCommandData #C_USE : use > + +SecureTransactionManager .....> CardTransactionCryptoExtension #C_LINK : provide > + +SecureSymmetricCryptoTransactionManager .up.> WriteAccessLevel #C_USE : use > +SecureSymmetricCryptoTransactionManager .left.> SvOperation #C_USE : use > +SecureSymmetricCryptoTransactionManager .left.> SvAction #C_USE : use > + +SymmetricCryptoSecuritySetting .up.> WriteAccessLevel #C_USE : use > + +CalypsoCardSelectionExtension .up.> SelectFileControl #C_USE : use > +CalypsoCardSelectionExtension .up.> GetDataTag #C_USE : use > +CalypsoCardSelectionExtension .up.> WriteAccessLevel #C_USE : use > + +CalypsoCard ..> DirectoryHeader #C_LINK : provide > +CalypsoCard ..> ElementaryFile #C_LINK : provide > +CalypsoCard +-right- CardProductType +CalypsoCard .right.> CardProductType #C_LINK : provide > +CalypsoCard ..> SvLoadLogRecord #C_LINK : provide > +CalypsoCard ..> SvDebitLogRecord #C_LINK : provide > + +DirectoryHeader ..> WriteAccessLevel #C_USE : use > + +ElementaryFile +-- FileType +ElementaryFile ...> FileHeader #C_LINK : provide > +ElementaryFile ...> FileData #C_LINK : provide > + +FileHeader .up.> FileType #C_LINK : provide > + +' == LAYOUT == + +SymmetricCryptoSecuritySetting -[hidden]- AsymmetricCryptoSecuritySetting +AsymmetricCryptoSecuritySetting -[hidden]---- RuntimeException + +' == STYLE == + +package calypsoCard #C_GREY1 {} +package calypsoCard.card #C_GREY2 {} +package calypsoCard.transaction #C_GREY2 {} +package calypsoCard.transaction.spi #C_GREY3 {} + +@enduml \ No newline at end of file diff --git a/2.1.0-SNAPSHOT/api_class_diagram.svg b/2.1.0-SNAPSHOT/api_class_diagram.svg new file mode 100644 index 0000000..aaa310d --- /dev/null +++ b/2.1.0-SNAPSHOT/api_class_diagram.svg @@ -0,0 +1 @@ + Terminal Calypso Card API 2.1.+ (2023-11-06)Colors legend:Work in progress...External public API references:Calypsonet Terminal Reader APIcalypso.cardcardtransactionspifinalCalypsoCardApiPropertiesfinalString VERSIONCalypsoCardApiFactoryCalypsoCardSelectionExtension createCalypsoCardSelectionExtension () SymmetricCryptoSecuritySetting createSymmetricCryptoSecuritySetting (SymmetricCryptoCardTransactionManagerFactory cryptoCardTransactionManagerFactory)AsymmetricCryptoSecuritySetting createAsymmetricCryptoSecuritySetting (AsymmetricCryptoCardTransactionManagerFactory cryptoCardTransactionManagerFactory) FreeTransactionManager createFreeTransactionManager (CardReadercardReader, CalypsoCard card)SecureRegularModeTransactionManager createSecureRegularModeTransactionManager (CardReadercardReader, CalypsoCard card, SymmetricCryptoSecuritySetting securitySetting)SecureExtendedModeTransactionManager createSecureExtendedModeTransactionManager (CardReadercardReader, CalypsoCard card, SymmetricCryptoSecuritySetting securitySetting)SecurePkiModeTransactionManager createSecurePkiModeTransactionManager (CardReadercardReader, CalypsoCard card, AsymmetricCryptoSecuritySetting securitySetting) SearchCommandData createSearchCommandData ()WriteAccessLevelPERSONALIZATIONLOADDEBITSelectFileControlFIRST_EFNEXT_EFCURRENT_DFGetDataTagFCP_FOR_CURRENT_FILEFCI_FOR_CURRENT_DFEF_LISTTRACEABILITY_INFORMATION<<CardSelectionExtension>>CalypsoCardSelectionExtensionCalypsoCardSelectionExtension acceptInvalidatedCard () CalypsoCardSelectionExtension prepareSelectFile (short lid)CalypsoCardSelectionExtension prepareSelectFile (SelectFileControl selectControl) CalypsoCardSelectionExtension prepareGetData (GetDataTag tag) CalypsoCardSelectionExtension prepareReadRecord (byte sfi, int recordNumber)CalypsoCardSelectionExtension prepareReadBinary (byte sfi, int offset, int nbBytesToRead)CalypsoCardSelectionExtension prepareReadCounter (byte sfi, int nbCountersToRead) CalypsoCardSelectionExtension preparePreOpenSecureSession (WriteAccessLevel writeAccessLevel)CalypsoCardSelectionExtension preparePreOpenSecureSessionInPkiMode ()<<IsoSmartCard>>CalypsoCardProductType getProductType ()boolean isHce () boolean isDfInvalidated () byte[] getDfName ()byte[] getApplicationSerialNumber () byte[] getStartupInfoRawData ()byte getPlatform ()byte getApplicationType ()byte getApplicationSubtype ()byte getSoftwareIssuer ()byte getSoftwareVersion ()byte getSoftwareRevision ()byte getSessionModification () byte[] getTraceabilityInformation () DirectoryHeader getDirectoryHeader ()ElementaryFile getFileBySfi (byte sfi)ElementaryFile getFileByLid (short lid)Set<ElementaryFile> getFiles () boolean isDfRatified ()int getTransactionCounter () boolean isPkiModeSupported ()boolean isExtendedModeSupported ()boolean isRatificationOnDeselectSupported () boolean isPinFeatureAvailable ()boolean isPinBlocked ()int getPinAttemptRemaining () boolean isSvFeatureAvailable ()int getSvBalance ()int getSvLastTNum ()SvLoadLogRecord getSvLoadLogRecord ()SvDebitLogRecord getSvDebitLogLastRecord ()List<SvDebitLogRecord> getSvDebitLogAllRecords ()DirectoryHeadershort getLid ()Byte getDfStatus () byte[] getAccessConditions ()byte[] getKeyIndexes () byte getKif (WriteAccessLevel writeAccessLevel)byte getKvc (WriteAccessLevel writeAccessLevel)ElementaryFilebyte getSfi ()FileHeader getHeader ()FileData getData ()FileHeadershort getLid ()byte getDfStatus ()ElementaryFile.Type getEfType () int getRecordsNumber ()int getRecordSize () byte[] getAccessConditions ()byte[] getKeyIndexes () Short getSharedReference ()TypeLINEARBINARYCYCLICCOUNTERSSIMULATED_COUNTERSFileDatabyte[] getContent ()byte[] getContent (int numRecord)byte[] getContent (int numRecord, int dataOffset, int dataLength)SortedMap<Integer, byte[]> getAllRecordsContent () Integer getContentAsCounterValue (int numCounter)SortedMap<Integer, Integer> getAllCountersValue ()ProductTypePRIME_REVISION_1PRIME_REVISION_2PRIME_REVISION_3LIGHTBASICUNKNOWNSvLoadLogRecordbyte[] getRawData () byte[] getLoadDate ()byte[] getLoadTime () int getAmount ()int getBalance ()byte[] getFreeData () byte getKvc ()byte[] getSamId ()int getSamTNum ()int getSvTNum ()SvDebitLogRecordbyte[] getRawData () byte[] getDebitDate ()byte[] getDebitTime () int getAmount ()int getBalance () byte getKvc ()byte[] getSamId ()int getSamTNum ()int getSvTNum ()TransactionManagerT extends TransactionManager<T>T prepareSelectFile (short lid)T prepareSelectFile (SelectFileControl selectFileControl) T prepareGetData (GetDataTag tag) T prepareReadRecord (byte sfi, int recordNumber)T prepareReadRecords (byte sfi, int fromRecordNumber, int toRecordNumber, int recordSize)T prepareReadRecordsPartially (byte sfi, int fromRecordNumber, int toRecordNumber, int offset, int nbBytesToRead)T prepareReadBinary (byte sfi, int offset, int nbBytesToRead)T prepareReadCounter (byte sfi, int nbCountersToRead) T prepareSearchRecords (SearchCommandData data) T prepareCheckPinStatus () T prepareAppendRecord (byte sfi, byte[] recordData)T prepareUpdateRecord (byte sfi, int recordNumber, byte[] recordData)T prepareWriteRecord (byte sfi, int recordNumber, byte[] recordData) T prepareUpdateBinary (byte sfi, int offset, byte[] data)T prepareWriteBinary (byte sfi, int offset, byte[] data) T prepareIncreaseCounter (byte sfi, int counterNumber, int incValue)T prepareIncreaseCounters (byte sfi, Map<Integer, Integer> counterNumberToIncValueMap)T prepareDecreaseCounter (byte sfi, int counterNumber, int decValue)T prepareDecreaseCounters (byte sfi, Map<Integer, Integer> counterNumberToDecValueMap)T prepareSetCounter (byte sfi, int counterNumber, int newValue) T prepareSvReadAllLogs () T prepareVerifyPin (byte[] pin)T prepareChangePin (byte[] newPin) T processCommands (ChannelControl channelControl) List<byte[]> getTransactionAuditData ()ChannelControlKEEP_OPENCLOSE_AFTERFreeTransactionManagerSecureTransactionManagerT extends SecureTransactionManager<T><E extends CardTransactionCryptoExtension> E getCryptoExtension (Class<E> cryptoExtensionClass) T prepareCloseSecureSession ()T prepareCancelSecureSession ()SecureSymmetricCryptoTransactionManagerT extends SecureSymmetricCryptoTransactionManager<T>T prepareOpenSecureSession (WriteAccessLevel writeAccessLevel) T prepareSvGet (SvOperation svOperation, SvAction svAction)T prepareSvReload (int amount, byte[] date, byte[] time, byte[] free)T prepareSvReload (int amount)T prepareSvDebit (int amount, byte[] date, byte[] time)T prepareSvDebit (int amount) T prepareInvalidate ()T prepareRehabilitate () T prepareChangeKey (int keyIndex, byte newKif, byte newKvc, byte issuerKif, byte issuerKvc)SecureRegularModeTransactionManagerSecureExtendedModeTransactionManagerSecureExtendedModeTransactionManager prepareEarlyMutualAuthentication ()SecureExtendedModeTransactionManager prepareActivateEncryption ()SecureExtendedModeTransactionManager prepareDeactivateEncryption ()SecurePkiModeTransactionManagerSecurePkiModeTransactionManager prepareOpenSecureSession ()SvOperationRELOADDEBITSvActionDOUNDOAsymmetricCryptoSecuritySettingAsymmetricCryptoSecuritySetting setAuthorityPublicKey (byte[] publicKey)AsymmetricCryptoSecuritySetting setAuthorityCertificate (X509Certificate certificate)AsymmetricCryptoSecuritySetting enableUnsignedPublicKeyUsage ()SymmetricCryptoSecuritySettingSymmetricCryptoSecuritySetting enableMultipleSession ()SymmetricCryptoSecuritySetting enableRatificationMechanism ()SymmetricCryptoSecuritySetting enablePinPlainTransmission ()SymmetricCryptoSecuritySetting enableSvLoadAndDebitLog ()SymmetricCryptoSecuritySetting authorizeSvNegativeBalance ()SymmetricCryptoSecuritySetting disableReadOnSessionOpening () SymmetricCryptoSecuritySetting assignKif (WriteAccessLevel writeAccessLevel, byte kvc, byte kif)SymmetricCryptoSecuritySetting assignDefaultKif (WriteAccessLevel writeAccessLevel, byte kif)SymmetricCryptoSecuritySetting assignDefaultKvc (WriteAccessLevel writeAccessLevel, byte kvc) SymmetricCryptoSecuritySetting addAuthorizedSessionKey (byte kif, byte kvc)SymmetricCryptoSecuritySetting addAuthorizedSvKey (byte kif, byte kvc) SymmetricCryptoSecuritySetting setPinVerificationCipheringKey (byte kif, byte kvc)SymmetricCryptoSecuritySetting setPinModificationCipheringKey (byte kif, byte kvc) void initCryptoContextForNextTransaction ()SearchCommandDataSearchCommandData setSfi (byte sfi)SearchCommandData startAtRecord (int recordNumber)SearchCommandData setOffset (int offset)SearchCommandData enableRepeatedOffset ()SearchCommandData setSearchData (byte[] data)SearchCommandData setMask (byte[] mask)SearchCommandData fetchFirstMatchingResult () List<Integer> getMatchingRecordNumbers ()«RuntimeException»SessionBufferOverflowException: Session buffer would overflow for atomic session.UnauthorizedKeyExceptionInvalidPinExceptionCardRevokedExceptionInconsistentDataException: Number of R-APDUs != number of C-APDUsordata read in session != data read outside session.InvalidCardSignatureExceptionCardSignatureNotVerifiableException: CloseSecureSession is successful but crypto resource is no more available to check the card MAC.SelectFileExceptionUnexpectedCommandStatusExceptionReaderIOException: Card reader and/or Crypto reader communication is broken.CardIOExceptionCryptoExceptionCryptoIOExceptionAsymmetricCryptoCardTransactionManagerFactorySymmetricCryptoCardTransactionManagerFactoryCardTransactionCryptoExtensionuseuseuseuseprovideuseuseuseuseuseuseuseprovideprovideprovideprovideprovideuseprovideprovideprovide \ No newline at end of file