Package org.italiangrid.voms.ac.impl

# Class DefaultVOMSACParser

java.lang.Object
org.italiangrid.voms.ac.impl.DefaultVOMSACParser

All Implemented Interfaces:
  `VOMSACParser`

Direct Known Subclasses:
  `DefaultVOMSValidator`

public class DefaultVOMSACParser extends Object implements VOMSACParser
Default implementation of the VOMS attribute certificate parsing logic. This class is responsible for extracting and normalizing VOMS attributes from a given X.509 certificate chain.

It utilizes a `VOMSACLookupStrategy` to locate attribute certificates within the provided chain and applies a `VOMSAttributesNormalizationStrategy` to normalize the extracted attributes.

By default, it uses `LeafACLookupStrategy` for lookup and `LeafVOMSExtensionNormalizationStrategy` for normalization.

## Constructor Summary

Constructors
Constructor
Description
`DefaultVOMSACParser()`
Creates a new `DefaultVOMSACParser` with the default lookup strategy.
`DefaultVOMSACParser(VOMSACLookupStrategy strategy)`
Creates a new `DefaultVOMSACParser` with a specified lookup strategy.

## Method Summary

Modifier and Type
Method
Description
`List<VOMSAttribute>`
`parse(X509Certificate[] validatedChain)`
Parses and extracts VOMS attributes from a validated X.509 certificate chain.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DefaultVOMSACParser

public DefaultVOMSACParser()
Creates a new `DefaultVOMSACParser` with the default lookup strategy. Uses `LeafACLookupStrategy` with a `NullListener` instance.

### DefaultVOMSACParser

public DefaultVOMSACParser(VOMSACLookupStrategy strategy)
Creates a new `DefaultVOMSACParser` with a specified lookup strategy. Uses `LeafVOMSExtensionNormalizationStrategy` for attribute normalization.

Parameters:
  `strategy` - the lookup strategy to use for locating attribute certificates
Throws:
  `NullPointerException` - if the provided strategy is `null`

## Method Details

### parse

public List<VOMSAttribute> parse(X509Certificate[] validatedChain)
Parses and extracts VOMS attributes from a validated X.509 certificate chain.

Specified by:
  `parse` in interface `VOMSACParser`
Parameters:
  `validatedChain` - the certificate chain to analyze
Returns:
  a list of extracted and normalized `VOMSAttribute` objects
Throws:
  `NullPointerException` - if the provided certificate chain is `null`