Class SAMLTokenIssuerConfig

java.lang.Object
org.apache.rahas.impl.AbstractIssuerConfig
org.apache.rahas.impl.SAMLTokenIssuerConfig

public class SAMLTokenIssuerConfig extends AbstractIssuerConfig
Configuration manager for the SAMLTokenIssuer
See Also:
  • Field Details

    • SAML_ISSUER_CONFIG

      public static final QName SAML_ISSUER_CONFIG
      The QName of the configuration element of the SAMLTokenIssuer
    • USE_SAML_ATTRIBUTE_STATEMENT

      public static final QName USE_SAML_ATTRIBUTE_STATEMENT
    • ISSUER_NAME

      public static final QName ISSUER_NAME
    • SAML_CALLBACK_CLASS

      public static final QName SAML_CALLBACK_CLASS
    • issuerKeyAlias

      protected String issuerKeyAlias
    • issuerKeyPassword

      protected String issuerKeyPassword
    • issuerName

      protected String issuerName
    • trustedServices

      protected Map trustedServices
    • trustStorePropFile

      protected String trustStorePropFile
    • callbackHandler

      protected SAMLCallbackHandler callbackHandler
    • callbackHandlerName

      protected String callbackHandlerName
  • Constructor Details

    • SAMLTokenIssuerConfig

      public SAMLTokenIssuerConfig(String issuerName, String cryptoProviderClassName, Properties cryptoProps)
      Create a new configuration with issuer name and crypto information
      Parameters:
      issuerName - Name of the issuer
      cryptoProviderClassName - WSS4J Crypto impl class name
      cryptoProps - Configuration properties of crypto impl
    • SAMLTokenIssuerConfig

      public SAMLTokenIssuerConfig(String configFilePath) throws TrustException
      Create a SAMLTokenIssuer configuration with a config file picked from the given location.
      Parameters:
      configFilePath - Path to the config file
      Throws:
      TrustException
    • SAMLTokenIssuerConfig

      public SAMLTokenIssuerConfig(org.apache.axiom.om.OMElement elem) throws TrustException
      Create a SAMLTokenIssuer configuration using the give config element
      Parameters:
      elem - Configuration element as an OMElement
      Throws:
      TrustException
  • Method Details

    • getParameter

      public org.apache.axis2.description.Parameter getParameter()
      Generate an Axis2 parameter for this configuration
      Returns:
      An Axis2 Parameter instance with configuration information
    • setIssuerKeyAlias

      public void setIssuerKeyAlias(String issuerKeyAlias)
    • getIssuerKeyAlias

      public String getIssuerKeyAlias()
    • setIssuerKeyPassword

      public void setIssuerKeyPassword(String issuerKeyPassword)
    • getIssuerKeyPassword

      public String getIssuerKeyPassword()
    • setIssuerName

      public void setIssuerName(String issuerName)
    • setTrustedServices

      public void setTrustedServices(Map trustedServices)
    • setTrustStorePropFile

      public void setTrustStorePropFile(String trustStorePropFile)
    • addTrustedServiceEndpointAddress

      public void addTrustedServiceEndpointAddress(String address, String alias)
      Add a new trusted service endpoint address with its certificate
      Parameters:
      address - Service endpoint address
      alias - certificate alias
    • setCryptoProperties

      public void setCryptoProperties(String providerClassName, Properties props)
      Set crypto information using WSS4J mechanisms
      Parameters:
      providerClassName - Provider class - an implementation of org.apache.ws.security.components.crypto.Crypto
      props - Configuration properties
    • getTrustedServices

      public Map getTrustedServices()
      Return the list of trusted services as a java.util.Map. The services addresses are the keys and cert aliases available under those keys.
      Returns:
    • getCallbackHander

      @Deprecated public SAMLCallbackHandler getCallbackHander()
      Deprecated.
    • setCallbackHander

      @Deprecated public void setCallbackHander(SAMLCallbackHandler callbackHandler)
      Deprecated.
    • getCallbackHandler

      public SAMLCallbackHandler getCallbackHandler()
    • getIssuerName

      public String getIssuerName()
    • getTrustStorePropFile

      public String getTrustStorePropFile()
    • setCallbackHandler

      public void setCallbackHandler(SAMLCallbackHandler callbackHandler)
    • getCallbackHandlerName

      public String getCallbackHandlerName()
    • setCallbackHandlerName

      public void setCallbackHandlerName(String callbackHandlerName)
    • getServiceCert

      public X509Certificate getServiceCert(org.apache.wss4j.common.crypto.Crypto crypto, String serviceAddress) throws TrustException
      Uses the wst:AppliesTo to figure out the certificate to encrypt the secret in the SAML token
      Parameters:
      crypto -
      serviceAddress - The address of the service
      Returns:
      Throws:
      TrustException - If unable to find certificate by given alias.
    • getIssuerCrypto

      public org.apache.wss4j.common.crypto.Crypto getIssuerCrypto(ClassLoader classLoader) throws TrustException
      This method will create a Crypto object based on property values defined in cryptoElement or cryptoPropertiesFile.
      Parameters:
      classLoader - A class loader to pass into CryptoFactory.
      Returns:
      A Crypto object
      Throws:
      TrustException - If an error occurred while creating the Crypto object.