de.flexiprovider.core.elgamal.semanticallysecure
Class SSVElGamalPublicKey

java.lang.Object
  |
  +--de.flexiprovider.api.keys.PublicKey
        |
        +--de.flexiprovider.core.elgamal.semanticallysecure.SSVElGamalPublicKey
All Implemented Interfaces:
java.security.Key, Key, java.security.PublicKey, java.io.Serializable

public class SSVElGamalPublicKey
extends PublicKey

This class implements the PublicKey interface. It is normally instantiated from SSVElGamalKeyPairGenerator. The public key consists of a modulus p (a prime), a modulus q (prime), a generator of (Zp/Z)* and the public value A = ga mod p, a is the private exponent.

Author:
Thomas Wahrenbruch, Roberto Samarone dos Santos Araújo
See Also:
SSVElGamalKeyPairGenerator, Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Constructor Summary
protected SSVElGamalPublicKey(FlexiBigInt modulusp, FlexiBigInt modulusq, FlexiBigInt generator, FlexiBigInt publicA)
          The constructor.
protected SSVElGamalPublicKey(SSVElGamalPublicKeySpec keySpec)
          Construct an SSVElGamalPublicKey out of the given key specification.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAlgorithm()
          Return the algorithm name.
protected  codec.asn1.ASN1Type getAlgParams()
           
 FlexiBigInt getGenerator()
           
protected  byte[] getKeyData()
           
 FlexiBigInt getModulusP()
           
 FlexiBigInt getModulusQ()
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
 FlexiBigInt getPublicA()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class de.flexiprovider.api.keys.PublicKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSVElGamalPublicKey

protected SSVElGamalPublicKey(FlexiBigInt modulusp,
                              FlexiBigInt modulusq,
                              FlexiBigInt generator,
                              FlexiBigInt publicA)
The constructor.
Parameters:
modulusp - - the prime modulus which specifies the group
modulusq - - the prime modulus which specifies the subgroup
generator - - a generator of the group
publicA - - the public value A = ga mod modulus

SSVElGamalPublicKey

protected SSVElGamalPublicKey(SSVElGamalPublicKeySpec keySpec)
Construct an SSVElGamalPublicKey out of the given key specification.
Parameters:
keySpec - the key specification
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Return the algorithm name.
Returns:
"SSVElGamal"

getModulusP

public FlexiBigInt getModulusP()
Returns:
the prime modulus

getModulusQ

public FlexiBigInt getModulusQ()

getGenerator

public FlexiBigInt getGenerator()
Returns:
the generator

getPublicA

public FlexiBigInt getPublicA()
Returns:
the public value A = ga mod modulus

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of the key

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getOID

protected codec.asn1.ASN1ObjectIdentifier getOID()
Overrides:
getOID in class PublicKey
Returns:
null

getAlgParams

protected codec.asn1.ASN1Type getAlgParams()
Overrides:
getAlgParams in class PublicKey
Returns:
the algorithm parameters to encode in the SubjectPublicKeyInfo structure

getKeyData

protected byte[] getKeyData()
Overrides:
getKeyData in class PublicKey
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure