|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcryptix.pki.KeyID
A KeyID is an identification of a key, usually by a hash.
Constructor Summary | |
protected |
KeyID(java.lang.String type)
Create a new KeyID object with the given type. |
Method Summary | |
abstract java.lang.Object |
clone()
Return a clone of this object |
abstract boolean |
equals(java.lang.Object other)
Do an equality comparison. |
abstract byte[] |
getBytes()
Returns the full keyID as a byte array. |
abstract byte[] |
getBytes(int len)
Returns a byte array of len bytes containing a reduced keyID. |
abstract int |
getLength()
Returns the length of the contained KeyID. |
java.lang.String |
getType()
Returns the type of this keyID. |
int |
hashCode()
Returns a hashCode for this object based on the byte[]s returned by getBytes(4). |
abstract boolean |
match(java.security.Key other)
Matches this keyID to a key. |
abstract boolean |
match(KeyID other)
Matches this keyID to another. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected KeyID(java.lang.String type)
Method Detail |
public int hashCode()
public final java.lang.String getType()
public abstract java.lang.Object clone()
public abstract int getLength()
This is the maximum number of bytes the getBytes(int) method can return.
public abstract byte[] getBytes()
public abstract byte[] getBytes(int len)
This method reduces the output of getBytes() in a format specific way to len bytes.
E.g. for OpenPGP getBytes(4) and getBytes(8) would return the 32-bit and 64-bit key ID's, being the least significant bits of the full 160-bit fingerprint.
len
- the number of bytes to return
java.lang.IllegalArgumentException
- for unsupported lengthspublic abstract boolean equals(java.lang.Object other)
Note that this is an exact equality match. See the match(...) methods for if you want to match partial keyID's.
public abstract boolean match(KeyID other)
This method differs from equals in that it can do a reduced match: if for example only 32 bits are available in one keyID, while 160 bits are available in the other, then this method can still return true if the 32 bits match.
java.lang.IllegalArgumentException
- if other is of an incorrect typepublic abstract boolean match(java.security.Key other)
This method differs from equals in that it can do a reduced match: if for example only 32 bits are available in this keyID, while the full keyID of a key is 160 bits, then this method can still return true if the 32 bits match.
java.lang.IllegalArgumentException
- if other is of an incorrect type
|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |