com.mindbright.security.publickey
Class BaseSignature
java.lang.Object
com.mindbright.jca.security.SignatureSpi
com.mindbright.security.publickey.BaseSignature
- Direct Known Subclasses:
- RawDSAWithSHA1, RSAWithAny
- public abstract class BaseSignature
- extends SignatureSpi
Constructor Summary |
protected |
BaseSignature(java.lang.String digAlg)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
digest
protected MessageDigest digest
publicKey
protected PublicKey publicKey
privateKey
protected PrivateKey privateKey
BaseSignature
protected BaseSignature(java.lang.String digAlg)
engineInitVerify
protected final void engineInitVerify(PublicKey publicKey)
throws InvalidKeyException
- Specified by:
engineInitVerify
in class SignatureSpi
- Throws:
InvalidKeyException
engineInitSign
protected final void engineInitSign(PrivateKey privateKey)
throws InvalidKeyException
- Specified by:
engineInitSign
in class SignatureSpi
- Throws:
InvalidKeyException
engineInitSign
protected final void engineInitSign(PrivateKey privateKey,
SecureRandom random)
throws InvalidKeyException
- Specified by:
engineInitSign
in class SignatureSpi
- Throws:
InvalidKeyException
engineUpdate
protected void engineUpdate(byte b)
throws SignatureException
- Specified by:
engineUpdate
in class SignatureSpi
- Throws:
SignatureException
engineUpdate
protected void engineUpdate(byte[] b,
int off,
int len)
throws SignatureException
- Specified by:
engineUpdate
in class SignatureSpi
- Throws:
SignatureException
engineSign
protected byte[] engineSign()
throws SignatureException
- Specified by:
engineSign
in class SignatureSpi
- Throws:
SignatureException
engineSign
protected int engineSign(byte[] outbuf,
int offset,
int len)
throws SignatureException
- Overrides:
engineSign
in class SignatureSpi
- Throws:
SignatureException
engineVerify
protected boolean engineVerify(byte[] sigBytes)
throws SignatureException
- Specified by:
engineVerify
in class SignatureSpi
- Throws:
SignatureException
engineSetParameter
protected void engineSetParameter(java.lang.String param,
java.lang.Object value)
throws InvalidParameterException
- Specified by:
engineSetParameter
in class SignatureSpi
- Throws:
InvalidParameterException
engineSetParameter
protected void engineSetParameter(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException
- Overrides:
engineSetParameter
in class SignatureSpi
- Throws:
InvalidAlgorithmParameterException
engineGetParameter
protected java.lang.Object engineGetParameter(java.lang.String param)
throws InvalidParameterException
- Specified by:
engineGetParameter
in class SignatureSpi
- Throws:
InvalidParameterException
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone
in class SignatureSpi
- Throws:
java.lang.CloneNotSupportedException
getRandom
protected final SecureRandom getRandom()
initSign
protected abstract void initSign()
throws InvalidKeyException
- Throws:
InvalidKeyException
initVerify
protected abstract void initVerify()
throws InvalidKeyException
- Throws:
InvalidKeyException
sign
protected abstract byte[] sign(byte[] data)
throws SignatureException
- Throws:
SignatureException
verify
protected abstract boolean verify(byte[] signature,
byte[] data)
throws SignatureException
- Throws:
SignatureException