com.novell.security.japi.pki
Class NPKITcrl

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

public class NPKITcrl
extends NPKIToolbox

The NPKITcrl class provides the Certificate Revocation List functions that extend the NPKIToolbox API.


Constructor Summary
NPKITcrl()
          Provides the default constructor for the CRL.
 
Method Summary
 void createContext()
          Creates a new NPKIT_CRL context structure and initializes it with default values.
 void decode(byte[] crlData, byte[][] unsignedCRL, java.lang.Integer sigAlgType, java.lang.String[] sigAlgOID, byte[][] signature, java.lang.Integer version, java.lang.String[] issuerName, java.lang.Integer thisUpdateSeconds, java.lang.Integer nextUpdateSeconds, java.lang.Integer numRevokedCertificates, java.lang.Integer numCRLExtensions)
          Decodes the specified CRL from its ASN.1 DER encoding.
 void entryExtensionInfo(int extensionIndex, java.lang.Integer x509ExtensionType, java.lang.String[] oid, java.lang.Boolean critical, byte[][] value)
          Returns the specified ASN.1 encoded extension for the CRL entry.
 void entryInfo(int index, byte[][] serialNumber, java.lang.Integer revocationSeconds, java.lang.Integer extensionNum)
          Returns the serial number, length of the serial number, the date and the time the certificate was revoked for the index specified.
 void extensionInfo(int index, java.lang.Integer x509ExtensionType, java.lang.String[] oid, java.lang.Boolean critical, byte[][] value)
          Returns information about the specified extension of the CRL (Certificate Revocation List).
 void freeContext()
          Frees a previously allocated CRL (Certificate Revocation List) context and all associated memory.
protected  void initialize()
          Initializes the PKI context.
 int invalidityDateInfo()
          Returns the invalidity date associated with the CRL entry.
 int reasonCodeInfo()
          Returns the CRL invalidity reason code associated with the CRL entry.
 
Methods inherited from class com.novell.security.japi.pki.NPKIToolbox
decodeCSR, destroy, finalize, getUTCString, loadLibrary, version
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NPKITcrl

public NPKITcrl()
         throws NPKI_Exception
Provides the default constructor for the CRL.

Throws:
NPKI_Exception - A PKI error code
Method Detail

initialize

protected void initialize()
                   throws NPKI_Exception
Description copied from class: NPKIToolbox
Initializes the PKI context.

This function must be called to instantiate PKI services.

Overrides:
initialize in class NPKIToolbox
Throws:
NPKI_Exception - Throws a PKI error code if not successful.

createContext

public void createContext()
                   throws NPKI_Exception
Creates a new NPKIT_CRL context structure and initializes it with default values.

Specified by:
createContext in class NPKIToolbox
Throws:
NPKI_Exception - Throws a PKI error code if not successful.

The initialization includes creating an NWDS context, initializing NW calls, and setting up the Unicode tables.

See Also:
freeContext, decode

freeContext

public void freeContext()
                 throws NPKI_Exception
Frees a previously allocated CRL (Certificate Revocation List) context and all associated memory.

Specified by:
freeContext in class NPKIToolbox
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
createContext

decode

public void decode(byte[] crlData,
                   byte[][] unsignedCRL,
                   java.lang.Integer sigAlgType,
                   java.lang.String[] sigAlgOID,
                   byte[][] signature,
                   java.lang.Integer version,
                   java.lang.String[] issuerName,
                   java.lang.Integer thisUpdateSeconds,
                   java.lang.Integer nextUpdateSeconds,
                   java.lang.Integer numRevokedCertificates,
                   java.lang.Integer numCRLExtensions)
            throws NPKI_Exception
Decodes the specified CRL from its ASN.1 DER encoding.

Parameters:
crlData - (IN) CRL to be decoded.
unsignedCRL - (OUT) Returns a byte array of the unsigned portion of the CRL.
sigAlgType - (OUT) Returns an Integer to the algorithm used in the signature.
sigAlgOID - (OUT) A string that has a human-readable form of the signature algorithm OID (i.e., {1 2 840 113549 1 1 1}).
signature - (OUT) Signature of the CRL.
version - (OUT) Version number of the CRL.
issuerName - (OUT) The name of the CA that issued the CRL.
thisUpdateSeconds - (OUT) Representation of the most recent date the CRL was updated.

NOTE: The time is in UTC standard time.

nextUpdateSeconds - (OUT) Representation of the date when the CRL will be updated next.

NOTE: Represented as the number of seconds since 00:00:00 UTC January 1, 1970.

numRevokedCertificates - (OUT) Number of revoked certificates in the CRL.
numCRLExtensions - (OUT) Number of extensions associated with the CRL.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
createContext, freeContext, entryInfo, extensionInfo

