Class cryptix.security.rsa.PublicKey
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.security.rsa.PublicKey

java.lang.Object
   |
   +----cryptix.security.rsa.PublicKey

public class PublicKey
extends Object
This class is an RSA public key, it can only verify signatures or encrypt.

Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.


Variable Index

 o e_
the public exponent
 o n_
the public modulus

Constructor Index

 o PublicKey()
 o PublicKey(BigInteger, BigInteger)
create a public key from a modulus and exponent
 o PublicKey(PublicKey)
create a new public key from an existing key.

Method Index

 o bitLength()
get the keys bit length.
 o copy(Object)
copies a key if it is an instance of cryptix.security.rsa.PublicKey.
 o e()
 o encrypt(BigInteger)
encrypts a number with this key.
 o equals(Object)
tests if an object is equal to this one.
 o fingerPrint()
get the keys fingerprint.
 o id()
gets the key id.
 o n()
 o toString()

Variables

 o n_
  protected BigInteger n_
the public modulus
 o e_
  protected BigInteger e_
the public exponent

Constructors

 o PublicKey
  protected PublicKey()
 o PublicKey
  public PublicKey(BigInteger n0,
                   BigInteger e0)
create a public key from a modulus and exponent
Parameters:
n0 - The public modulus
e0 - The public exponent
 o PublicKey
  public PublicKey(PublicKey from0)
create a new public key from an existing key.
Parameters:
from0 - the key to copy.

Methods

 o n
  public final BigInteger n()
Returns:
a new BigInteger equal to the public modulus
 o e
  public final BigInteger e()
Returns:
a new BigInteger equal to the public exponent
 o copy
  public void copy(Object src)
copies a key if it is an instance of cryptix.security.rsa.PublicKey.
Parameters:
src - this object to copy
 o equals
  public boolean equals(Object obj)
tests if an object is equal to this one.
Parameters:
obj - object to test
Returns:
true if the object is equal, otherwise false.
Overrides:
equals in class Object
 o id
  public final byte[] id()
gets the key id.
Returns:
s The lower 8 bytes of n, the public modulus.
 o fingerPrint
  public final byte[] fingerPrint()
get the keys fingerprint.
Returns:
a MD5 hash of n and e.
 o bitLength
  public final int bitLength()
get the keys bit length.
Returns:
the length in bits of n, the public modulus.
 o encrypt
  public BigInteger encrypt(BigInteger plain)
encrypts a number with this key.
Parameters:
plain - the number to encrypt.
Returns:
an encrypted number.
 o toString
  public String toString()
Returns:
this key in hex.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index