Class CoreSecurityService

java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.security.CoreSecurityService
All Implemented Interfaces:
AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, ConfigComment, MessageEventGenerator, Service, StateManagedComponent
Direct Known Subclasses:
DecryptionService, EncryptionService, PayloadPathDecryptionService, PayloadPathEncryptionService

public abstract class CoreSecurityService extends ServiceImp
The base class for all security services.
See Also:
  • Field Details

    • branchingEnabled

      protected transient boolean branchingEnabled
  • Constructor Details

    • CoreSecurityService

      public CoreSecurityService()
      Creates a new Object with the following defaults.
      • Default encryption algorithm is DESede/CBC/PKCS5Padding, KeySize=168
      • V1 compatibility is false
      • security factory is null (suitable for communication with V1 implementations)
  • Method Details

    • isBranching

      public boolean isBranching()
      Description copied from interface: Service

      Returns true if the implementation supports branching.

      Specified by:
      isBranching in interface Service
      Overrides:
      isBranching in class ServiceImp
      Returns:
      true if the implementation supports branching
      See Also:
    • getKeystoreUrls

      public List<ConfiguredKeystore> getKeystoreUrls()
      Get the list of keystore urls.
      Returns:
      the list of keystore urls.
    • setKeystoreUrls

      public void setKeystoreUrls(List<ConfiguredKeystore> list)
      Set the keystore urls.
      Parameters:
      list - the list of keystore urls.
    • addKeystoreUrl

      public void addKeystoreUrl(ConfiguredKeystore url)
      Add an url to the list.

      Valid URLS are in the form
      [protocol]://[server]:[port]/[path]?keystoreType=[type]& keystorePassword=[password]

      • protocol - the protocol to use, e.g. http
      • server - the server hosting the keystore
      • port - the port through which the protocol will operate
      • path - Path to the keystore
      • type - The type of keystore to use (e.g. JKS)
      • password - password to the keystore

      An example would be http://www.adaptris.com/my.ks?keystoreType=JKS& keystorePassword=ABCDE or file://localhost/c:/my.ks?keystoreType=JKS& keystorePassword=ABCDE

      For the purposes of security each of the keystores will be searched in turn for the matching partner information. Only the first matching partner will be used.

      Parameters:
      url - an individual url
      See Also:
    • setLocalPartner

      public void setLocalPartner(String s)
      Set the local partner keystore alias.
      Parameters:
      s - the local partner
    • getLocalPartner

      public String getLocalPartner()
      Get the local partner keystore alias.
      Returns:
      the local partner
    • setRemotePartner

      public void setRemotePartner(String s)
      Set the remote partner keystore alias.

      If this is not set, then it will be derived from metadata.

      Parameters:
      s - the remote partner
      See Also:
    • getRemotePartner

      public String getRemotePartner()
      Get the remote partner alias.
      Returns:
      the remote partner.
    • setEncryptionAlgorithm

      public void setEncryptionAlgorithm(EncryptionAlgorithm enc)
      Set the encryption algorithm to be used.
      Parameters:
      enc - the encryption algorithm
    • getEncryptionAlgorithm

      public EncryptionAlgorithm getEncryptionAlgorithm()
      Get the encryption algorithm to be used.
      Returns:
      the encryption algorithm
    • setSecurityFactory

      public void setSecurityFactory(SecurityServiceFactory s)
      Set the type of encryption to be used.
      Parameters:
      s - the encryption type.
    • getSecurityFactory

      public SecurityServiceFactory getSecurityFactory()
      Get the encryption type to be used.
      Returns:
      the encryption type.
    • initService

      protected final void initService() throws CoreException
      Specified by:
      initService in class ServiceImp
      Throws:
      CoreException
    • closeService

      protected void closeService()
      Specified by:
      closeService in class ServiceImp
    • prepare

      public void prepare() throws CoreException
      Description copied from interface: ComponentLifecycleExtension
      Prepare for initialisation.
      Throws:
      CoreException
    • getFailId

      public String getFailId()
      Returns:
      the failId
    • setFailId

      public void setFailId(String s)
      Parameters:
      s - the failId to set
    • getSuccessId

      public String getSuccessId()
      Returns:
      the successId
    • setSuccessId

      public void setSuccessId(String s)
      Parameters:
      s - the successId to set
    • getRemotePartnerMetadataKey

      public String getRemotePartnerMetadataKey()
    • setRemotePartnerMetadataKey

      public void setRemotePartnerMetadataKey(String s)
    • getPrivateKeyPasswordProvider

      public PrivateKeyPasswordProvider getPrivateKeyPasswordProvider()
    • setPrivateKeyPasswordProvider

      public void setPrivateKeyPasswordProvider(PrivateKeyPasswordProvider pkpp)
      Set the private key password provider.
      Parameters:
      pkpp - the provider; default is LegacyPrivateKeyPasswordProvider which retrieves the private key password from 'security.properties' on the classpath to support backward compatibility.