iaik.x509.extensions
Class InfoAccess

java.lang.Object
  |
  +--iaik.x509.V3Extension
        |
        +--iaik.x509.extensions.InfoAccess
Direct Known Subclasses:
AuthorityInfoAccess, SubjectInfoAccess

public abstract class InfoAccess
extends V3Extension

Abstract super class for the AuthorityInfoAccess and SubjectInfoAccess extensions.

The X.509 Certificate and CRL profile presented in RFC 2459 specifies the AuthorityInfoAccess extension for identifiying how to access CA information and services for the issuer of the certificate in which the extension appears. The SubjectInfoAccess extensions has been introduced by RFC 2459 successordraft-ietf-pkix-new-part1-06.txt for indicating how to access information and services for the subject of the certificate in which the extension appears. The ASN.1 syntax is almost identical:

 AuthorityInfoAccessSyntax  ::=
          SEQUENCE SIZE (1..MAX) OF AccessDescription

 AccessDescription  ::=  SEQUENCE {
          accessMethod          OBJECT IDENTIFIER,
          accessLocation        GeneralName  }
 

respectively:

 SubjectInfoAccessSyntax  ::=
         SEQUENCE SIZE (1..MAX) OF AccessDescription

 AccessDescription  ::=  SEQUENCE {
         accessMethod          OBJECT IDENTIFIER,
          accessLocation        GeneralName  }
 
This class provides the base functionality for setting/getting AccessDescription terms for both, AuthorityInfoAccess and SubjectInfoAccess extensions, e.g.:

 ObjectID accessMethod = ObjectID.caIssuers;
 GeneralName accessLocation = ...;
 AccessDescription accessDescription = new AccessDescription(accessMethod, accessLocation);
 AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess();
 authorityInfoAccess.addAccessDescription(accessDescription);
 

respectively:

 ObjectID accessMethod = ObjectID.caRepository;
 GeneralName accessLocation = ...;
 AccessDescription accessDescription = new AccessDescription(accessMethod, accessLocation);
 SubjectInfoAccess subjectInfoAccess = new SubjectInfoAccess()
 subjectInfoAccess.addAccessDescription(accessDescription);
 

Any further access description can be added by using the addAccessDescription method:

 authorityInfoAccess.addAccessDescription(...);
 ...
 
For adding a AuthorityInfoAccess/SubjectInfoAccess extension object to a X509Certificate, use the addExtension method of the X509Certificate class:

 X505Certificate cert = new X509Certificate();
   ...
 cert.addExtension(authorityInfoAccess);
 

Version:
File Revision 8
See Also:
AccessDescription, GeneralName, ObjectID, V3Extension, X509Extensions, X509Certificate, AuthorityInfoAccess, SubjectInfoAccess

Fields inherited from class iaik.x509.V3Extension
critical
 
Constructor Summary
InfoAccess()
          Default constructor.
InfoAccess(AccessDescription accessDescription)
          Creates an InfoAccess object and adds a AccessDescription.
 
Method Summary
 void addAccessDescription(AccessDescription accessDescription)
          Adds a accessDescription to this InfoAccess extension.
 AccessDescription getAccessDescription(ObjectID accessMethod)
          Returns the AccessDescription with the requested AccessMethod, if inlcuded.
 Enumeration getAccessDescriptions()
          Returns an enumeration of the access descriptions included into this InfoAccess object.
 void init(ASN1Object obj)
          Inits this InfoAccess implementation with an ASN1object representing the value of this extension.
 void removeAllAccessDescriptions()
          Removes all access descriptions from this InfoAccess extension.
 ASN1Object toASN1Object()
          Returns an ASN1Object representing the value of this InfoAccess object.
 String toString()
          Returns a string that represents the contents of this InfoAccess object.
 
Methods inherited from class iaik.x509.V3Extension
getName, getObjectID, hashCode, isCritical, setCritical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InfoAccess

public InfoAccess()
Default constructor. Creates an empty InfoAccess object.

For adding a access description use the addAccessDescription method. Any AccessDescription to be added has to be of type iaik.asn1.structures.AccessDescription, e.g.:

 ObjectID accessMethod = ObjectID.caIssuers;
 GeneralName accessLocation = ...;
 AccessDescription accessDescription = new AccessDescription(accessMethod, accessLocation);
 AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess();
 authorityInfoAccess.addAccessDescription(accessDescription);
 ...
 

See Also:
AccessDescription

InfoAccess

public InfoAccess(AccessDescription accessDescription)
           throws IllegalArgumentException
Creates an InfoAccess object and adds a AccessDescription.

The AccessDescription to be added has to be of type iaik.asn1.structures.AccessDescription, e.g.:

 ObjectID accessMethod = ObjectID.caIssuers;
 GeneralName accessLocation = ...;
 AccessDescription accessDescription = new AccessDescription(accessMethod, accessLocation);
 AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess(accessDescription);
 ...
 

Parameters:
accessDescription - the AccessDescription to add
Throws:
IllegalArgumentException - if a null object is supplied
See Also:
AccessDescription
Method Detail

init

public void init(ASN1Object obj)
          throws X509ExtensionException
Inits this InfoAccess implementation with an ASN1object representing the value of this extension.

The given ASN1Object consits of a Sequence of access descriptions included in the InfoAccess object.

The given ASN1Object is the one created by toASN1Object().

This method is used by the X509Extensions class when parsing the ASN.1 representation of a certificate for properly initializing an included AuthorityInfoAccess/SubjectInfoAcsess extension. This method initializes the extension only with its value, but not with its critical specification. For that reason, this method shall not be explicitly called by an application.

Overrides:
init in class V3Extension
Parameters:
obj - the InfoAccess as ASN1Object
Throws:
X509ExtensionException - if the extension could not be parsed

toASN1Object

public ASN1Object toASN1Object()
                        throws X509ExtensionException
Returns an ASN1Object representing the value of this InfoAccess object.

The ASN1Object is an ASN.1 Sequence including any access description that has been added to this InfoAccess object.

Overrides:
toASN1Object in class V3Extension
Returns:
the value of this InfoAccess as ASN1Object

addAccessDescription

public void addAccessDescription(AccessDescription accessDescription)
                          throws IllegalArgumentException
Adds a accessDescription to this InfoAccess extension. The accessDescription to be added has to be of type iaik.asn1.structures.AccessDescription, e.g.:

 ObjectID accessMethod = ObjectID.caIssuers;
 GeneralName accessLocation = ...;
 AccessDescription accessDescription = new AccessDescription(accessMethod, accessLocation);
 AuthorityInfoAccess authorityInfoAccess = new AuthorityInfoAccess();
 authorityInfoAccess.addAccessDescription(accessDescription);
 ...
 

Parameters:
dp - the access description to add
Throws:
IllegalArgumentException - if a null object is supplied
See Also:
AccessDescription

removeAllAccessDescriptions

public void removeAllAccessDescriptions()
Removes all access descriptions from this InfoAccess extension.

getAccessDescriptions

public Enumeration getAccessDescriptions()
Returns an enumeration of the access descriptions included into this InfoAccess object.
Returns:
an enumeration of the access descriptions

getAccessDescription

public AccessDescription getAccessDescription(ObjectID accessMethod)
Returns the AccessDescription with the requested AccessMethod, if inlcuded.
Returns:
the AccessDescription with the requested AccessMethod, if inlcuded; otherwise null

toString

public String toString()
Returns a string that represents the contents of this InfoAccess object.
Overrides:
toString in class Object
Returns:
the string representation

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK