eu.emi.dsr.security
Class DSRSecurityProperties

java.lang.Object
  extended by eu.emi.dsr.security.DSRSecurityProperties
All Implemented Interfaces:
IAuthenticationConfiguration, IClientProperties, ISecurityConfiguration, ISecurityProperties, Cloneable

public class DSRSecurityProperties
extends Object
implements ISecurityProperties, Cloneable

UAS security properties. For property lookup, this uses a hierarchy of property sources:
- supplied input stream (or file name), if any
- parent properties passed as constructor argument (e.g. Kernel's)

Author:
schuller

Field Summary
 
Fields inherited from interface eu.emi.client.security.ISecurityProperties
REGISTRY_ACL_FILE, REGISTRY_CHECKACCESS, REGISTRY_CHECKACCESS_PDP, REGISTRY_CHECKACCESS_PDPCONFIG, REGISTRY_INBOUND_FILTER_NAME, REGISTRY_OUTBOUND_FILTER_NAME, REGISTRY_REQUIRE_SIGNATURES, REGISTRY_SSL_CLIENTAUTH, REGISTRY_SSL_ENABLED, REGISTRY_SSL_KEYALIAS, REGISTRY_SSL_KEYPASS, REGISTRY_SSL_KEYSTORE, REGISTRY_SSL_KEYTYPE, REGISTRY_SSL_TRUSTPASS, REGISTRY_SSL_TRUSTSTORE, REGISTRY_SSL_TRUSTTYPE
 
Constructor Summary
DSRSecurityProperties(Properties parent)
           
DSRSecurityProperties(Properties parent, InputStream is)
           
DSRSecurityProperties(Properties parent, Properties local)
           
DSRSecurityProperties(Properties parent, String propertiesFileName)
           
 
Method Summary
 ISecurityProperties clone()
           
protected  String doGetProperty(String key)
          return named property.
 boolean doHttpAuthn()
           
 boolean doSignMessage()
           
 boolean doSSLAuthn()
           
 X509Certificate[] getCertificateChain()
           
 ClassLoader getClassLoader()
           
 Map<String,Object> getExtraSecurityTokens()
           
 Properties getExtraSettings()
           
 X509Certificate getGatewayCertificate()
           
 String getHttpPassword()
           
 String getHttpUser()
           
 String getInHandlerClassNames()
           
 String getKeystore()
           
 String getKeystoreAlias()
           
 String getKeystoreKeyPassword()
           
 String getKeystorePassword()
           
 String getKeystoreType()
           
 String getOutHandlerClassNames()
           
 PrivateKey getPrivateKey()
          returns the private key entry identified by getKeystoreAlias() from the keystore
 Properties getProperties()
           
 String getProperty(String key)
           
 X509Certificate getPublicKey()
           
 SSLContext getSSLContext()
           
 String getTruststore()
           
 String getTruststorePassword()
           
 String getTruststoreType()
           
 boolean isSslEnabled()
          returns true if SSL mode is enabled.
SSL can be enabled by setting a property "unicore.wsrflite.ssl" to "true" in the wsrflite.xml file or by defining a system property
 boolean requireClientAuthentication()
           
 void setClassLoader(ClassLoader classLoader)
           
 void setExtraSecurityTokens(Map<String,Object> extraSecurityTokens)
           
 void setProperty(String key, String value)
          set a property
 void setSignMessage(boolean signMessage)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DSRSecurityProperties

public DSRSecurityProperties(Properties parent,
                             Properties local)
                      throws UnrecoverableKeyException,
                             KeyStoreException,
                             NoSuchAlgorithmException,
                             CertificateException,
                             IOException
Throws:
UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

DSRSecurityProperties

public DSRSecurityProperties(Properties parent)
                      throws UnrecoverableKeyException,
                             KeyStoreException,
                             NoSuchAlgorithmException,
                             CertificateException,
                             IOException
Throws:
UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

DSRSecurityProperties

public DSRSecurityProperties(Properties parent,
                             InputStream is)
                      throws UnrecoverableKeyException,
                             KeyStoreException,
                             NoSuchAlgorithmException,
                             CertificateException,
                             IOException
Throws:
UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

DSRSecurityProperties

public DSRSecurityProperties(Properties parent,
                             String propertiesFileName)
                      throws IOException,
                             UnrecoverableKeyException,
                             KeyStoreException,
                             NoSuchAlgorithmException,
                             CertificateException
Throws:
IOException
UnrecoverableKeyException
KeyStoreException
NoSuchAlgorithmException
CertificateException
Method Detail

clone

public ISecurityProperties clone()
Specified by:
clone in interface IAuthenticationConfiguration
Specified by:
clone in interface IClientProperties
Specified by:
clone in interface ISecurityConfiguration
Specified by:
clone in interface ISecurityProperties
Overrides:
clone in class Object

doGetProperty

protected String doGetProperty(String key)
return named property. Lookup order: - own properties - Kernel.getKernel().getProperty()


getProperty

public String getProperty(String key)
Specified by:
getProperty in interface ISecurityProperties

setProperty

public void setProperty(String key,
                        String value)
set a property

Specified by:
setProperty in interface ISecurityProperties
Parameters:
key -
value -

isSslEnabled

public boolean isSslEnabled()
returns true if SSL mode is enabled.
SSL can be enabled by setting a property "unicore.wsrflite.ssl" to "true" in the wsrflite.xml file or by defining a system property

Specified by:
isSslEnabled in interface IClientProperties
Returns:

doSSLAuthn

public boolean doSSLAuthn()
Specified by:
doSSLAuthn in interface IAuthenticationConfiguration

requireClientAuthentication

public boolean requireClientAuthentication()
Specified by:
requireClientAuthentication in interface ISecurityProperties

getCertificateChain

public X509Certificate[] getCertificateChain()
Specified by:
getCertificateChain in interface IClientProperties
Specified by:
getCertificateChain in interface ISecurityProperties

getPublicKey

public X509Certificate getPublicKey()
Specified by:
getPublicKey in interface IClientProperties

getPrivateKey

public PrivateKey getPrivateKey()
returns the private key entry identified by getKeystoreAlias() from the keystore

Specified by:
getPrivateKey in interface IClientProperties

toString

public String toString()
Overrides:
toString in class Object

doSignMessage

public boolean doSignMessage()
Specified by:
doSignMessage in interface IClientProperties

setSignMessage

public void setSignMessage(boolean signMessage)
Specified by:
setSignMessage in interface ISecurityProperties

getGatewayCertificate

public X509Certificate getGatewayCertificate()
Specified by:
getGatewayCertificate in interface ISecurityProperties

getExtraSecurityTokens

public Map<String,Object> getExtraSecurityTokens()
Specified by:
getExtraSecurityTokens in interface IClientProperties

setExtraSecurityTokens

public void setExtraSecurityTokens(Map<String,Object> extraSecurityTokens)
Specified by:
setExtraSecurityTokens in interface ISecurityProperties

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface IClientProperties

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Specified by:
setClassLoader in interface ISecurityProperties

doHttpAuthn

public boolean doHttpAuthn()
Specified by:
doHttpAuthn in interface IAuthenticationConfiguration

getHttpUser

public String getHttpUser()
Specified by:
getHttpUser in interface IAuthenticationConfiguration

getHttpPassword

public String getHttpPassword()
Specified by:
getHttpPassword in interface IAuthenticationConfiguration

getSSLContext

public SSLContext getSSLContext()
Specified by:
getSSLContext in interface IAuthenticationConfiguration

getKeystorePassword

public String getKeystorePassword()
Specified by:
getKeystorePassword in interface ISecurityConfiguration

getKeystoreKeyPassword

public String getKeystoreKeyPassword()
Specified by:
getKeystoreKeyPassword in interface ISecurityConfiguration

getKeystore

public String getKeystore()
Specified by:
getKeystore in interface ISecurityConfiguration

getKeystoreType

public String getKeystoreType()
Specified by:
getKeystoreType in interface ISecurityConfiguration

getKeystoreAlias

public String getKeystoreAlias()
Specified by:
getKeystoreAlias in interface ISecurityConfiguration

getTruststore

public String getTruststore()
Specified by:
getTruststore in interface IAuthenticationConfiguration

getTruststoreType

public String getTruststoreType()
Specified by:
getTruststoreType in interface IAuthenticationConfiguration

getTruststorePassword

public String getTruststorePassword()
Specified by:
getTruststorePassword in interface IAuthenticationConfiguration

getExtraSettings

public Properties getExtraSettings()
Specified by:
getExtraSettings in interface IClientProperties

getOutHandlerClassNames

public String getOutHandlerClassNames()
Specified by:
getOutHandlerClassNames in interface IClientProperties

getInHandlerClassNames

public String getInHandlerClassNames()
Specified by:
getInHandlerClassNames in interface IClientProperties

getProperties

public Properties getProperties()
Specified by:
getProperties in interface ISecurityProperties


Copyright © 2012. All Rights Reserved.