{"swagger":"2.0","info":{"description":"HsmProxy communication service.\n\nProvides an HSM interface to enable: \n- SAM provisioning \n- activate SAM and set mode of operation \n- get SAM key (key delivery) \n- SAM authentication \n- SAM CAP upgrade\n\nDuring a SAM lifetime each SAM should be provision at least once and that should be the first action for it. After provisioning the SAM is to be activated. At that time its operation mode will also be set dependent on the device type and purpose. \nOnce the SAM is activated it will be valid for day to day operation. On each wake up or power on event it should get its key from HSM and start authentication against HSM & AFC. \nThe next step is SAM authentication against the HSM to verify that the SAM is still valid for operation.","version":"v2","title":" "},"host":"10.10.171.1","basePath":"/afcu/rest/","tags":[{"name":"HsmProxyService"}],"schemes":["http","https"],"paths":{"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/auth/{sessionId}":{"get":{"tags":["HsmProxyService"],"summary":"Start authentication session","description":"Starts a new authentication session. This ensures that the SAM is valid and authenticated against HSM. Should be performed on every power up and after a predefined number of transactions. Uses APDU message exchange.","operationId":"authStart","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Composed of 4 bytes SAM ID and 8 bytes of random data","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}},"post":{"tags":["HsmProxyService"],"summary":"Continue authentication session","description":"Continues an authentication session.","operationId":"authContinue","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Same sessionId as used when starting authentication using the GET method","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/XferData"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/key/{sessionId}":{"get":{"tags":["HsmProxyService"],"summary":"Get SAM access key","description":"Gets key for SAM access. Device and SAM are checked for validity and the key is delivered in a secure manner using an APDU message.","operationId":"getKey","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"composed of 4 bytes SAM ID and 8 bytes of random data","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/provision/{sessionId}":{"get":{"tags":["HsmProxyService"],"summary":"Start provisioning session","description":"Starts a new provisioning session. This should be the first interaction with HsmProxy when the SAM is installed on the device. This starts the process of loading CAPs and keys onto the SAM using APDU message exchange.","operationId":"provisionStart","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Random session id. 12 bytes in hexadecimal notation.","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}},"post":{"tags":["HsmProxyService"],"summary":"Continue provisioning session","description":"Continues a previously started provisioning session using APDU message exchange.","operationId":"provisionContinue","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Same sessionId as used when starting provisioning using the GET method","required":true,"type":"string"},{"in":"body","name":"data","description":"APDU ","required":true,"schema":{"$ref":"#/definitions/XferData"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/upgrade/{sessionId}":{"get":{"tags":["HsmProxyService"],"summary":"Start upgrade session","description":"Starts applet and key upgrade session. Verifies current SAM applets and keys. After verification applets and keys are updated using APDU message exchange.","operationId":"upgradeStart","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Composed of 4 bytes SAM ID and 8 bytes of random data","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}},"post":{"tags":["HsmProxyService"],"summary":"Continue upgrade session","description":"Continues SAM upgrade session","operationId":"upgradeContinue","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","description":"Same sessionId as used when starting authentication using the GET method","required":true,"type":"string"},{"in":"body","name":"body","required":false,"schema":{"$ref":"#/definitions/XferData"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/{samId}":{"get":{"tags":["HsmProxyService"],"summary":"Get SAM information","description":"Gets detailed SAM information from HSM","operationId":"samInfo","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"samId","in":"path","description":"SAM ID as defined by HSM.","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Sam"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/{samId}/activate":{"put":{"tags":["HsmProxyService"],"summary":"Activate the SAM in device dependent mode","description":"Activates the SAM in device type dependent mode. SAM (and containing device) should be functional after this. SAM operation mode can be observed in the SAM information object in the response.","operationId":"activate","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"samId","in":"path","description":"SAM ID as defined by HSM.","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Sam"}}}}},"/afc/integration/hsm-proxy/v1/sam/{deviceType}/{deviceId}/{samId}/status":{"get":{"tags":["HsmProxyService"],"summary":"Get SAM status","description":"Gets SAM status from HSM","operationId":"samStatus","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"deviceType","in":"path","description":"Device type as defined for device by AFC system. (eg. POS, VAL, ...)","required":true,"type":"string"},{"name":"deviceId","in":"path","required":true,"type":"string"},{"name":"samId","in":"path","description":"SAM ID as defined by HSM.","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/XferData"}}}}}},"definitions":{"AfcSam":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"samId":{"$ref":"#/definitions/OptionString"},"provisioningSessionId":{"type":"string"},"provisioningAttemptsCount":{"type":"integer","format":"int32"},"provisioningStartTimestamp":{"type":"string","format":"date-time"},"provisioningStatus":{"$ref":"#/definitions/OptionString"},"provisioningFinishTimestamp":{"$ref":"#/definitions/OptionDateTime"},"activationTimestamp":{"$ref":"#/definitions/OptionDateTime"},"operationMode":{"$ref":"#/definitions/OptionSamOperationModeEnum"},"keyDeliverySessionId":{"$ref":"#/definitions/OptionString"},"keyDeliveryTimestamp":{"$ref":"#/definitions/OptionDateTime"},"keyDeliveryStatus":{"$ref":"#/definitions/OptionString"},"lastAuthenticationTimestamp":{"$ref":"#/definitions/OptionDateTime"},"lastAuthenticationStartTimestamp":{"$ref":"#/definitions/OptionDateTime"},"lastAuthenticationFailTimestamp":{"$ref":"#/definitions/OptionDateTime"},"authenticationAttemptCount":{"type":"integer","format":"int32"},"lastAuthenticationSessionId":{"$ref":"#/definitions/OptionString"},"lastAuthenticationStatus":{"$ref":"#/definitions/OptionString"},"lastUpgradeTimestamp":{"$ref":"#/definitions/OptionDateTime"},"lastUpgradeSessionId":{"$ref":"#/definitions/OptionString"},"lastUpgradeStartTimestamp":{"$ref":"#/definitions/OptionDateTime"},"lastUpgradeFailTimestamp":{"$ref":"#/definitions/OptionDateTime"},"lastUpgradeStatus":{"$ref":"#/definitions/OptionString"},"upgradeAttemptCount":{"type":"integer","format":"int32"}}},"AppUser":{"type":"object","properties":{"isActive":{"type":"boolean"},"firstName":{"type":"string","minLength":1,"maxLength":255},"lastName":{"type":"string"},"username":{"type":"string"},"passwordLastChangedAt":{"type":"string","format":"date-time"},"lastLoginAt":{"type":"string","format":"date-time"},"email":{"type":"string"},"locked":{"type":"boolean"},"lockedAt":{"type":"string","format":"date-time"},"invited":{"type":"boolean"},"phoneNumber":{"type":"string"},"mobilePhoneNumber":{"type":"string"},"referenceNumber":{"type":"string"},"failedLogins":{"type":"integer","format":"int32"},"otp":{"type":"string"},"otpGeneratedAt":{"type":"string","format":"date-time"},"failedOtpLogins":{"type":"integer","format":"int32"}}},"Cap":{"type":"object","properties":{"capStatus":{"type":"string","enum":["NONE","ENABLE","DISABLED"]},"capType":{"type":"string","enum":["KEYAPP_APPLET","CEPOLIT_APPLET","KENKART_APPLET"]},"data":{"type":"string"},"id":{"type":"integer","format":"int64"},"samType":{"type":"string","enum":["P60","P71"]},"sha1":{"type":"string"},"version":{"type":"integer","format":"int32"}}},"MtmHeartbeatDetailsDto":{"type":"object","properties":{"mode":{"type":"string","enum":["Inspection","PosBackup","TicketingMachine"]}}},"Option":{"type":"object","properties":{"singleValued":{"type":"boolean"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"empty":{"type":"boolean"},"defined":{"type":"boolean"},"orNull":{"type":"object"}}},"OptionDateTime":{"type":"object","properties":{"singleValued":{"type":"boolean"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"empty":{"type":"boolean"},"defined":{"type":"boolean"},"orNull":{"type":"string","format":"date-time"}}},"OptionSamOperationModeEnum":{"type":"object","properties":{"singleValued":{"type":"boolean"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"empty":{"type":"boolean"},"defined":{"type":"boolean"},"orNull":{"type":"string","enum":["NONE","INITIALIZATION","PERSONALIZATION","POS","LIMITED_POS","RFU_1","RFU_2","RFU_3","RFU_4"]}}},"OptionString":{"type":"object","properties":{"singleValued":{"type":"boolean"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"empty":{"type":"boolean"},"defined":{"type":"boolean"},"orNull":{"type":"string"}}},"ResGroup":{"type":"object","required":["name"],"properties":{"id":{"type":"integer","format":"int32"},"isActive":{"type":"boolean"},"name":{"type":"string"},"referenceNumber":{"type":"string"},"active":{"type":"boolean"}}},"ResGroupItem":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"isActive":{"type":"boolean"},"group":{"$ref":"#/definitions/ResGroup"},"name":{"type":"string"},"referenceNumber":{"type":"string"},"sortOrder":{"type":"integer","format":"int32"},"active":{"type":"boolean"}}},"Sam":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"samGroup":{"$ref":"#/definitions/SamGroup"},"samID":{"type":"string"},"samOperationMode":{"type":"string","enum":["NONE","INITIALIZATION","PERSONALIZATION","POS","LIMITED_POS","RFU_1","RFU_2","RFU_3","RFU_4"]},"samStatus":{"type":"string","enum":["NONE","INITIALIZED","PERSONALIZED","ACTIVE","BLOCKED"]},"samType":{"type":"string","enum":["P60","P71"]},"updateCepolit":{"type":"string","format":"date-time"},"updateKenkart":{"type":"string","format":"date-time"},"updateKeyapp":{"type":"string","format":"date-time"},"versionCepolit":{"$ref":"#/definitions/Cap"},"versionKenkart":{"$ref":"#/definitions/Cap"},"versionKeyApp":{"$ref":"#/definitions/Cap"}}},"SamGroup":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"samGroupName":{"type":"string"},"versionCepolit":{"$ref":"#/definitions/Cap"},"versionKenkart":{"$ref":"#/definitions/Cap"},"versionKeyApp":{"$ref":"#/definitions/Cap"}}},"SamStatusData":{"type":"object","properties":{"currentCepolitVersion":{"type":"integer","format":"int32","description":"Current version of the Cepolit App"},"currentKentKartVersion":{"type":"integer","format":"int32","description":"Current version of the KentKart App"},"currentKeyAppVersion":{"type":"integer","format":"int32","description":"Current version of the KeyApp"},"id":{"type":"integer","format":"int64"},"mode":{"type":"string","description":"Contains SAM operation mode (PERSONALIZATION/POS/etc.)","enum":["NONE","INITIALIZATION","PERSONALIZATION","POS","LIMITED_POS","RFU_1","RFU_2","RFU_3","RFU_4"]},"samId":{"type":"string","description":"Contains SAM id"},"status":{"type":"string","description":"Contains SAM status","enum":["NONE","INITIALIZED","PERSONALIZED","ACTIVE","BLOCKED"]},"type":{"type":"string","description":"Contains SAM type (P60/P71)","enum":["P60","P71"]},"upgradeCepolitNeeded":{"type":"boolean","description":"Is upgrade of the Cepolit App needed?"},"upgradeKentKartNeeded":{"type":"boolean","description":"Is upgrade of the KentKart App needed?"}},"description":"SAM status data object"},"Set":{"type":"object","properties":{"distinct":{"type":"boolean"},"singleValued":{"type":"boolean"},"ordered":{"type":"boolean"},"sequential":{"type":"boolean"},"traversableAgain":{"type":"boolean"},"empty":{"type":"boolean"},"orNull":{"type":"object"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"memoized":{"type":"boolean"}}},"SetResGroupItem":{"type":"object","properties":{"distinct":{"type":"boolean"},"singleValued":{"type":"boolean"},"ordered":{"type":"boolean"},"sequential":{"type":"boolean"},"traversableAgain":{"type":"boolean"},"empty":{"type":"boolean"},"orNull":{"$ref":"#/definitions/ResGroupItem"},"async":{"type":"boolean"},"lazy":{"type":"boolean"},"memoized":{"type":"boolean"}}},"XferData":{"type":"object","properties":{"data":{"type":"string","description":"Contains data - usualy HEX encoded"},"dataType":{"type":"integer","format":"int32","description":"Explains what kind of data is stored in data filed"},"id":{"type":"integer","format":"int64"},"samStatusData":{"description":"Contains SAM status data if relevant","$ref":"#/definitions/SamStatusData"},"status":{"type":"integer","format":"int32","description":"Contains status of the operation"}},"description":"Data Exchange Object"}}}