## net.i2p.crypto
Class DSAEngine

    java.lang.Object
      net.i2p.crypto.DSAEngine

Direct Known Subclasses:
  DummyDSAEngine

    public class DSAEngine

extends Object

Params and rv's changed from Hash to SHA1Hash for version 0.8.1 There shouldn't be any external users of those variants.

Constructor Summary
`DSAEngine(I2PAppContext context)`

Method Summary
`static SHA1Hash` `calculateHash(byte[] source, int offset, int len)`
`SHA1Hash` `calculateHash(InputStream in)`
`static DSAEngine` `getInstance()`
`static void` `main(String[] args)`
`Signature` `sign(byte[] data, int offset, int length, SigningPrivateKey signingKey)`
`Signature` `sign(byte[] data, SigningPrivateKey signingKey)`
`Signature` `sign(InputStream in, SigningPrivateKey signingKey)`
`Signature` `sign(SHA1Hash hash, SigningPrivateKey signingKey)`
`boolean` `verifySignature(Signature signature, byte[] signedData, int offset, int size, SigningPublicKey verifyingKey)`
`boolean` `verifySignature(Signature signature, byte[] signedData, SigningPublicKey verifyingKey)`
`boolean` `verifySignature(Signature signature, InputStream in, SigningPublicKey verifyingKey)`
`boolean` `verifySignature(Signature signature, SHA1Hash hash, SigningPublicKey verifyingKey)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DSAEngine

    public DSAEngine(I2PAppContext context)

Method Detail

### getInstance

    public static DSAEngine getInstance()

### verifySignature

    public boolean verifySignature(Signature signature,
                                   byte[] signedData,
                                   SigningPublicKey verifyingKey)

### verifySignature

    public boolean verifySignature(Signature signature,
                                   byte[] signedData,
                                   int offset,
                                   int size,
                                   SigningPublicKey verifyingKey)

### verifySignature

    public boolean verifySignature(Signature signature,
                                   InputStream in,
                                   SigningPublicKey verifyingKey)

### verifySignature

    public boolean verifySignature(Signature signature,
                                   SHA1Hash hash,
                                   SigningPublicKey verifyingKey)

  Parameters:
    `hash` - SHA-1 hash, NOT a SHA-256 hash

### sign

    public Signature sign(byte[] data,
                          SigningPrivateKey signingKey)

### sign

    public Signature sign(byte[] data,
                          int offset,
                          int length,
                          SigningPrivateKey signingKey)

### sign

    public Signature sign(InputStream in,
                          SigningPrivateKey signingKey)

### sign

    public Signature sign(SHA1Hash hash,
                          SigningPrivateKey signingKey)

  Parameters:
    `hash` - SHA-1 hash, NOT a SHA-256 hash

### calculateHash

    public SHA1Hash calculateHash(InputStream in)

  Returns:
    hash SHA-1 hash, NOT a SHA-256 hash

### calculateHash

    public static SHA1Hash calculateHash(byte[] source,
                                         int offset,
                                         int len)

  Returns:
    hash SHA-1 hash, NOT a SHA-256 hash

### main

    public static void main(String[] args)