home *** CD-ROM | disk | FTP | other *** search
- package java.security;
-
- import java.security.spec.AlgorithmParameterSpec;
-
- public abstract class SignatureSpi {
- protected SecureRandom appRandom = null;
-
- protected abstract void engineInitVerify(PublicKey var1) throws InvalidKeyException;
-
- protected abstract void engineInitSign(PrivateKey var1) throws InvalidKeyException;
-
- protected void engineInitSign(PrivateKey var1, SecureRandom var2) throws InvalidKeyException {
- this.appRandom = var2;
- this.engineInitSign(var1);
- }
-
- protected abstract void engineUpdate(byte var1) throws SignatureException;
-
- protected abstract void engineUpdate(byte[] var1, int var2, int var3) throws SignatureException;
-
- protected abstract byte[] engineSign() throws SignatureException;
-
- protected int engineSign(byte[] var1, int var2, int var3) throws SignatureException {
- byte[] var4 = this.engineSign();
- if (var3 < var4.length) {
- throw new SignatureException("partial signatures not returned");
- } else if (var1.length - var2 < var4.length) {
- throw new SignatureException("insufficient space in the output buffer to store the signature");
- } else {
- System.arraycopy(var4, 0, var1, var2, var4.length);
- return var4.length;
- }
- }
-
- protected abstract boolean engineVerify(byte[] var1) throws SignatureException;
-
- protected abstract void engineSetParameter(String var1, Object var2) throws InvalidParameterException;
-
- protected void engineSetParameter(AlgorithmParameterSpec var1) throws InvalidAlgorithmParameterException {
- throw new UnsupportedOperationException();
- }
-
- protected abstract Object engineGetParameter(String var1) throws InvalidParameterException;
-
- public Object clone() throws CloneNotSupportedException {
- if (this instanceof Cloneable) {
- return super.clone();
- } else {
- throw new CloneNotSupportedException();
- }
- }
- }
-