anon.mixminion.message
Class Keyring

java.lang.Object
  extended by anon.mixminion.message.Keyring

public class Keyring
extends java.lang.Object

Author:
Stefan Roenisch

Field Summary
(package private)  int KEY_LEN
           
(package private) static long KEY_LIFETIME
           
private  java.util.Vector m_expiring
           
private  java.util.Vector m_mykeys
           
private  java.lang.String m_password
           
private  int m_today
           
 
Constructor Summary
Keyring(java.lang.String password)
          Constructor
 
Method Summary
private  int byteToInt(byte[] b, int offset)
          Calculates the int value of a given ByteArray
 void changeKeyringPW(java.lang.String newpw)
           
 byte[] getNewSecret()
           
 java.util.Vector getUserSecrets()
           
private  byte[] makeNewKey()
          Produces a new usersecret
private  int myceil(double a, double b)
          Behaves like Math.ceil, but gives minimum 1 as value
private  java.lang.String packKeyring()
          encrypts the m_data and brings it in a ascii-armored base64 notation
private  void saveKeyRing()
          saves the keyring
private  void unpackKeyRing(java.lang.String encodeddata)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_LEN

final int KEY_LEN
See Also:
Constant Field Values

KEY_LIFETIME

static final long KEY_LIFETIME
See Also:
Constant Field Values

m_mykeys

private java.util.Vector m_mykeys

m_expiring

private java.util.Vector m_expiring

m_password

private java.lang.String m_password

m_today

private int m_today
Constructor Detail

Keyring

public Keyring(java.lang.String password)
Constructor

Parameters:
password -
Method Detail

getUserSecrets

public java.util.Vector getUserSecrets()
Returns:
a Vector with all usersecrets

getNewSecret

public byte[] getNewSecret()
Returns:
new secret as byte[]

packKeyring

private java.lang.String packKeyring()
encrypts the m_data and brings it in a ascii-armored base64 notation

Returns:
string with base64 keyring

unpackKeyRing

private void unpackKeyRing(java.lang.String encodeddata)
                    throws java.io.IOException
Throws:
java.io.IOException

makeNewKey

private byte[] makeNewKey()
Produces a new usersecret

Returns:

changeKeyringPW

public void changeKeyringPW(java.lang.String newpw)

saveKeyRing

private void saveKeyRing()
saves the keyring


byteToInt

private int byteToInt(byte[] b,
                      int offset)
Calculates the int value of a given ByteArray

Parameters:
b -
offset -
Returns:
int value of the bytearray

myceil

private int myceil(double a,
                   double b)
Behaves like Math.ceil, but gives minimum 1 as value

Parameters:
a -
b -
Returns: