Class IdinSender

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

public class IdinSender extends AbstractSenderWithParameters implements HasPhysicalDestination
Requires the net.bankid.merchant.library V1.2.9
Author:
Niels Meijer
  • Constructor Details

    • IdinSender

      public IdinSender()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractSenderWithParameters
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • createConfiguration

      protected net.bankid.merchant.library.Configuration createConfiguration() throws ConfigurationException
      Throws:
      ConfigurationException
    • createCommunicator

      protected net.bankid.merchant.library.Communicator createCommunicator(PipeLineSession session) throws SenderException
      Throws:
      SenderException
    • sendMessage

      @Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException
      Description copied from interface: ISender
      Send a message to some destination (as configured in the Sender object). This method may only be called after the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      ISender.isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould not be expected

      Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or synchronized.

      Specified by:
      sendMessage in interface ISender
      Throws:
      SenderException
    • getPhysicalDestinationName

      public String getPhysicalDestinationName()
      Specified by:
      getPhysicalDestinationName in interface HasPhysicalDestination
    • setAction

      public void setAction(IdinSender.Action action)
      Parameters:
      action - for the sender to execute, has to be one of "DIRECTORY", "RESPONSE" or "AUTHENTICATE".
    • setMerchantID

      public void setMerchantID(String merchantMerchantID)
      This is the contract number for iDIN the Merchant received from its Acquirer after registration, and is used to unambiguously identify the Merchant. This number is 10-digits long, where the first four digits are equal to the AcquirerID.
      Parameters:
      merchantMerchantID - The contract number for the iDIN Merchant. Leading zeros must be included
    • setMerchantSubID

      public void setMerchantSubID(int merchantSubID)
      The SubID that uniquely defines the name and address of the Merchant to be used for iDIN, if operating under different brands or trading entities. The Merchant obtains the SubID from its Acquirer after registration for iDIN. A Merchant can request permission from the Acquirer to use one or more SubIDs.
      Parameters:
      merchantSubID - Unless agreed otherwise with the Acquirer, the Merchant has to use 0 (default)!
    • setMerchantReturnUrl

      public void setMerchantReturnUrl(String merchantReturnUrl)
      The web address provided by the Merchant in the transaction request that is used to redirect the Consumer back to the Merchant after completing the authentication in the Issuer domain. The URL does not necessarily begin with http:// or https://, it can also start with an app handler e.g. companyname-nlservice://.
      Parameters:
      merchantReturnUrl - URL either http://..., https://... or app-hander e.g. company-service://...
    • setAcquirerDirectoryUrl

      public void setAcquirerDirectoryUrl(String acquirerDirectoryUrl)
      Parameters:
      acquirerDirectoryUrl - The web address of the Acquirer's Routing service platform from where the list of Issuers is retrieved (using a directory request).
    • setAcquirerTransactionUrl

      public void setAcquirerTransactionUrl(String acquirerTransactionUrl)
      Parameters:
      acquirerTransactionUrl - The web address of the Acquirer's Routing Service platform where the transactions (authentication requests) are initiated.
    • setAcquirerStatusUrl

      public void setAcquirerStatusUrl(String acquirerStatusUrl)
      Parameters:
      acquirerStatusUrl - The web address of the Acquirer's Routing Service platform to where the library sends status request messages.
    • setKeyStoreLocation

      public void setKeyStoreLocation(String keyStoreLocation)
      The Java iDIN Software Library needs to access a keystore located in the Java classpath to store all the required certificates
      Parameters:
      keyStoreLocation - A file path and name, accessible to the library, which is the Java keystore file where the certificates are stored
    • setKeyStorePassword

      public void setKeyStorePassword(String keyStorePassword)
      The password used to access the keystore
      Parameters:
      keyStorePassword - The password for the keystore
    • setKeyStoreAuthAlias

      public void setKeyStoreAuthAlias(String keyStoreAuthAlias)
      The AuthAlias used to access the keystore
      Parameters:
      keyStoreAuthAlias - The AuthAlias that contains the password for the keystore
    • getKeyStorePassword

      public String getKeyStorePassword()
    • setMerchantCertificateAlias

      public void setMerchantCertificateAlias(String merchantCertificateAlias)
      This is the certificate owned by the Merchant. It's the private certificate used to sign messages sent by the Merchant to the Acquirer's Routing Service platform. Its public key is also used by the Acquirer to authenticate incoming messages from the Merchant. The Merchant certificate must be in PKCS#12 format which has the extension .p12 or .pfx
      Parameters:
      merchantCertificateAlias - The alias assigned to the signing certificate in the keystore file. This could be the alias you supplied explicitly when importing an existing certificate in the keystore, or it could be an alias automatically assigned by the keytool application.
    • setMerchantCertificatePassword

      public void setMerchantCertificatePassword(String merchantCertificatePassword)
      In case the merchant certificate has been password protected
      Parameters:
      merchantCertificatePassword - The password for the Merchant Certificate
    • setMerchantCertificateAuthAlias

      public void setMerchantCertificateAuthAlias(String merchantCertificateAuthAlias)
      In case the merchant certificate has been password protected
      Parameters:
      merchantCertificateAuthAlias - The AuthAlias that contains the password for the Merchant Certificate
    • getMerchantCertificatePassword

      public String getMerchantCertificatePassword()
    • setAcquirerCertificateAlias

      public void setAcquirerCertificateAlias(String acquirerCertificateAlias)
      This is the public certificate used to authenticate incoming messages from the Acquirer. The library only needs its public key. The public certificate must be in PEM format (base64 ASCII) and typically has the file extension .cer,.crt or .pem.
      Parameters:
      acquirerCertificateAlias - : The alias assigned to the Acquirer's certificate in the keystore. This could be the alias you supplied explicitly when importing an existing certificate in the keystore, or it could be an alias automatically assigned by the keytool application.
    • setAcquirerAlternativeCertificateAlias

      public void setAcquirerAlternativeCertificateAlias(String acquirerAlternativeCertificateAlias)
      This is the public certificate used to authenticate incoming messages from the Acquirer. The library only needs its public key. The public certificate must be in PEM format (base64 ASCII) and typically has the file extension .cer,.crt or .pem.
      Parameters:
      acquirerAlternativeCertificateAlias - : The alias assigned to the Acquirer's certificate in the keystore. This could be the alias you supplied explicitly when importing an existing certificate in the keystore, or it could be an alias automatically assigned by the keytool application.
    • setSamlCertificateAlias

      public void setSamlCertificateAlias(String samlCertificateAlias)
      This is the certificate owned by the Merchant. Its public key is used by the Issuer to encrypt information. The Merchant can then use the private key to decrypt that information. The SAML certificate must be in PKCS#12 format which has the extension .p12 or .pfx;
      Parameters:
      samlCertificateAlias - The alias assigned to the SAML certificate in the keystore. This could be the alias supplied explicitly when importing an existing certificate in the keystore, or it could be an alias automatically assigned by the keytool application.
    • setSAMLCertificatePassword

      public void setSAMLCertificatePassword(String samlCertificatePassword)
      In case the SAML certificate has been password protected
      Parameters:
      samlCertificatePassword - The password for the SAML Certificate
    • setSAMLCertificateAuthAlias

      public void setSAMLCertificateAuthAlias(String samlCertificateAuthAlias)
      In case the SAML certificate has been password protected
      Parameters:
      samlCertificateAuthAlias - The AuthAlias that contains the password for the SAML Certificate
    • getSAMLCertificatePassword

      public String getSAMLCertificatePassword()
    • setLogsEnabled

      public void setLogsEnabled(boolean logsEnabled)
    • setServiceLogsEnabled

      public void setServiceLogsEnabled(boolean serviceLogsEnabled)
    • setServiceLogsLocation

      public void setServiceLogsLocation(String serviceLogsLocation)
    • setServiceLogsPattern

      public void setServiceLogsPattern(String serviceLogsPattern)
    • setTls12Enabled

      public void setTls12Enabled(boolean tls12Enabled)
      Parameters:
      tls12Enabled - the tls12Enabled to set
    • setMerchantReturnUrlSessionKey

      public void setMerchantReturnUrlSessionKey(String merchantReturnUrlSessionKey)
      Parameters:
      merchantReturnUrlSessionKey - the merchantReturnUrlSessionKey to set
    • setConfigurationXML

      @Mandatory public void setConfigurationXML(String iDinConfigurationXML)
      Load configuration from XML. Attributes may overwrite this 'default'.