Show TOC

Procedure documentationConfiguring Logon with X.509 Certificates with Asymmetric Encryption and Signature (AS Java) Locate this document in the navigation structure

 

This procedure provides a detailed process of all necessary steps to secure Web Services with asymmetric encryption and signature and to set up the authentication of the users using the X.509 client certificate. This example uses two AS Java systems and individual SOA Management configuration. Use this procedure to set up the trust relationship between the systems so that the WS provider trusts the WS consumer. To do this, you need to prepare the use of both signatures and encryption as described below.

Note Note

To prepare the use of signatures and encryption, the certificate System-cert is always exported, by default. In this partner system, this is then imported for signatures into the keystore view WebServiceSecurity and for encryption into the keystore view WebServiceSecurity_Certs.

End of the note.

Prerequisites

Procedure

1. Preparing for the Use of Signatures and User Authentication in the WS Consumer

Prepare the signature for the WS consumer query. Create the trust relationship through which the WS provider trusts the WS consumer.

  1. In the WS consumer, export the System-cert certificate from the keystore view WebServiceSecurity to a file:

    1. In the WS consumer, in SAP NetWeaver Administrator, choose   Configuration Managemnt   Certificates and Keys  .

    2. Select the keystore view WebServiceSecurity.

    3. Under Details of the Keystore View, select the encryption certificate System-cert.

    4. Choose Export to a File.

    5. Specify Base64 X.509 as the export format.

    6. Choose Download.

    7. Choose Save, and enter a name for the file (such as System_cert_<SID>).

  2. In the WS provider, import the WS consumer's certificate System_cert_<SID> into the keystore view WebServiceSecurity.

    1. In SAP NetWeaver Administrator, choose   Configuration Managemnt   Certificates and Keys  .

    2. Select the keystore view WebServiceSecurity.

    3. Choose Import from File.

    4. Choose the entry type X.509 certificate.

    5. Specify the path to the certificate file System_cert_<SID>.cert, and choose Import.

2. Assigning an X.509 Certificate to a Service User

Once the certificate has been successfully checked, the user to which the certificate is assigned is looged on.

  1. In the WS provider, in the SAP NetWeaver Administrator choose   Operation Management   Users and Access   Identity Management  .

  2. Find the service user to be used, under iwhich the Web service is to be executed, and select it in the results list.

  3. Switch to edit mode, and upload the consumer's certificate (such as System_cert_<Consumer-SID) on the Certificates tab page.

    Note Note

    If the Certificates tab page is not displayed, check the UME parameter ume.logon.allow.cert.

    End of the note.
  4. To assign the certificate, save the user.

3. Preparing for the Use of Signatures in the WS Provider

Prepare the signature for the WS provider. Create the trust relationship through which the WS consumer trusts the WS provider.

  1. In the WS provider, export the System-cert certificate from the keystore view WebServiceSecurity to a file:

    1. In the WS provider, in SAP NetWeaver Administrator, choose   Configuration Managemnt   Certificates and Keys  .

    2. Select the keystore view WebServiceSecurity.

    3. Under Details of the Keystore View, select the encryption certificate System-cert.

    4. Choose Export to a File.

    5. Specify Base64 X.509 as the export format.

    6. Choose Download.

    7. Choose Save, and enter a name for the file (such as System_cert_<SID>).

  2. In the WS consumer, import the WS provider's certificate System_cert_<SID> into the keystore view WebServiceSecurity.

    1. In SAP NetWeaver Administrator, choose   Configuration Managemnt   Certificates and Keys  .

    2. Select the keystore view WebServiceSecurity.

    3. Choose Import from File.

    4. Choose the entry type X.509 certificate.

    5. Specify the path to the certificate file System_cert_<SID>.cert, and choose Import.

3. Preapring Encryption

Import the WS provider's certificate (by default, System-cert) into the keystore view WebServiceSecurity_Certs of the WS consumer:

  1. In SAP NetWeaver Administrator, choose   Configuration Managemnt   Certificates and Keys  .

  2. Select the keystore view WebServiceSecurity_Certs.

  3. Choose Import from File.

  4. Choose the entry type X.509 certificate.

  5. Specify the path to the certificate file System_cert_<SID>.cert, and choose Import.

4. Creating a Logical Port
  1. In the SAP NetWeaver Administrator Administartor of the WS provider, choose   SOA Management   Application and Scenario Communication   Single Service Administration  , and then the tab page Service Definitions.

  2. Find the service that is to be accessed using an X.509 client certificate and for which you now want an endpoint, and select it in the list of search results.

  3. On the Configuration tab page, select the Runtime Configuration radio button.

  4. Start the configuration assistant by choosing the New button, and enter the following information in the relevant steps:

    1. In step 1, specify the name of the new endpoint (such as ASYM_X509), and choose whether you want to add this to an existing service or to a new service to be created.

    2. In step 2, set the options for security at transport and at message level:

      • For Transport Protocol, choose the HTTP radio button

      • For Authentication Message Authentication, check teh X.509 Client Certificate checkbox

      • Under Message Security, check the Require Signature, Add Signature, Require Encryption, and Add Encryption

        Choose Details.

        • Under Outbound Signature, specify the keystore view (by default, WebServiceSecurity) and the signature certificate (by default, System-key) of your own system, which you have imported into the WS consumer as the basis of the trust relationship.

        • Under Outbound Encryption, select the option Use the Signature Certificate of the Inbound Request.

          Since the WS consumer includes the signature certificate with the signature, the WS provider can use this certificate to encrypt the response.

      Note Note

      The additional Assistant steps are not absolutely necessary for this example configuration.

      End of the note.
    3. Choose Finish.

  5. On the WSDLs tab page, select the endpoint that you created above (for example, ASYM_X509), and call up its WSDL document.

5. Creating a Logical Port
  1. In the SAP NetWeaver Administrator of the WS consumer, choose   SOA Management   Application and Scenario Communication   Single Service Administration  , and then the Consumer Proxies tab page.

  2. Find the consumer proxy through which the service endpoint is to be accessed and for which you want to create a logical endpoint, and select the proxy in the list of search results.

  3. On the Configuration tab page, select the Runtime Configuration radio button.

  4. Start the configuration assistant by choosing the New button, and enter the following information in the relevant steps:

    1. In step 1, choose Import from WSDL-URL to import the logical endpoint from the WSDL document that you called in the WS provider.

    2. In step 2, in the WS provider, copy the WSDL of the endpoint that you created above (for example, ASYM_X509) from the WSDLs tab page, and insert this in the WS consumer in the WSDL URL field.

    3. In step 3, specify the endpoint created in the WS provider.

    4. In step 4, specify a name for the logical port.

    5. In step 5, customize the security settings. To do this, under Message Security, choose the Details button.

      • Under Outbound Signature, specify the keystore view (by default, WebServiceSecurity) and the signature certificate (by default, System-key) of your own system, which you have imported into the WS provider as the basis of the trust relationship.

      • Under Outbound Encryption, specify the keystore view (by default, WebServiceSecurity_Certs) and the certificate (as imported above, System_cert_<SID>) of the provider system.

    Note Note

    The sequence of Assistant steps depends on your entries. For this example configuration, we have made only the necessary settings, and not the optional settings.

    End of the note.
  5. Choose Finish.