at.knowcenter.wag.egov.egiz.sig.connectors.mocca
Class LocRefDetachedMOCCAConnector

java.lang.Object
  extended byat.knowcenter.wag.egov.egiz.sig.connectors.mocca.LocRefDetachedMOCCAConnector
All Implemented Interfaces:
Connector, LocalConnector

public class LocRefDetachedMOCCAConnector
extends Object
implements Connector, LocalConnector

Connector for MOCCA.

Author:
tknall

Nested Class Summary
static class LocRefDetachedMOCCAConnector.Environment
          Holds environment configuration information like templates.
 
Field Summary
protected  LocRefDetachedMOCCAConnector.Environment environment
          The environment of this connector containing templates.
protected  ConnectorParameters params
          The connector parameters.
 
Constructor Summary
LocRefDetachedMOCCAConnector(ConnectorParameters connectorParameters, String loc_ref_content)
          Constructor that builds the configuration environment for this connector according to the given profile.
LocRefDetachedMOCCAConnector(ConnectorParameters connectorParameters, String loc_ref_content, String algorithmId)
          Constructor that builds the configuration environment for this connector according to the given profile.
 
Method Summary
 SignSignatureObject analyzeSignResponse(Properties response_properties)
          This method analyzes a signature response of the signature device.
 SignatureResponse analyzeVerifyResponse(Properties response_properties)
          Verification is not supported by MOCCA.
 SignSignatureObject doSign(SignatureData data)
          Starts a signature process.
 SignatureResponse doVerify(SignatureData data, SignSignatureObject so)
          Verification is not supported by MOCCA.
protected  String parseSigId(String sigIdString)
          Parses the common part for all id attributes from a given signature parameter string.
 String prepareSignRequest(SignatureData data)
          Prepares the signature request xml to be sent using the sign request template.
 String prepareVerifyRequest(SignatureData data, SignSignatureObject so)
          Verification is not supported by MOCCA.
 String prepareXMLContent(SignatureData data, SignSignatureObject so)
          Prepares the xml content of a signature creation request including the link to the signature data.
protected  Properties sendRequest(String url, String request_string, SignatureData data)
          Sends the request to the given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected ConnectorParameters params
The connector parameters.


environment

protected LocRefDetachedMOCCAConnector.Environment environment
The environment of this connector containing templates.

Constructor Detail

LocRefDetachedMOCCAConnector

public LocRefDetachedMOCCAConnector(ConnectorParameters connectorParameters,
                                    String loc_ref_content)
                             throws ConnectorException
Constructor that builds the configuration environment for this connector according to the given profile.

Parameters:
connectorParameters - The connectot parameters.
Throws:
ConnectorException - Thrown in case of error.

LocRefDetachedMOCCAConnector

public LocRefDetachedMOCCAConnector(ConnectorParameters connectorParameters,
                                    String loc_ref_content,
                                    String algorithmId)
                             throws ConnectorException
Constructor that builds the configuration environment for this connector according to the given profile.

Parameters:
connectorParameters - The connectot parameters.
algorithmId - The algorithm idenifier.
Throws:
ConnectorException - Thrown in case of error.
Method Detail

sendRequest

protected Properties sendRequest(String url,
                                 String request_string,
                                 SignatureData data)
                          throws ConnectorException
Sends the request to the given URL. This method handles communication exceptions. The actual send work is done by doPostRequestMultipart.

Parameters:
url - The URL to send the request to.
request_string - The request XML.
data - The data.
Returns:
Returns the response properties containing among others the response XML.
Throws:
ConnectorException - Thrown in case of an error.
See Also:
BKUPostConnection.doPostRequestMultipart(String, String, SignatureData)

doSign

public SignSignatureObject doSign(SignatureData data)
                           throws ConnectorException
Starts a signature process.

Specified by:
doSign in interface Connector
Parameters:
data - The data to be signed.
Returns:
Returns the signature object containing the signed data.
Throws:
ConnectorException - Thrown in case of an error.

doVerify

public SignatureResponse doVerify(SignatureData data,
                                  SignSignatureObject so)
                           throws ConnectorException
Verification is not supported by MOCCA. Therefore this method always throws a ConnectorException with error code ErrorCode.SIGNATURE_VERIFICATION_NOT_SUPPORTED.

Specified by:
doVerify in interface Connector
Parameters:
data - The data to be verified.
so - The signature object with the signature information.
Returns:
Returns the SignatureResponse with the result of the verification.
Throws:
ConnectorException - Thrown if something goes wrong.

analyzeSignResponse

public SignSignatureObject analyzeSignResponse(Properties response_properties)
                                        throws ConnectorException
This method analyzes a signature response of the signature device.

Specified by:
analyzeSignResponse in interface LocalConnector
Parameters:
response_properties - The response elements of the signature device.
Returns:
The parsed signed signature object.
Throws:
ConnectorException - Thrown in case of an error.

analyzeVerifyResponse

public SignatureResponse analyzeVerifyResponse(Properties response_properties)
                                        throws ConnectorException
Verification is not supported by MOCCA. Therefore this method always throws a ConnectorException with error code ErrorCode.SIGNATURE_VERIFICATION_NOT_SUPPORTED.

Specified by:
analyzeVerifyResponse in interface LocalConnector
Parameters:
response_properties - The response properties containing the response XML.
Returns:
Returns the SignatureResponse containing the verification result.
Throws:
ConnectorException - f.e.

prepareSignRequest

public String prepareSignRequest(SignatureData data)
                          throws ConnectorException
Prepares the signature request xml to be sent using the sign request template.

Specified by:
prepareSignRequest in interface LocalConnector
Parameters:
data - The signature data.
Returns:
Returns the sign request xml to be sent.
Throws:
ConnectorException - Thrown in case of an error.

prepareVerifyRequest

public String prepareVerifyRequest(SignatureData data,
                                   SignSignatureObject so)
                            throws ConnectorException
Verification is not supported by MOCCA. Therefore this method always throws a ConnectorException with error code ErrorCode.SIGNATURE_VERIFICATION_NOT_SUPPORTED.

Specified by:
prepareVerifyRequest in interface LocalConnector
Parameters:
data - The SignatureData.
so - The signature information object.
Returns:
Returns the verify request xml to be sent.
Throws:
ConnectorException - f.e.

prepareXMLContent

public String prepareXMLContent(SignatureData data,
                                SignSignatureObject so)
                         throws ConnectorException
Prepares the xml content of a signature creation request including the link to the signature data.

Parameters:
data - The signature data.
so - The signature object containing the signature information.
Returns:
Returns the xml content.
Throws:
ConnectorException - Thrown in case of an error.

parseSigId

protected String parseSigId(String sigIdString)
Parses the common part for all id attributes from a given signature parameter string.

Parameters:
sigIdString - The given signature parameter string.
Returns:
The common part of all id attributes.


Copyright © 2006-2010. All Rights Reserved.