All Packages Class Hierarchy This Package Previous Next Index
Interface is.logi.crypto.keys.Key
- public interface Key
This interface is implemented by cryptographic keys of any type.
Any actual functionality of the keys is defined in the interfaces derived
from Key.
Classes implementing Key should be "read-only" in the same sense as the
String class and not implement any methods to change the state of the
object.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
- CipherKey, SignatureKey
-
getAlgorithm()
- Return the name of the algorithm used by this key.
-
getFingerprint()
- Return the key's SHA1 fingerprint.
-
getSize()
- Return the "size" of the key.
-
hashCode()
- Return a hash-code based on the keys SHA1 fingerprint.
-
isPrivate()
- Returns true iff this is a private key.
-
matches(Key)
- Check if a key mathces this.
-
matchFingerprint()
- Returns the fingerprint of the matching key in the key-pair.
getSize
public abstract int getSize()
- Return the "size" of the key. This is a (fairly inaccurate) measure
of how difficult it is to break and is heavily dependant on the
algorithm used.
getFingerprint
public abstract Fingerprint getFingerprint()
- Return the key's SHA1 fingerprint.
matchFingerprint
public abstract Fingerprint matchFingerprint()
- Returns the fingerprint of the matching key in the key-pair.
getAlgorithm
public abstract String getAlgorithm()
- Return the name of the algorithm used by this key.
isPrivate
public abstract boolean isPrivate()
- Returns true iff this is a private key.
hashCode
public abstract int hashCode()
- Return a hash-code based on the keys SHA1 fingerprint.
- Overrides:
- hashCode in class Object
matches
public abstract boolean matches(Key key)
- Check if a key mathces this. This is true if this and key are a matched
pair of public/private keys or the same symmetric key.
All Packages Class Hierarchy This Package Previous Next Index