|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.geant.edugain.validation.Validator
public class Validator
This class allows users to validate both SAML version 1.0, 1.1 and 2.0 primitives and eduGAIN PKI certificates. In fact, SAML documents validation implies the validation of their signatures and the associated certificates.
| Field Summary | |
|---|---|
protected Configurator |
cfg
|
protected java.util.ArrayList<java.lang.Class> |
cid_handlers
|
protected java.lang.Class |
forced_cid_handler
|
private org.apache.log4j.Logger |
log
|
protected java.util.Properties |
properties
|
protected java.security.KeyStore |
truststore
|
protected java.util.ArrayList<java.lang.String> |
validComponents
|
| Constructor Summary | |
|---|---|
Validator()
Builds a new validator with default properties. |
|
Validator(java.util.Properties props)
Builds a new validator with custom properties. |
|
Validator(java.util.Properties props,
java.util.ArrayList<java.lang.String> validComponents)
Builds a new Validator with custom properties and valid components. |
|
Validator(java.lang.String propertiesPath,
java.util.ArrayList<java.lang.String> validComponents)
Builds a new Validator with custom properties and valid components. |
|
| Method Summary | |
|---|---|
void |
clearComponentIDHandler()
Unsets the ComponentID handler so that every registered handler is used. |
void |
forceComponentIDHandler(java.lang.Class c)
Forces using a ComponentID handler class specified. |
boolean |
isCIDHandlerRegistered(java.lang.Class c)
Check if a handler is already registered. |
void |
registerCIDHandler(java.lang.Class c)
Registers a new handler for component identifiers. |
void |
setKeyStore(java.security.KeyStore ts)
Sets the truststore to use during validation. |
void |
setValidComponents(java.util.ArrayList<java.lang.String> list)
Sets valid components to validate with. |
ComponentID |
validate(org.opensaml.SAMLSignedObject o)
This method verifies the signature of an OpenSAML 1 object as well as its associated certificates. |
ComponentID |
validate(org.opensaml.SAMLSignedObject o,
java.lang.String pattern)
This method verifies the signature of an OpenSAML 1 object as well as its associated certificates. |
ComponentID |
validate(org.opensaml.common.SignableSAMLObject o)
This method verifies the signature of an OpenSAML 2 object as well as its associated certificates. |
ComponentID |
validate(org.opensaml.common.SignableSAMLObject o,
java.lang.String pattern)
This method verifies the signature of an OpenSAML 2 object as well as its associated certificates. |
ComponentID |
validate(java.security.cert.X509Certificate cert)
Checks the validity of the certificate and the identity it represents. |
ComponentID |
validate(java.security.cert.X509Certificate cert,
java.lang.String pattern)
This method checks if the certificate and its identity are valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<java.lang.String> validComponents
protected java.security.KeyStore truststore
protected java.util.Properties properties
protected Configurator cfg
protected java.util.ArrayList<java.lang.Class> cid_handlers
protected java.lang.Class forced_cid_handler
private org.apache.log4j.Logger log
| Constructor Detail |
|---|
public Validator(java.util.Properties props)
throws ValidationException
props - Custom properties
ValidationException - Thrown if an error occurs.
public Validator()
throws ValidationException
ValidationException - Thrown if an error occurs.
public Validator(java.lang.String propertiesPath,
java.util.ArrayList<java.lang.String> validComponents)
throws ValidationException
propertiesPath - Path to properties filevalidComponents - ArrayList that stores the component identifiers
ValidationException - Thrown if an error occurs while loading
properties file
public Validator(java.util.Properties props,
java.util.ArrayList<java.lang.String> validComponents)
throws ValidationException
props - Custom propertiesvalidComponents - ArrayList with component identifiers
ValidationException - Thrown if an error occurs.| Method Detail |
|---|
public void setValidComponents(java.util.ArrayList<java.lang.String> list)
list - String array referring valid componentspublic void setKeyStore(java.security.KeyStore ts)
ts - the truststore to use
public void forceComponentIDHandler(java.lang.Class c)
throws ValidationException
c - your preferred ComponentID implementation
ValidationExceptionpublic void clearComponentIDHandler()
public void registerCIDHandler(java.lang.Class c)
throws ValidationException
c - your preferred ComponentID implementation
ValidationException - if handler is already registeredpublic boolean isCIDHandlerRegistered(java.lang.Class c)
c - the handler to check
public ComponentID validate(java.security.cert.X509Certificate cert)
throws ValidationException
cert - The X509 certificate to be validated
ValidationException - Thrown if an error occurs while validation
public ComponentID validate(java.security.cert.X509Certificate cert,
java.lang.String pattern)
throws ValidationException
cert - The X509 certificate to be validatedpattern - A regular expression that should be used to match
component identifiers. Please note that if you give a
null or empty value, then no component identifier will
be verified.
ValidationException - Thrown if an error occurs while validation
public ComponentID validate(org.opensaml.SAMLSignedObject o)
throws ValidationException
o - The SAMLObject to be validated
ValidationException - Thrown if an error occurs while validation
public ComponentID validate(org.opensaml.SAMLSignedObject o,
java.lang.String pattern)
throws ValidationException
o - The SAMLObject to be validatedpattern - A regular expression that should be used to match
component identifiers. Please note that if you give a
null or empty value, then no component identifier will
be verified.
ValidationException - Thrown if an error occurs while validation
public ComponentID validate(org.opensaml.common.SignableSAMLObject o)
throws ValidationException
o - The SAML object to be validated
ValidationException - Thrown if an error occurs while validation
public ComponentID validate(org.opensaml.common.SignableSAMLObject o,
java.lang.String pattern)
throws ValidationException
o - The SAMLObject to be validatedpattern - A regular expression that should be used to match
component identifiers. Please note that if you give a
null or empty value, then no component identifier will
be verified.
ValidationException - Thrown if an error occurs while validation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||