org.clazzes.optional.sec.rsa
Class RSAPubKey

java.lang.Object
  extended by org.clazzes.optional.sec.rsa.RSAPubKey
All Implemented Interfaces:
java.io.Serializable

public class RSAPubKey
extends java.lang.Object
implements Serializable

A RSA public key with a public exponent and a modulus.

See Also:
Serialized Form

Constructor Summary
RSAPubKey(BigInt modulus, BigInt exponent)
          Construct a new RSA public key by the given modulus and public exponent.
 
Method Summary
 BigInt encryptPlain(BigInt plain)
          Calculates the plain encrpyt operation x^pubExp.
 BigInt getExponent()
           
 BigInt getModulus()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSAPubKey

public RSAPubKey(BigInt modulus,
                 BigInt exponent)
Construct a new RSA public key by the given modulus and public exponent.

Parameters:
modulus - The RSA modulus.
exponent - The public exponent.
Method Detail

getModulus

public BigInt getModulus()
Returns:
The modulus of the RAS public key.

getExponent

public BigInt getExponent()
Returns:
The public exponent of the RSA key.

encryptPlain

public BigInt encryptPlain(BigInt plain)
Calculates the plain encrpyt operation x^pubExp. This operation may additionally be used on a padded message digest to verify signatures.

Parameters:
plain - The plain text, which is usually subject to an appropriate padding scheme.
Returns:
The encrypted cipher text.


Copyright © 2010. All Rights Reserved.