org.glite.security.util.proxy
Class ProxyRestrictionData

java.lang.Object
  extended by org.glite.security.util.proxy.ProxyRestrictionData

public class ProxyRestrictionData
extends java.lang.Object

An utility class for defining the allowed address space, used both to define the from and to restrictions.

Author:
joni.hahkala@cern.ch

Constructor Summary
ProxyRestrictionData(byte[] bytes)
          Parses the restriction data from byte array.
 
Method Summary
 void addIPAddressWithNetmask(java.lang.String address)
          Adds a new IP addressSpace to the data structure.
 org.bouncycastle.asn1.x509.GeneralNames getGeneralNames()
          Returns the GeneralNames structure of the restrictions.
 java.util.Vector<java.lang.String> getIPSpaces()
          Returns a Vector of IP address spaces as defined in rfc 4632.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyRestrictionData

public ProxyRestrictionData(byte[] bytes)
                     throws java.io.IOException
Parses the restriction data from byte array.

Parameters:
bytes - The byte array to parse.
Throws:
java.io.IOException - In case there is a problem parsing the certificate.
Method Detail

addIPAddressWithNetmask

public void addIPAddressWithNetmask(java.lang.String address)
Adds a new IP addressSpace to the data structure.

Parameters:
address - The address space to add to the allowed ip address space. Example of the format: 192.168.0.0/16. Which equals a 192.168.0.0 with a net mask 255.255.0.0. A single IP address can be defined as xxx.xxx.xxx.xxx/32.
See RFC 4632. The restriction is of the format used for NameConstraints, meaning GeneralName with 8 octets for ipv4 and 32 octets for ipv6 addresses.

getGeneralNames

public org.bouncycastle.asn1.x509.GeneralNames getGeneralNames()
Returns the GeneralNames structure of the restrictions.

Returns:
The GeneralNames class containing the allowed namespaces.

getIPSpaces

public java.util.Vector<java.lang.String> getIPSpaces()
Returns a Vector of IP address spaces as defined in rfc 4632.

Returns:
The vector of address spaces defined in this structure.