seccommerce.secauthenticator
Class SecAuthenticator

java.lang.Object
  extended by seccommerce.secauthenticator.SecAuthenticator

public class SecAuthenticator
extends java.lang.Object

SecAuthenticator API. This API is not intended for public use. It shall only be used by specific customers who have an agreement with SecCommerce Informationssyteme GmbH about the usage of this API.

Author:
SecCommerce Informationssysteme GmbH, Hamburg

Constructor Summary
SecAuthenticator(java.lang.String secAuthSessionId, java.lang.String targetPath, java.util.Properties priorityProperties)
          Creates a SecAuthenticator for use by WebStart.
SecAuthenticator(java.awt.Window parentWindow)
          Creates a SecAuthenticator for use in a pop-up window belonging to an application.
SecAuthenticator(java.awt.Window parentWindow, java.util.Properties properties)
          Creates a SecAuthenticator for use in a pop-up window belonging to an application.
SecAuthenticator(java.awt.Window parentWindow, java.util.Properties properties, java.lang.String installPath)
          Deprecated. use SecAuthenticator(Window, Properties) instead
 
Method Summary
 void cancel()
          Will be called when the smart card initialization was canceled by the user.
 void close()
          Closes this SecAuthenticator instance.
 byte[] decrypt(byte[] envelopedDataDer, boolean alwaysVerifyPin)
          Decrypts data with the inserted smart card.
 byte[] encryptForInsertedSmartCard(byte[] plainData)
          Encrypts data for the inserted smart card.
 void initSignUnits()
          Initializes the signature units (smart card readers or software key) and searches the inserted cards.
 boolean isSmartCardAvailable()
          Checks if a SmartCard is available.
 java.lang.String logInToSecRouter(boolean alwaysVerifyPin)
          Logs in to SecRouter.
static void main(java.lang.String[] args)
          Entry point for WebStart.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecAuthenticator

public SecAuthenticator(java.awt.Window parentWindow,
                        java.util.Properties properties)
                 throws SecAuthenticatorException
Creates a SecAuthenticator for use in a pop-up window belonging to an application.

Parameters:
parentWindow - reference to the parent window.
properties - the properties.
Throws:
SecAuthenticatorException - if the resource file containing native libraries to access card readers cannot be found or read or the resource JAR containing images cannot be loaded.
java.lang.NullPointerException - if the properties parameter or the window parameter is null.

SecAuthenticator

public SecAuthenticator(java.awt.Window parentWindow,
                        java.util.Properties properties,
                        java.lang.String installPath)
                 throws SecAuthenticatorException
Deprecated. use SecAuthenticator(Window, Properties) instead

Creates a SecAuthenticator for use in a pop-up window belonging to an application.

Parameters:
parentWindow - reference to the parent window.
properties - the properties.
installPath - SecAuthenticator's installation path.
Throws:
SecAuthenticatorException - if the resource file containing native libraries to access card readers cannot be found or read or the resource JAR containing images cannot be loaded.
java.lang.NullPointerException - if the properties parameter or the window parameter is null.

SecAuthenticator

public SecAuthenticator(java.awt.Window parentWindow)
                 throws SecAuthenticatorException
Creates a SecAuthenticator for use in a pop-up window belonging to an application.

Parameters:
parentWindow - reference to the parent window.
Throws:
SecAuthenticatorException - if the resource file containing native libraries to access card readers cannot be found or read or the resource JAR containing images cannot be loaded.
java.lang.NullPointerException - if the properties parameter or the window parameter is null.

SecAuthenticator

public SecAuthenticator(java.lang.String secAuthSessionId,
                        java.lang.String targetPath,
                        java.util.Properties priorityProperties)
                 throws SecAuthenticatorException
Creates a SecAuthenticator for use by WebStart. The JNLP file is generated by the SecRouter.

Parameters:
secAuthSessionId - the session cookie generated by SecRouter
targetPath - the target path requested by the browser
priorityProperties - the properties read from the command line coming the SecRouter's JNLP file
Throws:
SecAuthenticatorException - if the resource file containing native libraries to access card readers cannot be found or read or the resource JAR containing images cannot be loaded.
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for WebStart.

Parameters:
args - the command line parameters from a JNLP file generated by SecRouter

close

public void close()
Closes this SecAuthenticator instance.


initSignUnits

public final void initSignUnits()
                         throws SecAuthenticatorException
Initializes the signature units (smart card readers or software key) and searches the inserted cards.

Throws:
SecAuthenticatorException - if the user canceled the initialization process.

logInToSecRouter

public java.lang.String logInToSecRouter(boolean alwaysVerifyPin)
                                  throws SecAuthenticatorException
Logs in to SecRouter. Processes the following redirect(s) and finally returns SecRouter's session cookie or the LTPA token received by a Websphere server.

Parameters:
alwaysVerifyPin - if true the PIN will be verified even if has been verified already and the card would not require a new verification
Returns:
in API mode the session cookie or the LPTA token
Throws:
SecAuthenticatorException - if the login failed

encryptForInsertedSmartCard

public byte[] encryptForInsertedSmartCard(byte[] plainData)
                                   throws SecAuthenticatorException
Encrypts data for the inserted smart card.

Parameters:
plainData - plain data to be encrypted
Returns:
encrypted PKCS#7 EnvelopedData object
Throws:
SecAuthenticatorException - if the certificate from the smart card could not be parsed or the EnvelopedData could not be constructed

decrypt

public byte[] decrypt(byte[] envelopedDataDer,
                      boolean alwaysVerifyPin)
               throws SecAuthenticatorException
Decrypts data with the inserted smart card.

Parameters:
envelopedDataDer - encrypted PKCS#7 EnvelopedData object
alwaysVerifyPin - if true the PIN will be verified even if has been verified already and the card would not require a new verification
Returns:
decrypted plain data
Throws:
SecAuthenticatorException - if enveloped data could not be decrypted with this inserted smart card

isSmartCardAvailable

public boolean isSmartCardAvailable()
                             throws SecAuthenticatorException
Checks if a SmartCard is available.

Returns:
'true' if a SmartCard is available
Throws:
SecAuthenticatorException

cancel

public final void cancel()
Will be called when the smart card initialization was canceled by the user.



Copyright SecCommerce Informationssysteme GmbH 1999-2017