de.flexiprovider.core.elgamal.semanticallysecure
Class SSVElGamalPrivateKey

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

public class SSVElGamalPrivateKey
extends PrivateKey

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

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.PrivateKey
serialVersionUID
 
Constructor Summary
protected SSVElGamalPrivateKey(FlexiBigInt modulusp, FlexiBigInt modulusq, FlexiBigInt generator, FlexiBigInt publicA, FlexiBigInt a)
          The constructor.
protected SSVElGamalPrivateKey(SSVElGamalPrivateKeySpec keySpec)
          Construct an ElGamalPublicKey out of the given key specification.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 FlexiBigInt getA()
           
 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.PrivateKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSVElGamalPrivateKey

protected SSVElGamalPrivateKey(FlexiBigInt modulusp,
                               FlexiBigInt modulusq,
                               FlexiBigInt generator,
                               FlexiBigInt publicA,
                               FlexiBigInt a)
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 modulusp
a - - the private value a

SSVElGamalPrivateKey

protected SSVElGamalPrivateKey(SSVElGamalPrivateKeySpec keySpec)
Construct an ElGamalPublicKey out of the given key specification.
Parameters:
keySpec - the key specification
Method Detail

getAlgorithm

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

getModulusP

public FlexiBigInt getModulusP()
Returns:
the prime modulus p

getModulusQ

public FlexiBigInt getModulusQ()
Returns:
the prime modulus q

getGenerator

public FlexiBigInt getGenerator()
Returns:
the generator

getPublicA

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

getA

public FlexiBigInt getA()
Returns:
the private value a

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 PrivateKey
Returns:
null

getAlgParams

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

getKeyData

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