44.3 Managing Security Token Service Encryption and Signing Keys

Encryption and Signing Certificates stored in a keystore are used by the Security Token Service.

Security Token Service uses keys to:

  • Sign outgoing Assertions

  • Decrypt any incoming XML encrypted data contained inside the RST message (tokens, entropies...), which is not handled by the WSS Protocol

Security Token Service uses the following keystore for storing Encryption and Signing Certificates.

$DOMAIN_HOME/config/fmwconfig/.oamkeystore

44.3.1 Task Overview: Managing Security Token Service Encryption/Signing Keys

You need to perform the following tasks to manage Security Token Service keys:

  1. Resetting System Keystore (.oamkeystore) and Trust Keystore (amtruststore) Password

  2. Adding a New Key Entry to the System Keystore (.oamkeystore)

  3. Extracting an Security Token Service Certificate

See Configuring OWSM for WSS Protocol Communication.

44.3.2 Resetting System Keystore (.oamkeystore) and Trust Keystore (amtruststore) Password

You can reset the password that protects keystores, and the key entries that are using the same password as the keystore.

These keystores were created and configured during installation, as described in the Oracle Fusion Middleware Installation Guide for Oracle Identity and Access Management. The password and key entries password were randomly generated. The WLST resetKeystorePassword method allows the Administrator to set the .oamkeystore password and any key entries with a password identical to the .oamkeystore password to a new value:

  • Updates the .oamkeystore password

  • Updates the key entries in .oamkeystore that had the same password as the keystore

  • Updates Access Manager, Identity Federation, and Security Token Service configuration to reflect the changes

  • Updates the amtruststore password (if the keystore is protected by the same password as the default .oamkeystore)

See WLST Command Reference for WebLogic Server.

44.3.2.1 Resetting System and Trust Keystore Passwords

You can reset system and trust keystore passwords through the WebLogic Server AdminServer.

To reset system and trust keystore passwords:

  1. Enter the WSLT scripting environment, as usual.
  2. Connect to the WebLogic Server AdminServer, using the connect() command.
  3. Navigate to the domain runtime tree: domainRuntime().
  4. Execute the following: resetKeystorePassword()
  5. Enter and confirm the password.

44.3.3 Adding a New Key Entry to the System Keystore (.oamkeystore)

An Administrator can add a new key entry into the System keystore (.oamkeystore) using the keytool command to create and add the new key entry.

Once the entry has been added, it must be defined in the Security Token Service configuration screen so that it can be used to sign assertions and decrypt incoming messages. The following topics describe how to add a new entry to sign SAML Assertions or decrypt XML-Encrypted data not covered by WSS:

44.3.3.1 Adding a New Entry

You need to configure a new entry to sign SAML Assertions or decrypt XML-Encrypted data not covered by WSS.

Before you begin, ensure that the Oracle Access Manager service is enabled.

To configure a new entry:

  1. Locate keytool.

  2. Either generate a self signed certificate or generate a certificate request, export the request to a remote Certificate Authority, and import the certificate issued by the Certificate Authority.

  3. Observe messages on the screen.

  4. Proceed as needed:

44.3.3.2 Configuring a SAML Issuance Template to Use a Signing Key

Users with valid Administrator credentials can edit an existing template to use a signing key.

To configure a SAML Issuance template to use a signing key:

  1. Display the list of existing Token Issuance Templates.
    • Oracle Access Management Console
    • System Configuration
    • Security Token Services
    • Token Issuance Templates
  2. Find and open the SAML issuance template that will use the new key. For example: saml11-issuance-template.
  3. On the SAML Issuance Template page, click the Security tab.
  4. On the Security tab, Signing And Encryption section, click Sign Assertion.
  5. From the Signing Keystore Access Template Id list, choose the KeyID as the Signing Keystore Entry.
  6. Click Apply at the top of the page to save this information.
  7. Proceed as follows, if needed:

44.3.3.3 Setting the Default Encryption Key

Users with valid Administrator credentials can edit an existing template to use a signing key.

See About Security Token Service Settings.

To set the default encryption key:

  1. In the Oracle Access Management Console, click Configuration at the top of the window.
  2. In the Configuration console, select Security Token Service from the View drop-down menu in the Settings section.
  3. From the Default Encryption Template list, select the new key entry.
  4. Click Apply at the top of the page to save this information.
  5. Proceed as follows:

44.3.4 Extracting an Security Token Service Certificate

You can use Certificate Retrieval Service to distribute the certificate of a key entry.

In some cases, it is required to distribute the Security Token Service keys used for SAML Signature operations or XML encryption operations:

  • When a Relying Party needs to have access to the Security Token Service signing key, in order to validate the SAML Assertion issued by Security Token Service

  • When a token needs to be encrypted for Security Token Service Server

To distribute the certificate of a key entry used by Security Token Service for SAML Signature operations or XML encryption operations, use the Certificate Retrieval Service by specifying the KeyID (listed in System Configuration, Security Token Service, Security Token Service Settings and the preferred encoding (der vs pem).

See Using the Certificate Retrieval Service.

44.3.4.1 Using the Certificate Retrieval Service

You can retrieve the KEYID of the entry and create a URL with it.

To use the Certificate Retrieval service.

  1. Retrieve the KeyID of the entry for which the certificate should be retrieved (listed in Oracle Access Management Console System Configuration tab, Security Token Service section, Security Token Service Settings).
  2. Create a URL.

    For example: http(s)://osts-hostname:osts-port/sts/servlet/samlcert?id=<KEYID>&encoding=<ENCODING>, with:

    • id holding the KeyID of the entry

    • encoding representing the format with which the certificate is returned. Possible values are pem (PEM format) or der (DER format). (optional, default value is pem)

  3. Review the certificate that appears in the browser.