Package gnu.crypto.sig
Provides a basic API for algorithms to use Public/Private keypairs in Digital
Signature schemes.
ISignature | The visible methods of every signature-with-appendix scheme.
The Handbook of Applied Cryptography (HAC), by A. |
ISignatureCodec | The visible methods of an object that knows how to encode and decode
cryptographic signatures. |
BaseSignature | A base abstract class to facilitate implementations of concrete
Signatures.
|
SignatureFactory | A Factory to instantiate signature-with-appendix handlers.
|
Provides a basic API for algorithms to use Public/Private keypairs in Digital
Signature schemes.
Package overview
Three schemes are implemented in this library: the Digital Signature
Scheme (DSS), RSA-PSS, and RSA-PKCS1 version 1.5.
The following diagram shows the important classes participating in
this package:
![]()
../../../../diagrams/sig_class_diag.png"
width=307 height=311 border=0>
The next diagram shows the sequences involved in using keypairs to
sign and verify a message stream.
![]()
../../../../diagrams/sign_verify_seq_diag.png"
width=323 height=179 border=0>
The following example shows the code involved in the above sequence
diagram
ISignature dss = SignatureFactory.getInstance("DSS");
Map attrib = new HashMap();
attrib.put(ISignature.SIGNER_KEY, privateDsaKey);
dss.setupSign(attrib);
dss.update(message, 0, message.length);
Object sig = dss.sign();
ISignatureCodec codec = new DSSSignatureRawCodec();
byte[] encoded = codec.encodeSignature(sig);
Object sig2 = codec.decodeSignature(encoded);
attrib.clear();
attrib.put(ISignature.VERIFIER_KEY, publicDsaKey);
dss.setupVerify(attrib);
dss.update(message, 0, message.length);
boolean valid = dss.verify(sig);
<!-- $Revision: 1.5 $ -->
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.