entryExtensionInfo

public void entryExtensionInfo(int extensionIndex,
                               java.lang.Integer x509ExtensionType,
                               java.lang.String[] oid,
                               java.lang.Boolean critical,
                               byte[][] value)
                        throws NPKI_Exception
Returns the specified ASN.1 encoded extension for the CRL entry.

A successful call to decode followed by a successful call to entryInfo must have previously been made. The extension retrieved in this call is for the entry specified in the successful call to entryInfo.

Parameters:
extensionIndex - (IN) Indicates which extension is to be returned.

NOTE: index is 0 based.

x509ExtensionType - (OUT) Returns an Integer of the extension type of the extension indicated by the extensionIndex. See extension types in Subject Alternative Names Extension.
oid - (OUT) A String representation of the OID (Object Identifier).
critical - (OUT) Returns whether the extension is critical or not.
value - (OUT) Returns a byte array of the ASN.1 encoded value of the extension.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
decode, entryInfo, reasonCodeInfo(), invalidityDateInfo

entryInfo

public void entryInfo(int index,
                      byte[][] serialNumber,
                      java.lang.Integer revocationSeconds,
                      java.lang.Integer extensionNum)
               throws NPKI_Exception
Returns the serial number, length of the serial number, the date and the time the certificate was revoked for the index specified.

A successful call to decode must be made prior to making this call. Subsequent calls to entryExtensionInfo can be made to retrieve the CRL entry extension information for each of the CRL entry extensions identified in numberOfCRLEntryExtensions.

Parameters:
index - (IN) Indicates which Certificate Revocation List entry information is to be returned.

NOTE: Index is 0 based.

serialNumber - (OUT) Returns a byte array of the serial number of the specified revoked certificate.
revocationSeconds - (OUT) Returns an Integer representation of the time and date the specified certificate was revoked.

NOTE: Represented as the number of seconds since 00:00:00 UTC January 1, 1970.

extensionNum - (OUT) Returns the number of extensions of the specified certificate.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
decode, entryExtensionInfo, reasonCodeInfo, invalidityDateInfo

extensionInfo

public void extensionInfo(int index,
                          java.lang.Integer x509ExtensionType,
                          java.lang.String[] oid,
                          java.lang.Boolean critical,
                          byte[][] value)
                   throws NPKI_Exception
Returns information about the specified extension of the CRL (Certificate Revocation List).

A successful call to decode must be made prior to making this call.

Parameters:
index - (IN) Indicates which Certificate Revocation List extension is to be returned.

NOTE: Index is 0 based.

x509ExtensionType - (OUT) Returns an Integer to the extension type.
oid - (OUT) A String representation of the OID (Object Identifier) that identifies the extension.
critical - (OUT) Returns whether the extension is critical or not.
value - (OUT) Returns a byte array of the ASN.1 encoded value of the extension indicated by the index.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
decode

invalidityDateInfo

public int invalidityDateInfo()
                       throws NPKI_Exception
Returns the invalidity date associated with the CRL entry.

A successful call to decode followed by a successful call to entryExtensionInfo must have previously been made. The invalidity date retrieved in this call is for the entry specified in the successful call to entryInfo.

NOTE: The invalidity date is an optional extension, so not all CRL entrys will have an associated invalidity date.

Returns:
Integer representation of the time and date the certificate became invalid.

NOTE: Represented as the number of seconds since 00:00:00 UTC January 1, 1970.

Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
extensionInfo, decode, entryInfo

reasonCodeInfo

public int reasonCodeInfo()
                   throws NPKI_Exception
Returns the CRL invalidity reason code associated with the CRL entry.

A successful call to decode followed by a successful call to entryInfo must have previously been made. The reason code retrieved in this call is for the entry specified in the successful call to entryInfo.

Returns:
The reason why the certificate is on the CRL, as defined below:
  • PKI_UNSPECIFIED - No reason is specified for the revocation.
  • PKI_KEY_COMPROMISED - The certificate's private key has been compromised.
  • PKI_CA_COMPROMISED - The Certificate Authority's private key has been compromised.
  • PKI_AFFILIATION_CHANGED - The subject of the certificate is no longer affilated with the issuer of the certificate.
  • PKI_SUPERSEDED - A new certificate has been issued.
  • PKI_CESSATION_OF_OPERATION - The Certificate Authority is no longer operating.
  • PKI_CERTIFICATE_HOLD - The certificate is temporarily on hold.
  • PKI_REMOVE_FROM_CRL - N/A
  • PKI_PRIVILEDGE_WITHDRAWN - The subject of the certificate no longer has priviledges.
  • PKI_AA_COMPROMISE - N/A
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
decode, entryInfo, entryExtensionInfo