public class KgssServiceImpl extends Object implements KgssService, ConfigurationModuleBootstrap.ModuleBootstrapHook
KgssService| Modifier and Type | Field and Description |
|---|---|
static String |
EHEALTH_SUCCESS_CODE_100
The eHealth success codes.
|
static String |
EHEALTH_SUCCESS_CODE_200
The eHealth success codes.
|
| Constructor and Description |
|---|
KgssServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
bootstrap() |
static boolean |
checkReplyStatus(String responseCode)
Check reply status of the web service call, return true when OK.
|
KeyResult |
getKey(GetKeyRequestContent request,
byte[] etkKGSS,
SessionItemView session)
Retrieves an existing key from the KGSS using the credentials contained in the given session.
|
GetKeyResponseContent |
getKey(GetKeyRequestContent request,
Credential encryption,
Credential service,
Element samlAssertion,
Map<String,PrivateKey> decryptionKeys,
byte[] etkKGSS)
Retrieves an existing key from the KGSS using explicit credentials and a raw SAML assertion.
|
GetKeyResponseContent |
getKey(GetKeyRequestContent request,
SAMLTokenContainer container,
KgssMessageBuilder builder)
Retrieves an existing key from the KGSS using a
SessionItemView and a
caller-supplied KgssMessageBuilder. |
GetKeyResponseContent |
getKey(GetKeyRequestContent request,
SAMLToken token,
KgssMessageBuilder builder)
Retrieves an existing key from the KGSS using a pre-built
SAMLToken and a
caller-supplied KgssMessageBuilder. |
KeyResult |
getNewKey(GetNewKeyRequestContent request,
byte[] kgssETK)
Convenience method that asks the KGSS to generate and store a new key using the current
Session. |
GetNewKeyResponseContent |
getNewKey(GetNewKeyRequestContent request,
Credential encryption,
Map<String,PrivateKey> decryptionKeys,
byte[] etkKGSS)
Asks the KGSS to generate and store a new key, returning the full response content.
|
public static final String EHEALTH_SUCCESS_CODE_100
public static final String EHEALTH_SUCCESS_CODE_200
public KeyResult getNewKey(GetNewKeyRequestContent request, byte[] kgssETK) throws TechnicalConnectorException
KgssServiceSession.
Encryption and decryption credentials are resolved automatically from the active session.
Use KgssService.getNewKey(GetNewKeyRequestContent, Credential, Map, byte[]) when you need
explicit control over those credentials.
getNewKey in interface KgssServicerequest - the business content describing the key to generate; must not be null.kgssETK - the End-To-End encryption key (ETK) of the KGSS, as retrieved from the
Key Depot getETK operation; must not be null.KeyResult containing the generated SecretKey and
its Base64-encoded identifier.TechnicalConnectorException - if the web service call fails, the response status is
not a success code, or decryption of the response fails.public GetNewKeyResponseContent getNewKey(GetNewKeyRequestContent request, Credential encryption, Map<String,PrivateKey> decryptionKeys, byte[] etkKGSS) throws TechnicalConnectorException
KgssServiceThe following steps are executed internally:
GetNewKeyRequestContent using the ETEE addressed-message
approach with the provided KGSS ETK.getNewKey web service operation.GetNewKeyResponseContent using the provided decryption keys.getNewKey in interface KgssServicerequest - the business content describing the key to generate; must not be null.encryption - the credential used to seal the request — the certificate seals
the payload and the private key is embedded in the request;
must not be null.decryptionKeys - the private keys available for unsealing the KGSS response,
keyed by their identifier. Retrieve these from your KeyStore
using the ETEE tooling; must not be null or empty.etkKGSS - the ETK of the KGSS, as retrieved from the Key Depot getETK
operation; must not be null.GetNewKeyResponseContent, including the generated key and
its identifier.TechnicalConnectorException - if sealing, the web service call, or unsealing fails,
or if the response contains error messages.public KeyResult getKey(GetKeyRequestContent request, byte[] etkKGSS, SessionItemView session) throws TechnicalConnectorException
KgssServiceThe session provides the encryption credential, decryption keys, and SAML token required
to authenticate and process the request. Use
KgssService.getKey(GetKeyRequestContent, Credential, Credential, Element, Map, byte[]) when
you need explicit control over those values.
getKey in interface KgssServicerequest - the business content identifying the key to retrieve, including its
identifier; must not be null.etkKGSS - the ETK of the KGSS, as retrieved from the Key Depot getETK
operation; must not be null.session - the active session supplying encryption credentials, decryption keys,
and a SAML token; must not be null.KeyResult containing the retrieved SecretKey and
its identifier.TechnicalConnectorException - if the web service call fails or the response cannot
be decrypted.public GetKeyResponseContent getKey(GetKeyRequestContent request, Credential encryption, Credential service, Element samlAssertion, Map<String,PrivateKey> decryptionKeys, byte[] etkKGSS) throws TechnicalConnectorException
KgssServiceThe following steps are executed internally:
samlAssertion and serviceCredential in a SAMLToken.GetKeyRequestContent using the ETEE addressed-message
approach with the provided KGSS ETK.getKey web service operation.GetKeyResponseContent using the provided decryption keys.getKey in interface KgssServicerequest - the business content identifying the key to retrieve; must not be null.encryption - the credential used to seal the request — the certificate seals the
payload and the private key is embedded in the request;
must not be null.service - the credential combined with the SAML assertion to authenticate
the web service call; must not be null.samlAssertion - the SAML assertion obtained from STS to authenticate the request;
must not be null.decryptionKeys - the private keys available for unsealing the KGSS response,
keyed by their identifier; must not be null or empty.etkKGSS - the ETK of the KGSS, as retrieved from the Key Depot getETK
operation; must not be null.GetKeyResponseContent containing the requested key.TechnicalConnectorException - if sealing, the web service call, or unsealing fails,
or if the response contains error messages.public GetKeyResponseContent getKey(GetKeyRequestContent request, SAMLToken token, KgssMessageBuilder builder) throws TechnicalConnectorException
KgssServiceSAMLToken and a
caller-supplied KgssMessageBuilder.
Use this method when you have already constructed the SAML token and message builder, for example in scenarios where they are reused across multiple calls.
getKey in interface KgssServicerequest - the business content identifying the key to retrieve; must not be null.token - the SAML token used to authenticate the web service call; must not be null.builder - the message builder responsible for sealing the request and unsealing the
response; must not be null.GetKeyResponseContent containing the requested key.TechnicalConnectorException - if the web service call fails or the response cannot
be decrypted.public GetKeyResponseContent getKey(GetKeyRequestContent request, SAMLTokenContainer container, KgssMessageBuilder builder) throws TechnicalConnectorException
KgssServiceSessionItemView and a
caller-supplied KgssMessageBuilder.
The session view provides the SAML token container used to authenticate the web service
call, while the builder handles sealing and unsealing of the message payload. This overload
is useful when a lightweight session view is available instead of a full SessionItem.
getKey in interface KgssServicerequest - the business content identifying the key to retrieve; must not be null.container - the session view supplying the SAML token container; must not be null.builder - the message builder responsible for sealing the request and unsealing the
response; must not be null.GetKeyResponseContent containing the requested key.TechnicalConnectorException - if the web service call fails or the response cannot
be decrypted.public static boolean checkReplyStatus(String responseCode) throws TechnicalConnectorException
responseCode - the response codeTechnicalConnectorException - the technical connector exceptionpublic void bootstrap()
bootstrap in interface ConfigurationModuleBootstrap.ModuleBootstrapHook
Connector Packaging PERSPHYSICIAN 4.9.5 API
Copyright © {inceptionYear}-2026 eHealth. All Rights Reserved.