public class VOMSValidator extends Object
boolean isAdmin = new VOMSValidator(certChain).validate().getRoles("MyVO").contains("admin");
| Modifier and Type | Class and Description |
|---|---|
class |
VOMSValidator.FQANTree
Class to sort out the hierarchial properties of FQANs.
|
| Modifier and Type | Field and Description |
|---|---|
protected static ACValidator |
DEFAULT_VALIDATOR |
protected boolean |
isParsed |
protected boolean |
isValidated |
protected VOMSValidator.FQANTree |
myFQANTree |
protected X509Certificate[] |
myValidatedChain |
protected ACValidator |
myValidator |
protected Vector |
myVomsAttributes |
protected static ACTrustStore |
theTrustStore |
static String |
VOMS_EXT_OID |
protected static VOMSTrustStore |
vomsStore |
| Constructor and Description |
|---|
VOMSValidator(X509Certificate validatedCert)
Convenience constructor in the case where you have a single
cert and not a chain.
|
VOMSValidator(X509Certificate[] validatedChain)
Convenience constructor
Same as VOMSValidator(validatedChain, null) |
VOMSValidator(X509Certificate[] validatedChain,
ACValidator acValidator)
If
validatedChain is null, a call to
setValidatedChain() MUST be made before calling
parse() or validate(). |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleans up the object.
|
String[] |
getAllFullyQualifiedAttributes()
Returns a collection of all the FQANs in all the ACs found in the
credential, in order.
|
List |
getCapabilities(String subGroup)
Deprecated.
Capabilities are deprecated.
|
List |
getRoles(String subGroup)
Returns a list of all roles attributed to a (sub)group, by
combining all VOMS attributes in a hiearchial fashion.
|
List |
getVOMSAttributes()
Returns a list of VOMS attributes, parsed and possibly validated.
|
boolean |
isValid() |
boolean |
isValidated() |
VOMSValidator |
parse()
Deprecated.
use the parse(X509Certificate[]) instead
|
static Vector |
parse(X509Certificate[] myValidatedChain)
Parses the assumed-validated certificate chain (which may also
include proxy certs) for any occurances of VOMS extensions containing
attribute certificates issued to the end entity in the certificate
chain.
|
VOMSValidator |
setClientChain(X509Certificate[] validatedChain)
Convenience method: enables you to reuse a
VOMSValidator
instance for another client chain, thus avoiding overhead in
instantiating validators and trust stores and other potentially
expensive operations. |
static void |
setTrustStore(ACTrustStore trustStore)
Deprecated.
use setTrustStore(VOMSTrustStore trustStore) instead.
|
static void |
setTrustStore(VOMSTrustStore trustStore)
Deprecated.
|
static void |
shutdown()
Performs shutdown of the default validator object, if allocated.
|
String |
toString() |
VOMSValidator |
validate()
Parses the assumed-validated certificate chain (which may also
include proxy certs) for any occurances of VOMS extensions containing
attribute certificates issued to the end entity in the certificate
chain.
|
public static final String VOMS_EXT_OID
protected static ACTrustStore theTrustStore
protected ACValidator myValidator
protected X509Certificate[] myValidatedChain
protected Vector myVomsAttributes
protected boolean isParsed
protected boolean isValidated
protected VOMSValidator.FQANTree myFQANTree
protected static VOMSTrustStore vomsStore
protected static volatile ACValidator DEFAULT_VALIDATOR
public VOMSValidator(X509Certificate validatedCert)
validatedCert - VOMSValidator(X509Certificate[])public VOMSValidator(X509Certificate[] validatedChain)
VOMSValidator(validatedChain, null)validatedChain - public VOMSValidator(X509Certificate[] validatedChain, ACValidator acValidator)
validatedChain is null, a call to
setValidatedChain() MUST be made before calling
parse() or validate().validatedChain - The (full), validated certificate chainacValidator - The AC validator implementation to use (null is default with a BasicVOMSTrustStore)ACValidator,
BasicVOMSTrustStorepublic static void setTrustStore(ACTrustStore trustStore)
BasicVOMSTrustStoretrustStore - setTrustStore(VOMSTrustStore trustStore),
BasicVOMSTrustStorepublic static void setTrustStore(VOMSTrustStore trustStore)
trustStore - the trustStore.VOMSTrustStorepublic void cleanup()
public static void shutdown()
public VOMSValidator setClientChain(X509Certificate[] validatedChain)
VOMSValidator
instance for another client chain, thus avoiding overhead in
instantiating validators and trust stores and other potentially
expensive operations.
vomsValidator.setValidatedChain(chain).validate().getVOMSAttributes();validatedChain - The new validated certificate chain to inspectpublic static Vector parse(X509Certificate[] myValidatedChain)
validate()public VOMSValidator parse()
new VOMSValidator(certChain).parse().getVOMSAttributes();validate()public VOMSValidator validate()
new VOMSValidator(certChain).parse().getVOMSAttributes();parse()public String[] getAllFullyQualifiedAttributes()
public List getVOMSAttributes()
VOMSAttributeVOMSAttribute,
parse(),
validate(),
isValidated()public List getRoles(String subGroup)
parse() or
validate() must have been called before calling
this method. Otherwise, an IllegalStateException
is thrown.subGroup - VOMSValidator.FQANTreepublic List getCapabilities(String subGroup)
parse() or
validate() must have been called before calling
this method. Otherwise, an IllegalStateException
is thrown.subGroup - VOMSValidator.FQANTreepublic boolean isValidated()
validate()public boolean isValid()
Copyright © 2014. All rights reserved.