|
|||||||||
Home >> All >> cryptix >> jce >> provider >> [ dsa overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
cryptix.jce.provider.dsa
Class DSASignature

java.lang.Objectjava.security.SignatureSpi
cryptix.jce.provider.dsa.DSASignature
- All Implemented Interfaces:
- java.lang.Cloneable
- public final class DSASignature
- extends java.security.SignatureSpi
- implements java.lang.Cloneable
- extends java.security.SignatureSpi
Implementation of the Digital Signature Algorithm (DSA) conformant with FIPS 186-2, Digital Signature Standard (DSS), February 2000. Tested and interoperable with the DSA implementation in the Sun JDKs.
- Version:
- $Revision: 1.4 $
Field Summary | |
private java.math.BigInteger |
_exp
Either public or private exponent, depending on our mode. |
private static java.security.SecureRandom |
_fallbackRng
RNG used when none is specified by our callers. |
private java.math.BigInteger |
_g
|
private java.security.MessageDigest |
_md
|
private java.math.BigInteger |
_p
|
private java.math.BigInteger |
_q
|
private static boolean |
MODE_SIGN
|
private static boolean |
MODE_VERIFY
|
Fields inherited from class java.security.SignatureSpi |
appRandom |
Constructor Summary | |
|
DSASignature()
|
private |
DSASignature(DSASignature srcSig)
Copy constructor. |
Method Summary | |
private void |
_clear()
Clear all sensitive state. |
private boolean |
_isValid(boolean mode)
Invariants hold? |
java.lang.Object |
clone()
Returns a clone of this instance. |
protected java.lang.Object |
engineGetParameter(java.lang.String param)
Returns the value for the specified algorithm parameter. |
protected void |
engineInitSign(java.security.PrivateKey privateKey)
Init for signing with private key and a default RNG. |
protected void |
engineInitSign(java.security.PrivateKey privKey,
java.security.SecureRandom random)
Init for signing with private key and RNG. |
protected void |
engineInitVerify(java.security.PublicKey pubKey)
Init for verification with a public key. |
protected void |
engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
Sets the signature engine with the specified java.security.spec.AlgorithmParameterSpec. |
protected void |
engineSetParameter(java.lang.String param,
java.lang.Object value)
Sets the specified algorithm parameter to the specified value. |
protected byte[] |
engineSign()
Calculate the signature over the accumulated data and reset (keeping the key information, resetting the hash). |
protected int |
engineSign(byte[] outbuf,
int offset,
int len)
Calculate the signature over the accumulated data and reset (keeping the key information, resetting the hash). |
protected void |
engineUpdate(byte b)
Updates the data to be signed or verified with the specified byte. |
protected void |
engineUpdate(byte[] b,
int off,
int len)
Updates the data to be signed or verified with the specified bytes. |
protected boolean |
engineVerify(byte[] sigBytes)
Calculate signature over the accumulated data and compare the result to the passed in signature. |
boolean |
equals(java.lang.Object o)
Determine whether this Object is semantically equal to another Object. |
int |
hashCode()
Get a value that represents this Object, as uniquely as possible within the confines of an int. |
Methods inherited from class java.security.SignatureSpi |
engineGetParameters, engineVerify |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
_fallbackRng
private static final java.security.SecureRandom _fallbackRng
- RNG used when none is specified by our callers.
_md
private final java.security.MessageDigest _md
_g
private java.math.BigInteger _g
_p
private java.math.BigInteger _p
_q
private java.math.BigInteger _q
_exp
private java.math.BigInteger _exp
- Either public or private exponent, depending on our mode.
MODE_SIGN
private static final boolean MODE_SIGN
- See Also:
- Constant Field Values
MODE_VERIFY
private static final boolean MODE_VERIFY
- See Also:
- Constant Field Values
Constructor Detail |
DSASignature
public DSASignature()
DSASignature
private DSASignature(DSASignature srcSig) throws java.lang.CloneNotSupportedException
- Copy constructor.
Method Detail |
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Description copied from class:
java.security.SignatureSpi
- Returns a clone of this instance.
equals
public boolean equals(java.lang.Object o)
- Description copied from class:
java.lang.Object
- Determine whether this Object is semantically equal
to another Object.
There are some fairly strict requirements on this method which subclasses must follow:
- It must be transitive. If
a.equals(b)
andb.equals(c)
, thena.equals(c)
must be true as well. - It must be symmetric.
a.equals(b)
andb.equals(a)
must have the same value. - It must be reflexive.
a.equals(a)
must always be true. - It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
a.equals(null)
must be false.- It must be consistent with hashCode(). That is,
a.equals(b)
must implya.hashCode() == b.hashCode()
. The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.
This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for
a.equals(b)
to be true even thougha.getClass() != b.getClass()
. Also, it is typical to never cause a java.lang.NullPointerException.In general, the Collections API (
java.util
) use theequals
method rather than the==
operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.The default implementation returns
this == o
. - It must be transitive. If
hashCode
public int hashCode()
- Description copied from class:
java.lang.Object
- Get a value that represents this Object, as uniquely as
possible within the confines of an int.
There are some requirements on this method which subclasses must follow:
- Semantic equality implies identical hashcodes. In other
words, if
a.equals(b)
is true, thena.hashCode() == b.hashCode()
must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal. - It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.
Notice that since
hashCode
is used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.The default implementation returns
System.identityHashCode(this)
- Semantic equality implies identical hashcodes. In other
words, if
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String param) throws java.security.InvalidParameterException
- Description copied from class:
java.security.SignatureSpi
- Returns the value for the specified algorithm parameter.
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyException
- Init for signing with private key and a default RNG.
engineInitSign
protected void engineInitSign(java.security.PrivateKey privKey, java.security.SecureRandom random) throws java.security.InvalidKeyException
- Init for signing with private key and RNG.
engineSign
protected byte[] engineSign() throws java.security.SignatureException
- Calculate the signature over the accumulated data and reset (keeping
the key information, resetting the hash).
engineSign
protected int engineSign(byte[] outbuf, int offset, int len) throws java.security.SignatureException
- Calculate the signature over the accumulated data and reset (keeping
the key information, resetting the hash).
engineUpdate
protected void engineUpdate(byte b) throws java.security.SignatureException
- Description copied from class:
java.security.SignatureSpi
- Updates the data to be signed or verified with the specified byte.
engineUpdate
protected void engineUpdate(byte[] b, int off, int len) throws java.security.SignatureException
- Description copied from class:
java.security.SignatureSpi
- Updates the data to be signed or verified with the specified bytes.
engineInitVerify
protected void engineInitVerify(java.security.PublicKey pubKey) throws java.security.InvalidKeyException
- Init for verification with a public key.
engineVerify
protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException
- Calculate signature over the accumulated data and compare the result
to the passed in signature.
engineSetParameter
protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
- Description copied from class:
java.security.SignatureSpi
- Sets the signature engine with the specified java.security.spec.AlgorithmParameterSpec.
This method cannot be abstract for backward compatibility reasons. By default it always throws java.lang.UnsupportedOperationException unless overridden.
engineSetParameter
protected void engineSetParameter(java.lang.String param, java.lang.Object value) throws java.security.InvalidParameterException
- Description copied from class:
java.security.SignatureSpi
- Sets the specified algorithm parameter to the specified value.
_clear
private void _clear()
- Clear all sensitive state.
_isValid
private boolean _isValid(boolean mode)
- Invariants hold?
|
|||||||||
Home >> All >> cryptix >> jce >> provider >> [ dsa overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |