Cryptix OpenPGP

cryptix.openpgp
Class PGPKey

java.lang.Object
  extended bycryptix.openpgp.PGPKey
All Implemented Interfaces:
java.security.Key, java.io.Serializable
Direct Known Subclasses:
PGPPrivateKey, PGPPublicKey

public abstract class PGPKey
extends java.lang.Object
implements java.security.Key

OpenPGP Key.

Version:
$Revision: 1.5 $
Author:
Ingo Luetkebohle, Edwin Woudt
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected PGPKey(cryptix.openpgp.packet.PGPKeyPacket pkt, java.lang.String algorithm)
          Constructor that takes a packet and a format string.
 
Method Summary
 boolean equals(java.lang.Object other)
          Returns if two PGPKeys are equal
 java.lang.String getAlgorithm()
          Returns the algorithm of this key.
 int getBitLength()
          Return the bitlength of this key
 byte[] getEncoded()
          Returns this key in encoded form.
 java.lang.String getFormat()
          Returns the format of this key.
 cryptix.openpgp.packet.PGPKeyPacket getPacket()
          Return the contained keypacket Note: packets are part of the low-level API.
 boolean isLegacy()
          Returns whether this is a legacy key
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPKey

protected PGPKey(cryptix.openpgp.packet.PGPKeyPacket pkt,
                 java.lang.String algorithm)
Constructor that takes a packet and a format string.

Parameters:
pkt - the packet that contains the data for this key.
algorithm - the string to be returned by the getAlgorithm() method.
Method Detail

getEncoded

public byte[] getEncoded()
Returns this key in encoded form.

Note: this just returns the key itself, without any userid's or certificates. See KeyBundle for that functionality.

Specified by:
getEncoded in interface java.security.Key

getFormat

public java.lang.String getFormat()
Returns the format of this key.

Always returns "OpenPGP".

Specified by:
getFormat in interface java.security.Key

getAlgorithm

public java.lang.String getAlgorithm()
Returns the algorithm of this key.

Specified by:
getAlgorithm in interface java.security.Key

equals

public boolean equals(java.lang.Object other)
Returns if two PGPKeys are equal


getBitLength

public int getBitLength()
Return the bitlength of this key


getPacket

public cryptix.openpgp.packet.PGPKeyPacket getPacket()
Return the contained keypacket

Note: packets are part of the low-level API. Normally you don't need to use this method as other options are available.


isLegacy

public boolean isLegacy()
Returns whether this is a legacy key


Cryptix OpenPGP

Copyright (C) 1999-2003 The Cryptix Foundation Ltd.