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
-
PublicKey()
-
-
PublicKey(String, BigInt, BigInt)
- creates a public key with given values
-
checkSignature(byte[], byte[], String)
- checks a signature of a message
by calling the signature algorithm specified by OID
-
crypt(BigInt)
- uses the public key en/decrypt a message
-
equals(Object)
- returns true if the public keys are equal
-
ID()
- returns the ID of the public key
-
modulus()
- returns the modulus
-
publicExponent()
- returns the public exponent
-
setID(String)
- sets the ID of the public key
-
toString()
- String representation of the public key
-
toSubjectPublicKey()
- returns the public key as a SubjectPublicKey structure (X.509)
-
toSubjectPublicKeyInfo()
- returns the public key as a SubjectPublicKeyInfo structure (X.509)
-
valueOf(ASN1Object)
- creates a public key from a SubjectPublicKeyInfo object
by calling the algorithm specified by OID
PublicKey
protected PublicKey()
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
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
modulus
public BigInt modulus()
- returns the modulus
publicExponent
public BigInt publicExponent()
- returns the public exponent
equals
public boolean equals(Object obj)
- returns true if the public keys are equal
- Overrides:
- equals in class Object
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
toSubjectPublicKeyInfo
public ASN1Object toSubjectPublicKeyInfo()
- returns the public key as a SubjectPublicKeyInfo structure (X.509)
toSubjectPublicKey
public ASN1Object toSubjectPublicKey()
- returns the public key as a SubjectPublicKey structure (X.509)
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
ID
public String ID()
- returns the ID of the public key
setID
public void setID(String newID)
- sets the ID of the public key
toString
public String toString()
- String representation of the public key
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index