**javacard.framework.service** ====Interface SecurityService ==== **All Superinterfaces:** [[javacard:java-card-api:Service|Service]] ---- *[[javacard:java-card-api:service|Service]] \\ This interface describes the functions of a generic security service. It extends the base Service interface and defines methods to query the current security status. Note that this interface is generic and does not include methods to initialize and change the security status of the service; initialization is assumed to be performed through APDU commands that the service is able to process. A security service implementation class should extend BasicService and implement this interface. **Version:** 1.0 ---- ^ Field Summary ^^ | **static short** | **[[javacard:java-card-api:SecurityService#PRINCIPAL_APP_PROVIDER|PRINCIPAL_APP_PROVIDER]] **          The principal identifier for the application provider. | | **static short** | **[[javacard:java-card-api:SecurityService#PRINCIPAL_CARD_ISSUER|PRINCIPAL_CARD_ISSUER]] **          The principal identifier for the card issuer. | | **static short** | **[[javacard:java-card-api:SecurityService#PRINCIPAL_CARDHOLDER|PRINCIPAL_CARDHOLDER]] **          The principal identifier for the cardholder. | | **static byte** | **[[javacard:java-card-api:SecurityService#PROPERTY_INPUT_CONFIDENTIALITY|PROPERTY_INPUT_CONFIDENTIALITY]] **          This security property provides input confidentiality through encryption of the incoming command. | | **static byte** | **[[javacard:java-card-api:SecurityService#PROPERTY_INPUT_INTEGRITY|PROPERTY_INPUT_INTEGRITY]] **          This security property provides input integrity through MAC signature checking of the incoming command. | | **static byte** | **[[javacard:java-card-api:SecurityService#PROPERTY_OUTPUT_CONFIDENTIALITY|PROPERTY_OUTPUT_CONFIDENTIALITY]] **          This security property provides output confidentiality through encryption of the outgoing response. | | **static byte** | **[[javacard:java-card-api:SecurityService#PROPERTY_OUTPUT_INTEGRITY|PROPERTY_OUTPUT_INTEGRITY]] **          This security property provides output integrity through MAC signature generation for the outgoing response. |   ^ Method Summary ^^ | ** boolean** | **[[javacard:java-card-api:SecurityService#isAuthenticated(short)|isAuthenticated]] **(short principal)          Checks whether or not the specified principal is currently authenticated. | | ** boolean** | **[[javacard:java-card-api:SecurityService#isChannelSecure(byte)|isChannelSecure]] **(byte properties)          Checks whether a secure channel is established between the card and the host for the ongoing session that guarantees the indicated properties. | | ** boolean** | **[[javacard:java-card-api:SecurityService#isCommandSecure(byte)|isCommandSecure]] **(byte properties)          Checks whether a secure channel is in use between the card and the host for the ongoing command that guarantees the indicated properties. |   ^ Methods inherited from interface javacard.framework.service.Service ^ | [[javacard:java-card-api:Service#processCommand(javacard.framework.APDU)|processCommand]] , [[javacard:java-card-api:Service#processDataIn(javacard.framework.APDU)|processDataIn]] , [[javacard:java-card-api:Service#processDataOut(javacard.framework.APDU)|processDataOut]] |   ^ Field Detail ^ === PROPERTY_INPUT_CONFIDENTIALITY === static final byte **PROPERTY_INPUT_CONFIDENTIALITY** This security property provides input confidentiality through encryption of the incoming command. Note that this is a bit mask and security properties can be combined by simply adding them together. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PROPERTY_INPUT_CONFIDENTIALITY|Constant Field Values]] ---- === PROPERTY_INPUT_INTEGRITY === static final byte **PROPERTY_INPUT_INTEGRITY** This security property provides input integrity through MAC signature checking of the incoming command. Note that this is a bit mask and security properties can be combined by simply adding them together. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PROPERTY_INPUT_INTEGRITY|Constant Field Values]] ---- === PROPERTY_OUTPUT_CONFIDENTIALITY === static final byte **PROPERTY_OUTPUT_CONFIDENTIALITY** This security property provides output confidentiality through encryption of the outgoing response. Note that this is a bit mask and security properties can be combined by simply adding them together. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PROPERTY_OUTPUT_CONFIDENTIALITY|Constant Field Values]] ---- === PROPERTY_OUTPUT_INTEGRITY === static final byte **PROPERTY_OUTPUT_INTEGRITY** This security property provides output integrity through MAC signature generation for the outgoing response. Note that this is a bit mask and security properties can be combined by simply adding them together. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PROPERTY_OUTPUT_INTEGRITY|Constant Field Values]] ---- === PRINCIPAL_CARDHOLDER === static final short **PRINCIPAL_CARDHOLDER** The principal identifier for the cardholder. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PRINCIPAL_CARDHOLDER|Constant Field Values]] ---- === PRINCIPAL_CARD_ISSUER === static final short **PRINCIPAL_CARD_ISSUER** The principal identifier for the card issuer. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PRINCIPAL_CARD_ISSUER|Constant Field Values]] ---- === PRINCIPAL_APP_PROVIDER === static final short **PRINCIPAL_APP_PROVIDER** The principal identifier for the application provider. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.SecurityService.PRINCIPAL_APP_PROVIDER|Constant Field Values]] ^ Method Detail ^ === isAuthenticated === boolean **isAuthenticated**(short principal) throws [[javacard:java-card-api:ServiceException|ServiceException]] Checks whether or not the specified principal is currently authenticated. The validity timeframe (selection or reset) and authentication method as well as the exact interpretation of the specified principal parameter needs to be detailed by the implementation class. The only generic guarantee is that the authentication has been performed in the current card session. **Parameters:**principal - an identifier of the principal that needs to be authenticated **Returns:**true if the expected principal is authenticated **Throws:** [[javacard:java-card-api:ServiceException|ServiceException]] - with the following reason code: \\ *ServiceException.ILLEGAL_PARAM if the specified principal is unknown. \\ ---- === isChannelSecure === boolean **isChannelSecure**(byte properties) throws [[javacard:java-card-api:ServiceException|ServiceException]] Checks whether a secure channel is established between the card and the host for the ongoing session that guarantees the indicated properties. **Parameters:**properties - the required properties **Returns:**true if the required properties are true, false otherwise **Throws:** [[javacard:java-card-api:ServiceException|ServiceException]] - with the following reason code: \\ *ServiceException.ILLEGAL_PARAM if the specified property is unknown. \\ ---- === isCommandSecure === boolean **isCommandSecure**(byte properties) throws [[javacard:java-card-api:ServiceException|ServiceException]] Checks whether a secure channel is in use between the card and the host for the ongoing command that guarantees the indicated properties. The result is only correct after pre-processing the command (for instance during the processing of the command). For properties on incoming data, the result is guaranteed to be correct; for outgoing data, the result reflects the expectations of the client software, with no other guarantee. **Parameters:**properties - the required properties **Returns:**true if the required properties are true, false otherwise **Throws:** [[javacard:java-card-api:ServiceException|ServiceException]] - with the following reason code: \\ *ServiceException.ILLEGAL_PARAM if the specified property is unknown. \\