jsdsi
Class RSAPublicKey

java.lang.Object
  |
  +--jsdsi.Obj
        |
        +--jsdsi.Principal
              |
              +--jsdsi.PublicKey
                    |
                    +--jsdsi.RSAPublicKey
All Implemented Interfaces:
Element, java.security.Key, java.security.Principal, java.security.PublicKey, java.security.interfaces.RSAKey, java.security.interfaces.RSAPublicKey, java.io.Serializable, Subject

public class RSAPublicKey
extends PublicKey
implements java.security.interfaces.RSAPublicKey

An RSA public key.

Author:
Sameer Ajmani
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class jsdsi.Element
Element.Default
 
Nested classes inherited from class jsdsi.Subject
Subject.Default
 
Field Summary
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Constructor Summary
RSAPublicKey(java.math.BigInteger m, java.math.BigInteger e, java.lang.String a)
           
RSAPublicKey(java.math.BigInteger m, java.math.BigInteger e, java.lang.String a, java.net.URL[] u)
           
RSAPublicKey(java.security.interfaces.RSAPublicKey k)
           
RSAPublicKey(java.security.interfaces.RSAPublicKey k, java.net.URL[] u)
           
 
Method Summary
static java.security.KeyPair create()
          Creates a new RSA key pair whose public key is a Principal.
static java.security.KeyPair create(java.lang.String a)
          Creates a new RSA key pair whose public key is a Principal.
static java.security.KeyPair create(java.lang.String a, java.lang.String provider)
          Creates a new RSA key pair whose public key is a Principal.
 boolean equals(java.lang.Object o)
           
 java.math.BigInteger getExponent()
           
 java.math.BigInteger getModulus()
           
 java.math.BigInteger getPublicExponent()
           
 int hashCode()
           
(package private) static RSAPublicKey parseRSAPublicKey(SexpList l, java.lang.String algo)
           
 SexpList toPublicKeySexp()
           
 
Methods inherited from class jsdsi.PublicKey
getAlgorithm, getEncoded, getFormat, getURLs, parsePublicKey, samePrincipalAs, toSexp
 
Methods inherited from class jsdsi.Principal
getName, parsePrincipal
 
Methods inherited from class jsdsi.Obj
parseObj, parseObj, toByteArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

RSAPublicKey

public RSAPublicKey(java.math.BigInteger m,
                    java.math.BigInteger e,
                    java.lang.String a,
                    java.net.URL[] u)

RSAPublicKey

public RSAPublicKey(java.math.BigInteger m,
                    java.math.BigInteger e,
                    java.lang.String a)

RSAPublicKey

public RSAPublicKey(java.security.interfaces.RSAPublicKey k,
                    java.net.URL[] u)

RSAPublicKey

public RSAPublicKey(java.security.interfaces.RSAPublicKey k)
Method Detail

create

public static java.security.KeyPair create(java.lang.String a,
                                           java.lang.String provider)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.security.NoSuchProviderException
Creates a new RSA key pair whose public key is a Principal.

Parameters:
a - the specific RSA algorithm to use
provider - the provider to use
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

create

public static java.security.KeyPair create(java.lang.String a)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.security.NoSuchProviderException
Creates a new RSA key pair whose public key is a Principal.

Parameters:
a - the specific RSA algorithm to use
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

create

public static java.security.KeyPair create()
                                    throws java.security.NoSuchAlgorithmException,
                                           java.security.NoSuchProviderException
Creates a new RSA key pair whose public key is a Principal.

java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

getModulus

public java.math.BigInteger getModulus()
Specified by:
getModulus in interface java.security.interfaces.RSAKey

getExponent

public java.math.BigInteger getExponent()

getPublicExponent

public java.math.BigInteger getPublicExponent()
Specified by:
getPublicExponent in interface java.security.interfaces.RSAPublicKey

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.security.Principal
Overrides:
equals in class PublicKey

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class PublicKey

toPublicKeySexp

public SexpList toPublicKeySexp()
Specified by:
toPublicKeySexp in class PublicKey

parseRSAPublicKey

static RSAPublicKey parseRSAPublicKey(SexpList l,
                                      java.lang.String algo)
                               throws SexpParseException
SexpParseException