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 |
| Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
SSVElGamalPublicKey
protected SSVElGamalPublicKey(FlexiBigInt modulusp,
FlexiBigInt modulusq,
FlexiBigInt generator,
FlexiBigInt publicA)
- The constructor.
- Parameters:
modulusp - - the prime modulus which specifies the groupmodulusq - - the prime modulus which specifies the subgroupgenerator - - a generator of the grouppublicA - - 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
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