Class java.crypt.rsa.PublicKey
All Packages Class Hierarchy This Package Previous Next Index
Class java.crypt.rsa.PublicKey
java.crypt.rsa.PublicKey
- public class PublicKey
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.
-
e_
- the public exponent
-
n_
- the public modulus
-
PublicKey()
-
-
PublicKey(BigInteger, BigInteger)
- create a public key from a modulus and exponent
-
PublicKey(PublicKey)
- create a new public key from an existing key.
-
bitLength()
- get the keys bit length.
-
copy(Object)
- copies a key if it is an instance of java.crypt.rsa.PublicKey.
-
e()
-
-
encrypt(BigInteger)
- encrypts a number with this key.
-
equals(Object)
- tests if an object is equal to this one.
-
fingerPrint()
- get the keys fingerprint.
-
id()
- gets the key id.
-
n()
-
-
toString()
-
n_
protected BigInteger n_
- the public modulus
e_
protected BigInteger e_
- the public exponent
PublicKey
protected PublicKey()
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
PublicKey
public PublicKey(PublicKey from0)
- create a new public key from an existing key.
- Parameters:
- from0 - the key to copy.
n
public final BigInteger n()
- Returns:
- a new BigInteger equal to the public modulus
e
public final BigInteger e()
- Returns:
- a new BigInteger equal to the public exponent
copy
public void copy(Object src)
- copies a key if it is an instance of java.crypt.rsa.PublicKey.
- Parameters:
- src - this object to copy
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.
id
public final byte[] id()
- gets the key id.
- Returns:
- s The lower 8 bytes of n, the public modulus.
fingerPrint
public final byte[] fingerPrint()
- get the keys fingerprint.
- Returns:
- a MD5 hash of n and e.
bitLength
public final int bitLength()
- get the keys bit length.
- Returns:
- the length in bits of n, the public modulus.
encrypt
public BigInteger encrypt(BigInteger plain)
- encrypts a number with this key.
- Parameters:
- plain - the number to encrypt.
- Returns:
- an encrypted number.
toString
public String toString()
- Returns:
- this key in hex.
All Packages Class Hierarchy This Package Previous Next Index