org.logi.crypto.keys
Class K

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.logi.crypto.keys.K
All Implemented Interfaces:
Key
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
 
Constructor Summary
K()
           
 
Method Summary
 Fingerprint getFingerprint()
          Return the key's fingerprint using the default hash function.
 Fingerprint getFingerprint(java.lang.String algorithm)
          Return the key's fingerprint using the named hash function.
 int hashCode()
          Return a hash-code based on the keys SHA1 fingerprint.
 Fingerprint matchFingerprint()
          Returns the default fingerprint of the matching key in the key-pair.
 Fingerprint matchFingerprint(java.lang.String algorithm)
          Returns the default fingerprint of the matching key in the key-pair.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.logi.crypto.keys.Key
getAlgorithm, getSize, isPrivate, matches
 

Constructor Detail

K

public K()
Method Detail

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 named 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