com.novell.security.japi.pki
Class NPKI_ASN1_Extensions

java.lang.Object
  |
  +--com.novell.security.japi.pki.NPKI_ASN1_Extensions

public class NPKI_ASN1_Extensions
extends java.lang.Object

Specifies one or more generic ASN.1 encoded extensions to add to the certificate.

The extensions of a X.509 certificate provide a generic way to include information in the certificate. Currently the API provides explicit support for four X.509 extensions: Key Usage, Basic Constraints, Subject Alternative Name, and the Novell Security Attributes.

In addition, the API currently supports the ability to include any generic ASN.1 encoded extension(s) when generating server and user certificates. In order to provide a generic method of specifying data for X.509 extensions, the API provides general-purpose data structures and defines, as well as extension specific data structures and defines.


Field Summary
 java.util.Vector m_extension
           
 
Constructor Summary
NPKI_ASN1_Extensions()
          Constructor.
 
Method Summary
 void addExtension(com.novell.security.japi.pki.NPKI_Extension extension)
          Adds an extension to a certificate.
 com.novell.security.japi.pki.NPKI_Extension getExtension(int extensionNumber)
          Retrieves the ASN.1 encoded certificate extension specified by extensionNumber.
 int getNumberOfExtensions()
          Gets number of extensions.
 boolean removeExtension(com.novell.security.japi.pki.NPKI_Extension extension)
          Removes extension defined by extension.
 void removeExtensionAt(int extensionNumber)
          Removes the ASN.1 encoded certificate extension specified by extensionNumber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_extension

public java.util.Vector m_extension
Constructor Detail

NPKI_ASN1_Extensions

public NPKI_ASN1_Extensions()
                     throws java.io.IOException
Constructor.

Throws:
java.io.IOException - if an I/O exception occurs
Method Detail

addExtension

public void addExtension(com.novell.security.japi.pki.NPKI_Extension extension)
Adds an extension to a certificate.

Parameters:
extension - One of the ASN.1 encoded extensions to include.

getExtension

public com.novell.security.japi.pki.NPKI_Extension getExtension(int extensionNumber)
                                                         throws java.lang.ArrayIndexOutOfBoundsException
Retrieves the ASN.1 encoded certificate extension specified by extensionNumber.

Parameters:
extensionNumber - Index of the extension to be retrieved.
Returns:
The NPKI_Extension object representing the ASN.1 encoded extension.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the extensionNumber is greater than the number of extensions being added.

removeExtension

public boolean removeExtension(com.novell.security.japi.pki.NPKI_Extension extension)
Removes extension defined by extension.

Parameters:
extension - The NPKI_Extension object to be removed.
Returns:
true on success, false on failure.

removeExtensionAt

public void removeExtensionAt(int extensionNumber)
                       throws java.lang.ArrayIndexOutOfBoundsException
Removes the ASN.1 encoded certificate extension specified by extensionNumber.

Parameters:
extensionNumber - Index of the extension to be removed.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the extensionNumber is greater than the number of extensions added.

getNumberOfExtensions

public int getNumberOfExtensions()
Gets number of extensions.

Returns:
Number of extensions already added.