cryptix.pgp
Class EncryptedSecretKey

java.lang.Object
  extended bycryptix.util.Streamable
      extended bycryptix.pgp.EncryptedSecretKey
All Implemented Interfaces:
StreamInterface

final class EncryptedSecretKey
extends Streamable

An encrypted secret key class (used by SecretKeyCertificate).

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.4 $

Since:
Cryptix 2.2 or earlier
Author:
unattributed

Constructor Summary
EncryptedSecretKey(byte[] buf)
           
EncryptedSecretKey(java.io.DataInput in)
           
EncryptedSecretKey(SecretKey sk, Passphrase passphrase, RandomStream rs)
           
 
Method Summary
 KeyID id()
          Gets the key ID.
 boolean isEncrypted()
           
 void read(java.io.DataInput in)
          Reads 'this' from the DataInput object.
 SecretKey secretKey(StreamCipher cipher)
           
 java.lang.String toString()
          Returns a string representation of only the public parts of this secret key, in hex.
 void write(java.io.DataOutput out)
          Writes 'this' to the DataOutput object.
 
Methods inherited from class cryptix.util.Streamable
load, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptedSecretKey

public EncryptedSecretKey(SecretKey sk,
                          Passphrase passphrase,
                          RandomStream rs)
                   throws java.io.IOException

EncryptedSecretKey

public EncryptedSecretKey(byte[] buf)
                   throws java.io.IOException

EncryptedSecretKey

public EncryptedSecretKey(java.io.DataInput in)
                   throws java.io.IOException
Method Detail

secretKey

public SecretKey secretKey(StreamCipher cipher)
                    throws DecryptException
Throws:
DecryptException

read

public void read(java.io.DataInput in)
          throws java.io.IOException
Description copied from interface: StreamInterface
Reads 'this' from the DataInput object.

Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from interface: StreamInterface
Writes 'this' to the DataOutput object.

Throws:
java.io.IOException

id

public final KeyID id()
Gets the key ID. This is needed to index secret key certificates by ID.

Returns:
the lower 8 bytes of n, the public modulus.

toString

public java.lang.String toString()
Returns a string representation of only the public parts of this secret key, in hex.


isEncrypted

public boolean isEncrypted()