org.logi.crypto.keys
Class K
java.lang.Object
|
+--org.logi.crypto.Crypto
|
+--org.logi.crypto.keys.K
- All Implemented Interfaces:
- Key, PrettyPrintable
- Direct Known Subclasses:
- DHKey, RSAKey, SymmetricKey
- public abstract class K
- extends Crypto
- implements Key
This abstract class implements some of the methods from the Key interface.
It is used as the superclass of all the key classes in logi.crypto.
You should (probably) never declare variables of this type, but rather of the
more abstract Key interface, since there might be key objects which do not
inherit from this class.
- Author:
- Logi Ragnarsson
(logir@logi.org)
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Methods inherited from class org.logi.crypto.Crypto |
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
K
public K()
getFingerprint
public final Fingerprint getFingerprint()
- Return the key's fingerprint using the default hash function.
- Specified by:
getFingerprint
in interface Key
getFingerprint
public final Fingerprint getFingerprint(java.lang.String algorithm)
throws InvalidCDSException
- Return the key's fingerprint using the specified hash function.
- Specified by:
getFingerprint
in interface Key
- Throws:
InvalidCDSException
- if the specified hash function is not
available.
matchFingerprint
public Fingerprint matchFingerprint()
- Returns the default fingerprint of the matching key in the key-pair.
- Specified by:
matchFingerprint
in interface Key
matchFingerprint
public Fingerprint matchFingerprint(java.lang.String algorithm)
throws InvalidCDSException
- Returns the default fingerprint of the matching key in the key-pair.
- Specified by:
matchFingerprint
in interface Key
- Throws:
InvalidCDSException
- if the specified hash function is not
available.
hashCode
public final int hashCode()
- Return a hash-code based on the keys SHA1 fingerprint.
- Specified by:
hashCode
in interface Key
- Overrides:
hashCode
in class java.lang.Object
Copyright 1997-2000 Logi Ragnarsson