Package com.adaptris.core.security
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
The base class for all security services.
- See Also:
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an url to the list.protected void
Get the encryption algorithm to be used.Get the list of keystore urls.Get the local partner keystore alias.Get the remote partner alias.Get the encryption type to be used.protected final void
boolean
Returns true if the implementation supports branching.void
prepare()
Prepare for initialisation.void
Set the encryption algorithm to be used.void
void
Set the keystore urls.void
Set the local partner keystore alias.void
Set the private key password provider.void
Set the remote partner keystore alias.void
void
Set the type of encryption to be used.void
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
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 interfaceService
- Overrides:
isBranching
in classServiceImp
- Returns:
- true if the implementation supports branching
- See Also:
-
getKeystoreUrls
Get the list of keystore urls.- Returns:
- the list of keystore urls.
-
setKeystoreUrls
Set the keystore urls.- Parameters:
list
- the list of keystore urls.
-
addKeystoreUrl
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
orfile://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
Set the local partner keystore alias.- Parameters:
s
- the local partner
-
getLocalPartner
Get the local partner keystore alias.- Returns:
- the local partner
-
setRemotePartner
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
Get the remote partner alias.- Returns:
- the remote partner.
-
setEncryptionAlgorithm
Set the encryption algorithm to be used.- Parameters:
enc
- the encryption algorithm
-
getEncryptionAlgorithm
Get the encryption algorithm to be used.- Returns:
- the encryption algorithm
-
setSecurityFactory
Set the type of encryption to be used.- Parameters:
s
- the encryption type.
-
getSecurityFactory
Get the encryption type to be used.- Returns:
- the encryption type.
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
getFailId
- Returns:
- the failId
-
setFailId
- Parameters:
s
- the failId to set
-
getSuccessId
- Returns:
- the successId
-
setSuccessId
- Parameters:
s
- the successId to set
-
getRemotePartnerMetadataKey
-
setRemotePartnerMetadataKey
-
getPrivateKeyPasswordProvider
-
setPrivateKeyPasswordProvider
Set the private key password provider.- Parameters:
pkpp
- the provider; default isLegacyPrivateKeyPasswordProvider
which retrieves the private key password from 'security.properties' on the classpath to support backward compatibility.
-