public interface SignatureDSA extends Signature
This interface is a slimmed down and specialized (on DSA) version
of Signature.
It will be used by the library to check the server's signature
during key exchange, and to prove our own possession of the
private key for public-key authentication in the default Identity
implementation.
The library will choose the implementation class by the configuration
option signature.dsa, and instantiate it using the no-argument
constructor. For signature checking, the usage would look like this:
sig = class.newInstance(); sig.init(); sig.setPubKey(y, p, q, g); sig.update(H); // maybe more than once boolean ok = sig.verify(sig_of_H);
For signing, the usage would look like this:
sig = class.newInstance(); sig.init(); sig.setPrvKey(x, p, q, g); sig.update(H); // maybe more than once byte[] sig_of_H = sig.sign();
The library contains a default implementation based on
Signature.
SignatureRSA| Modifier and Type | Method and Description |
|---|---|
void |
setPrvKey(byte[] x,
byte[] p,
byte[] q,
byte[] g)
Sets the private key and prepares this signature object
for signing.
|
void |
setPubKey(byte[] y,
byte[] p,
byte[] q,
byte[] g)
Sets the public key and prepares this signature object
for signature verifying.
|
void setPubKey(byte[] y,
byte[] p,
byte[] q,
byte[] g)
throws Exception
y - the public key y = g^x mod p.p - the big primeq - the small primeg - the generatorExceptionKeyPairGenDSAvoid setPrvKey(byte[] x,
byte[] p,
byte[] q,
byte[] g)
throws Exception
x - the private keyp - the big primeq - the small primeg - the generatorExceptionKeyPairGenDSAThis is an inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.