home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / security / SignatureSpi.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.6 KB  |  53 lines

  1. package java.security;
  2.  
  3. import java.security.spec.AlgorithmParameterSpec;
  4.  
  5. public abstract class SignatureSpi {
  6.    protected SecureRandom appRandom = null;
  7.  
  8.    protected abstract void engineInitVerify(PublicKey var1) throws InvalidKeyException;
  9.  
  10.    protected abstract void engineInitSign(PrivateKey var1) throws InvalidKeyException;
  11.  
  12.    protected void engineInitSign(PrivateKey var1, SecureRandom var2) throws InvalidKeyException {
  13.       this.appRandom = var2;
  14.       this.engineInitSign(var1);
  15.    }
  16.  
  17.    protected abstract void engineUpdate(byte var1) throws SignatureException;
  18.  
  19.    protected abstract void engineUpdate(byte[] var1, int var2, int var3) throws SignatureException;
  20.  
  21.    protected abstract byte[] engineSign() throws SignatureException;
  22.  
  23.    protected int engineSign(byte[] var1, int var2, int var3) throws SignatureException {
  24.       byte[] var4 = this.engineSign();
  25.       if (var3 < var4.length) {
  26.          throw new SignatureException("partial signatures not returned");
  27.       } else if (var1.length - var2 < var4.length) {
  28.          throw new SignatureException("insufficient space in the output buffer to store the signature");
  29.       } else {
  30.          System.arraycopy(var4, 0, var1, var2, var4.length);
  31.          return var4.length;
  32.       }
  33.    }
  34.  
  35.    protected abstract boolean engineVerify(byte[] var1) throws SignatureException;
  36.  
  37.    protected abstract void engineSetParameter(String var1, Object var2) throws InvalidParameterException;
  38.  
  39.    protected void engineSetParameter(AlgorithmParameterSpec var1) throws InvalidAlgorithmParameterException {
  40.       throw new UnsupportedOperationException();
  41.    }
  42.  
  43.    protected abstract Object engineGetParameter(String var1) throws InvalidParameterException;
  44.  
  45.    public Object clone() throws CloneNotSupportedException {
  46.       if (this instanceof Cloneable) {
  47.          return super.clone();
  48.       } else {
  49.          throw new CloneNotSupportedException();
  50.       }
  51.    }
  52. }
  53.