org.logi.crypto.sign
Class Signature
java.lang.Object
|
+--org.logi.crypto.Crypto
|
+--org.logi.crypto.sign.Signature
- All Implemented Interfaces:
- PrettyPrintable
- Direct Known Subclasses:
- BlindSignature
- public class Signature
- extends Crypto
This class stores a digital signature. It is created with a SignatureKey
from a Fingerprint and can later be used to verify that Fingerprint with
the same symmetric key or the other asymmetric key from the pair.
- Author:
- Logi Ragnarsson
(logir@logi.org)
- See Also:
Fingerprint
,
SignatureKey
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Constructor Summary |
Signature(java.lang.String hashFunc,
byte[] s)
Create a new Signature object. |
Method Summary |
byte[] |
getBytes()
Return the bytes from this signature. |
java.lang.String |
getHashFunc()
Return the name of the hash function used to fingerprint the data
before signing. |
static Signature |
parseCDS(java.lang.String[] param)
Used by Crypto.fromString when parsing a CDS. |
void |
prettyPrint(java.io.PrintWriter out,
int ind,
int rec)
Print this object to out, indented with ind tabs, going down at most
rec levels of recursion. |
java.lang.String |
toString()
Return a CDS for this object. |
Methods inherited from class org.logi.crypto.Crypto |
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Signature
public Signature(java.lang.String hashFunc,
byte[] s)
- Create a new Signature object. It contains the signature
s
which was generated from a fingerprint returned from
the specified hash function.
parseCDS
public static Signature parseCDS(java.lang.String[] param)
throws InvalidCDSException
- Used by Crypto.fromString when parsing a CDS.
A valid CDS can be created by calling the toString() method.
- Throws:
InvalidCDSException
- if the CDS is malformed.- See Also:
Crypto.fromString(String)
getHashFunc
public java.lang.String getHashFunc()
- Return the name of the hash function used to fingerprint the data
before signing.
getBytes
public byte[] getBytes()
- Return the bytes from this signature.
toString
public java.lang.String toString()
- Return a CDS for this object.
- Overrides:
toString
in class java.lang.Object
prettyPrint
public void prettyPrint(java.io.PrintWriter out,
int ind,
int rec)
throws java.io.IOException
- Print this object to out, indented with ind tabs, going down at most
rec levels of recursion.
- Overrides:
prettyPrint
in class Crypto
Copyright 1997-2000 Logi Ragnarsson