Class Overview
Represent the Key Identifier ASN.1 object.
Summary
Public Methods |
boolean
|
equals(Object other)
Indicates whether some other object is "equal to" this one.
|
byte[]
|
getIdentifier()
Return the value of the KeyIdentifier as byte array.
|
int
|
hashCode()
Returns a hash code value for this object.
|
String
|
toString()
Returns a printable representation of the KeyUsage.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Public Constructors
public
KeyIdentifier
(byte[] octetString)
Create a KeyIdentifier with the passed bit settings.
Parameters
octetString
| the octet string identifying the key identifier.
|
public
KeyIdentifier
(DerValue val)
Create a KeyIdentifier from the DER encoded value.
public
KeyIdentifier
(PublicKey pubKey)
Creates a KeyIdentifier from a public-key value.
From RFC2459: Two common methods for generating key identifiers from
the public key are:
- The keyIdentifier is composed of the 160-bit SHA-1 hash of the
value of the BIT STRING subjectPublicKey (excluding the tag,
length, and number of unused bits).
- The keyIdentifier is composed of a four bit type field with
the value 0100 followed by the least significant 60 bits of the
SHA-1 hash of the value of the BIT STRING subjectPublicKey.
This method supports method 1.
Parameters
pubKey
| the public key from which to construct this KeyIdentifier |
Public Methods
public
boolean
equals
(Object other)
Indicates whether some other object is "equal to" this one.
Parameters
other
| the reference object with which to compare. |
Returns
true
if this object is the same as the obj
argument; false
otherwise.
public
byte[]
getIdentifier
()
Return the value of the KeyIdentifier as byte array.
public
int
hashCode
()
Returns a hash code value for this object.
Objects that are equal will also have the same hashcode.
Returns
- a hash code value for this object.
public
String
toString
()
Returns a printable representation of the KeyUsage.
Returns
- a string representation of the object.