com.rsa.certj

Class CertJUtils

java.lang.Object
  |
  +--com.rsa.certj.CertJUtils

public class CertJUtils
extends Object

This class provides methods that are useful to various Cert-J operations, such as byte array manipulations, or Vector manipulations.

Copyright © RSA Security Inc., 1999-2001. All rights reserved.


Constructor Summary

CertJUtils()

 

 

Method Summary

static boolean

byteArraysEqual(byte[] array1, byte[] array2)

Checks if the contents of two byte arrays, array1 and array2, are equal.

static boolean

byteArraysEqual(byte[] array1, int offset1, int len1, byte[] array2)

Checks if the contents of two byte arrays, array1 and array2, are equal.

static boolean

byteArraysEqual(byte[] array1, int offset1, int len1, byte[] array2, int offset2, int len2)

Checks if the contents of two byte arrays, array1 and array2, are equal.

static boolean

compareExtensions(X509V3Extensions rule, X509V3Extensions extensions)

Compares two groups of extensions to see if the first group of extensions is contained in the second.

static boolean

containsByteArray(Vector list, byte[] byteArray)

Checks if list contains the byte array, byteArray.

static boolean

containsExtension(X509V3Extension extension, X509V3Extensions extensions)

Determines whether extensions contains the extension extension.

static void

intersectByteArrayLists(Vector dest, Vector source)

Constructs the intersection of dest and source, which are byte arrays that contain lists.

static void

intersectLists(Vector dest, Vector source)

Constructs the intersection of dest and source, which are byte arrays that contain lists.

static void

mergeLists(Vector dest, Vector source)

Moves every entry in source to dest unless the entry is already in dest.

static boolean

sequencesEqual(Vector seq1, Vector seq2)

Checks whether ordered sequences seq1 and seq2 are equal.

static boolean

setsEqual(Vector set1, Vector set2)

Checks whether sets set1 and set2 are equal.

static void

subtractLists(Vector dest, Vector source)

Removes any entry in dest that is also in source.

static void

uniteByteArrayLists(Vector dest, Vector source)

Constructs the union of dest and source which are byte arrays that contain lists.

static void

uniteLists(Vector dest, Vector source)

Constructs the union of dest and source, which are byte arrays that contain lists.

 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CertJUtils

public CertJUtils()
Method Detail

mergeLists

public static void mergeLists(Vector dest,
                              Vector source)
Moves every entry in source to dest unless the entry is already in dest. The order of the transferred entries is preserved.

Parameters

         dest  

A Vector where the merged list will be constructed.

         source  

A Vector containing a byte array of lists to merge into dest.


subtractLists

public static void subtractLists(Vector dest,
                                 Vector source)
Removes any entry in dest that is also in source.

Parameters

         dest  

A Vector where the subtracted list will be constructed.

         source  

A Vector to subtract from dest.


intersectLists

public static void intersectLists(Vector dest,
                                  Vector source)
Constructs the intersection of dest and source, which are byte arrays that contain lists. The resulting list is stored in dest.

Parameters

         dest  

A Vector containing a byte array of lists where the intersection of the two lists will be constructed.

         source  

A Vector containing a byte array of lists to intersect with dest.


uniteLists

public static void uniteLists(Vector dest,
                              Vector source)
Constructs the union of dest and source, which are byte arrays that contain lists. The resulting list is stored in dest.

Parameters

         dest  

A Vector containing a byte array of lists where the union of the two arrays will be constructed.

         source  

A Vector containing a byte array of lists to unite with dest.


byteArraysEqual

public static boolean byteArraysEqual(byte[] array1,
                                      byte[] array2)
Checks if the contents of two byte arrays, array1 and array2, are equal.

Parameters

         array1  

A byte array.

         array2  

A byte array.

Returns

true if the two byte arrays are equal, false otherwise.

byteArraysEqual

public static boolean byteArraysEqual(byte[] array1,
                                      int offset1,
                                      int len1,
                                      byte[] array2)
Checks if the contents of two byte arrays, array1 and array2, are equal.

Parameters

         array1  

A byte array.

         offset1  

An int offset in array1.

         len1  

An int containing relevant data length in array1.

         array2  

A byte array.

Returns

true if the two byte arrays are equal in size and contents, false otherwise.

byteArraysEqual

public static boolean byteArraysEqual(byte[] array1,
                                      int offset1,
                                      int len1,
                                      byte[] array2,
                                      int offset2,
                                      int len2)
Checks if the contents of two byte arrays, array1 and array2, are equal.

Parameters

         array1  

A byte array.

         offset1  

An int offset in array1.

         len1  

An int containing relevant data length in array1.

         array2  

A byte array.

         offset2  

An int offset in array2.

         len2  

An int containing relevant data length in array2.

Returns

true if the two byte arrays are equal in size and contents, false otherwise.

containsByteArray

public static boolean containsByteArray(Vector list,
                                        byte[] byteArray)
Checks if list contains the byte array, byteArray.

Parameters

         list  

A Vector that contains byte arrays.

         byteArray  

The byte array to find in list.

Returns

true if list contains byteArray, false otherwise.

intersectByteArrayLists

public static void intersectByteArrayLists(Vector dest,
                                           Vector source)
Constructs the intersection of dest and source, which are byte arrays that contain lists. The resulting list is stored in dest.

Parameters

         dest  

A Vector containing a byte array of lists where the intersection of the two lists will be constructed.

         source  

A Vector containing a byte array of lists to intersect with dest.


uniteByteArrayLists

public static void uniteByteArrayLists(Vector dest,
                                       Vector source)
Constructs the union of dest and source which are byte arrays that contain lists. The result will be stored in dest.

Parameters

         dest  

A Vector containing a byte array of lists where the union of the two arrays will be constructed.

         source  

A Vector containing a byte array of lists to unite with dest.


sequencesEqual

public static boolean sequencesEqual(Vector seq1,
                                     Vector seq2)
Checks whether ordered sequences seq1 and seq2 are equal.

Parameters

         seq1  

A Vector containing ordered sequences.

         seq2  

A Vector containing ordered sequences.

Returns

true if the two sequences are equal, false otherwise.

setsEqual

public static boolean setsEqual(Vector set1,
                                Vector set2)
Checks whether sets set1 and set2 are equal.

Parameters

         set1  

A Vector containing a set.

         set2  

A Vector containing a set.

Returns

true if the two sets are equal, false otherwise.

containsExtension

public static boolean containsExtension(X509V3Extension extension,
                                        X509V3Extensions extensions)
Determines whether extensions contains the extension extension. The comparison is made by using the equals method between the extension and each component of extensions.

Parameters

         extension  

An X509V3Extension extension to find in extensions.

         extensions  

The X509V3Extensions to check for extension.

Returns

true if extension is contained in extensions, false otherwise.

compareExtensions

public static boolean compareExtensions(X509V3Extensions rule,
                                        X509V3Extensions extensions)
Compares two groups of extensions to see if the first group of extensions is contained in the second. The comparison is made by calling containsExtension using each component of rule and extensions as the arguments.

Parameters

         rule  

An X509V3Extensions object indicating a list of extensions that must be contained within extensions.

         extensions  

An X509V3Extensions object indicating a list of extensions that is checked against rule. Every extension in rule must be contained in this object.

Returns

true If extensions contains all the extensions in rule, false otherwise.

See Also

(com.rsa.certj.cert.extensions.X509V3Extension, com.rsa.certj.cert.X509V3Extensions)


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000