com.ibm.security.certclient.base
Class PkAttr
- java.lang.Object
com.ibm.security.certclient.base.PkAttr
- public final class PkAttr
- extends Object
- implements PkAttrKind, Serializable, Cloneable, Comparable
PkAttr
represents a single (name, kind, value):
triple.
The name
is a String
. Possibly the string representation
of an OID, or one of the constants defined by the interfaces extended by
PkConstants
, but that is not enforced by PkAttr
.
The kind
is a scalar whose bits are used to represent
characteristics of the attribute. Constants are defined in PkAttrKind
.
The value
is an Object
. This class does not
impose any specific requirements on the value. However, For a given
name
, the value
should be an instance of a specific class.
The interfaces that define names that apply to PkAttr
s document the
valid class for each name
.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
NULL
Used as a marker for attributes that don't exist.
|
Fields inherited from interface com.ibm.security.certclient.base.PkAttrKind |
---|
ATTR_APPLIED, ATTR_APPROVED, ATTR_NAMES |
Constructor Summary
Constructor and Description |
---|
PkAttr(String name)
Create a new mutable
PkAttr .
|
PkAttr(String name,int kind,Object value)
Create a new mutable
PkAttr .
|
PkAttr(String name,int kind,Object value,boolean readOnly)
Create a new
PkAttr .
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
compareTo(Object other)
Compares against another attribute.
|
|
compareTo(PkAttr other)
Compares against another attribute.
|
|
equals(Object obj)
Returns true if and only if this attribute is equal to
obj .
|
|
getKind()
Returns the kind.
|
getName()
Returns the name of this attribute.
|
|
getString()
Returns the value of this attribute as a
String .
|
|
getValue()
Returns the value of this attribute as an
Object .
|
|
|
hashCode()
Returns a hashCode for the attribute that is consistent with the
definition of equality as implemented in the
equals method.
|
|
isApplied()
Is this attribute meant for the cert or CRL?
|
|
isApproved()
Has this attribute been approved by the current process (EE, RA or
CA)?
|
|
isNameOid()
Returns true if and only if the name of this attribute is an OID.
|
|
setApplied(boolean b)
Turns on the
PkAttrKind.ATTR_APPLIED bit for this attribute.
|
|
setApproved(boolean b)
Turns on the
PkAttrKind.ATTR_APPROVED bit for this attribute.
|
|
setKind(int kind)
Sets the kind of this attribute.
|
|
setReadOnly()
Makes this attribute immutable.
|
|
setValue(Object value)
Sets the value of this attribute.
|
toString()
Returns a string representation of this event.
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail
NULL
- public static final PkAttr NULL
Constructor Detail
PkAttr
- public PkAttr(String name)
PkAttr
. Tha kind
is 0 and the
value
is null
.
name
- The attribute name. PkAttr
PkAttr
.
name
- The attribute name. kind
- The attribute kind. value
- The attribute value. PkAttr
PkAttr
.
name
- The attribute name. kind
- The attribute kind. value
- The attribute value. readOnly
- If true
, the new attribute is immutable, else
it is mutable. Method Detail
getKind
- public int getKind()
isApplied
- public boolean isApplied()
Only attributes meant for the cert or CRL are placed in certs or CRLs.
That is, when the PkCertGen
bean generates
a certificate, it only places in the certificate those attributes that
are marked as applied and approved.
isApproved
- public boolean isApproved()
Only attributes that have been approved are placed in certs or CRLs, in
addition, only attributes that have been approved are written by the
formatting beans. This implies that only approved attributes are sent
by client beans--For example by the TcpClient
bean.
getName
- public String getName()
isNameOid
- public boolean isNameOid()
getValue
- public Object getValue()
Object
.
getString
- public String getString()
String
.
setReadOnly
- public void setReadOnly()
setKind
- public void setKind(int kind)
kind
- Should be 0 or a binary OR of any subset of the constants
defined in PkAttrKind
. setApplied
- public void setApplied(boolean b)
PkAttrKind.ATTR_APPLIED
bit for this attribute.
Leaves all other bits unchanged.
setApproved
- public void setApproved(boolean b)
PkAttrKind.ATTR_APPROVED
bit for this attribute.
Leaves all other bits unchanged.
setValue
- public void setValue(Object value)
value
- The new attribute value. toString
- public String toString()
hashCode
- public int hashCode()
equals
method.
equals
- public boolean equals(Object obj)
obj
.
Two attributes are equal if their names are the same (case-sensitive)
and their kind
s have the same numeric value and their values
are the same as determined by the equals
method.
compareTo
- public int compareTo(PkAttr other)
This method implements the Comparable interface.
Note: this class has a natural ordering that is inconsistent with equals.
other
- the Object to be compared. compareTo
- public int compareTo(Object other)
This method implements the Comparable interface.
Note: this class has a natural ordering that is inconsistent with equals.
compareTo
in interface Comparable
other
- the Object to be compared. ClassCastException
- if the specified object's kind prevents it
from being compared to this Object.
PkAttrs.get
.