All digital signature schemes implement the ISignature interface,
and support the following methods:
A property name in the attributes map that is passed to instances being prepared for signing. The value mapped by this key must be a
java.security.PrivateKeythat is appropriate for the instance's algorithm (e.g. an instance of DSS would require a subclass ofjava.security.interfaces.DSAPrivateKey).
A property name in the attributes map that is passed to instances being prepared for verifying a signature. The value mapped by this key must be a
java.security.PublicKeythat is appropriate for the instance's algorithm, just as is the case with the signing key.
A property name in the attributes map that is passed to instances being prepared for use as either signers or verifiers. The value mapped must be an already-initialized instance of
gnu.crypto.prng.IRandom.
Initializes this instance for signing. The attributes parameter must be a
java.util.Mapthat has, at least, a mapping between theSIGNER_KEYproperty and the appropriate private key.
Initializes this instance for verifying a signature. The attributes parameter must be a
java.util.Mapthat has, at least, a mapping between theVERIFIER_KEYproperty and the appropriate public key.
Update either the signing or verifying operation with the next byte in the message. This method will throw a
java.lang.IllegalStateExceptionif this instance has not been initialized for either signing or verifying.
Update either the signing or verifying operation with the next len bytes of buf, starting at offset. This method will throw a
java.lang.IllegalStateExceptionif this instance has not been initialized for either signing or verifying.
Finishes a signing operation and returns the final signature. This method will throw a
java.lang.IllegalStateExceptionif this instance has not been initialized for signing.
Finishes a verifying operation by checking if the argument, a native signature object, matches the expected signature. This methods returns
trueif the signature is valid,falseotherwise. This method will throw ajava.lang.IllegalStateExceptionif this instance has not been initialized for verifying.