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

Class cryptiX.rsa.PublicKey

java.lang.Object
   |
   +----java.util.Observable
           |
           +----cryptiX.rsa.PublicKey

public class PublicKey
extends Observable

Constructor Index

 o PublicKey()
 o PublicKey(String, BigInt, BigInt)
creates a public key with given values

Method Index

 o checkSignature(byte[], byte[], String)
checks a signature of a message by calling the signature algorithm specified by OID
 o crypt(BigInt)
uses the public key en/decrypt a message
 o equals(Object)
returns true if the public keys are equal
 o ID()
returns the ID of the public key
 o modulus()
returns the modulus
 o publicExponent()
returns the public exponent
 o setID(String)
sets the ID of the public key
 o toString()
String representation of the public key
 o toSubjectPublicKey()
returns the public key as a SubjectPublicKey structure (X.509)
 o toSubjectPublicKeyInfo()
returns the public key as a SubjectPublicKeyInfo structure (X.509)
 o valueOf(ASN1Object)
creates a public key from a SubjectPublicKeyInfo object by calling the algorithm specified by OID

Constructors

 o PublicKey
  protected PublicKey()
 o PublicKey
  public PublicKey(String UserID,
                   BigInt exponent,
                   BigInt modulus)
creates a public key with given values
Parameters:
UserID - user id of the public key
exponent - the public exponent

Methods

 o crypt
  public BigInt crypt(BigInt message)
uses the public key en/decrypt a message
Parameters:
message - the message as BigInt
Returns:
the en/decrypted message
 o modulus
  public BigInt modulus()
returns the modulus
 o publicExponent
  public BigInt publicExponent()
returns the public exponent
 o equals
  public boolean equals(Object obj)
returns true if the public keys are equal
Overrides:
equals in class Object
 o valueOf
  public static PublicKey valueOf(ASN1Object spkiObj) throws CodingException
creates a public key from a SubjectPublicKeyInfo object by calling the algorithm specified by OID
Parameters:
spkiObj - SubjectPublicKeyInfo as ASN1Object
Returns:
a public key object
 o toSubjectPublicKeyInfo
  public ASN1Object toSubjectPublicKeyInfo()
returns the public key as a SubjectPublicKeyInfo structure (X.509)
 o toSubjectPublicKey
  public ASN1Object toSubjectPublicKey()
returns the public key as a SubjectPublicKey structure (X.509)
 o checkSignature
  public boolean checkSignature(byte message[],
                                byte signature[],
                                String signatureAlgorithm) throws CodingException
checks a signature of a message by calling the signature algorithm specified by OID
Parameters:
message - the message the signature applies to
signature - the signature as defined by signature algorithm
signatureAlgorithm - the algorithm used to generate this signature
Returns:
true if signature is OK
 o ID
  public String ID()
returns the ID of the public key
 o setID
  public void setID(String newID)
sets the ID of the public key
 o toString
  public String toString()
String representation of the public key
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index