com.ibm.security12.sun.security.x509
Class CRLExtensions

java.lang.Object
  |
  +--com.ibm.security12.sun.security.x509.CRLExtensions

public class CRLExtensions
extends Object

This class defines the CRL Extensions. It is used for both CRL Extensions and CRL Entry Extensions, which are defined are follows:

 TBSCertList  ::=  SEQUENCE  {
    version              Version OPTIONAL,   -- if present, must be v2
    signature            AlgorithmIdentifier,
    issuer               Name,
    thisUpdate           Time,
    nextUpdate           Time  OPTIONAL,
    revokedCertificates  SEQUENCE OF SEQUENCE  {
        userCertificate         CertificateSerialNumber,
        revocationDate          Time,
        crlEntryExtensions      Extensions OPTIONAL  -- if present, must be v2
    }  OPTIONAL,
    crlExtensions        [0] EXPLICIT Extensions OPTIONAL  -- if present, must be v2
 }
 

Version:
1.10
Author:
Hemma Prafullchandra

Constructor Summary
CRLExtensions()
          Default constructor.
CRLExtensions(DerInputStream in)
          Create the object, decoding the values from the passed DER stream.
 
Method Summary
 void decode(InputStream in)
          Decode the extensions from the InputStream.
 void delete(String alias)
          Delete the extension value with this alias.
 void encode(OutputStream out, boolean isExplicit)
          Encode the extensions in DER form to the stream.
 boolean equals(Object other)
          Compares this CRLExtensions for equality with the specified object.
 Extension get(String alias)
          Get the extension with this alias.
 Collection getAllExtensions()
          Return a collection view of the extensions.
 Enumeration getElements()
          Return an enumeration of the extensions.
 int hashCode()
          Returns a hashcode value for this CRLExtensions.
 boolean hasUnsupportedCriticalExtension()
          Return true if a critical extension is found that is not supported, otherwise return false.
 void set(String alias, Object obj)
          Set the extension value with this alias.
 String toString()
          Returns a string representation of this CRLExtensions object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "" (comma and space).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CRLExtensions

public CRLExtensions()
Default constructor.

CRLExtensions

public CRLExtensions(DerInputStream in)
              throws CRLException
Create the object, decoding the values from the passed DER stream.
Parameters:
in - the DerInputStream to read the Extension from, i.e. the sequence of extensions.
Throws:
CRLException - on decoding errors.
Method Detail

decode

public void decode(InputStream in)
            throws CRLException
Decode the extensions from the InputStream.
Parameters:
in - the InputStream to unmarshal the contents from.
Throws:
CRLException - on decoding or validity errors.

encode

public void encode(OutputStream out,
                   boolean isExplicit)
            throws CRLException
Encode the extensions in DER form to the stream.
Parameters:
out - the DerOutputStream to marshal the contents to.
isExplicit - the tag indicating whether this is an entry extension (false) or a CRL extension (true).
Throws:
CRLException - on encoding errors.

get

public Extension get(String alias)
Get the extension with this alias.
Parameters:
alias - the identifier string for the extension to retrieve.

set

public void set(String alias,
                Object obj)
Set the extension value with this alias.
Parameters:
alias - the identifier string for the extension to set.
obj - the Object to set the extension identified by the alias.

delete

public void delete(String alias)
Delete the extension value with this alias.
Parameters:
alias - the identifier string for the extension to delete.

getElements

public Enumeration getElements()
Return an enumeration of the extensions.
Returns:
an enumeration of the extensions in this CRL.

getAllExtensions

public Collection getAllExtensions()
Return a collection view of the extensions.
Returns:
a collection view of the extensions in this CRL.

hasUnsupportedCriticalExtension

public boolean hasUnsupportedCriticalExtension()
Return true if a critical extension is found that is not supported, otherwise return false.

equals

public boolean equals(Object other)
Compares this CRLExtensions for equality with the specified object. If the other object is an instanceof CRLExtensions, then all the entries are compared with the entries from this.
Parameters:
other - the object to test for equality with this CRLExtensions.
Returns:
true iff all the entries match that of the Other, false otherwise.
Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hashcode value for this CRLExtensions.
Returns:
the hashcode value.
Overrides:
hashCode in class Object

toString

public String toString()
Returns a string representation of this CRLExtensions object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "" (comma and space).

Overrides to toString method of Object.

Returns:
a string representation of this CRLExtensions.
Overrides:
toString in class Object