Methods Summary |
---|
public boolean | equals(java.lang.Object o)Compares object with OID for equality.
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
return Arrays.equals(oid, ((ObjectIdentifier) o).oid);
|
public java.lang.Object | getGroup()Gets OID's group.
return group;
|
public java.lang.String | getName()Gets OID's name.
return name;
|
public int[] | getOid()Gets OID.
return oid;
|
public int | hashCode()
if (hash == -1) {
hash = hashIntArray(oid);
}
return hash;
|
public static int | hashIntArray(int[] array)Returns hash code for array of integers
int intHash = 0;
for (int i = 0; i < array.length && i < 4; i++) {
intHash += array[i] << (8 * i); //TODO what about to find better one?
}
return intHash & 0x7FFFFFFF; // only positive
|
public java.lang.String | toOIDString()Add "OID." to the beginning of string representation.
if (sOID == null) {
sOID = "OID." + toString(); //$NON-NLS-1$
}
return sOID;
|
public java.lang.String | toString()Overrides Object.toString()
if (soid == null) {
StringBuffer sb = new StringBuffer(4 * oid.length);
for (int i = 0; i < oid.length - 1; ++i) {
sb.append(oid[i]);
sb.append('.");
}
sb.append(oid[oid.length - 1]);
soid = sb.toString();
}
return soid;
|
public static void | validateOid(int[] oid)Validates ObjectIdentifier (OID).
if (oid == null) {
throw new NullPointerException(Messages.getString("security.98")); //$NON-NLS-1$
}
if (oid.length < 2) {
throw new IllegalArgumentException(
Messages.getString("security.99")); //$NON-NLS-1$
}
if (oid[0] > 2) {
throw new IllegalArgumentException(
Messages.getString("security.9A")); //$NON-NLS-1$
} else if (oid[0] != 2 && oid[1] > 39) {
throw new IllegalArgumentException(
Messages.getString("security.9B")); //$NON-NLS-1$
}
|