1 17 package com.sun.org.apache.xml.internal.security.algorithms; 18 19 20 21 import java.security.Key ; 22 import java.security.SecureRandom ; 23 import java.security.spec.AlgorithmParameterSpec ; 24 25 import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; 26 import org.w3c.dom.Document ; 27 import org.w3c.dom.Element ; 28 29 30 34 public abstract class SignatureAlgorithmSpi { 35 36 37 static java.util.logging.Logger log = 38 java.util.logging.Logger.getLogger(SignatureAlgorithmSpi.class.getName()); 39 40 45 protected abstract String engineGetURI(); 46 47 53 protected abstract String engineGetJCEAlgorithmString(); 54 55 60 protected abstract String engineGetJCEProviderName(); 61 62 69 protected abstract void engineUpdate(byte[] input) 70 throws XMLSignatureException; 71 72 79 protected abstract void engineUpdate(byte input) 80 throws XMLSignatureException; 81 82 91 protected abstract void engineUpdate(byte buf[], int offset, int len) 92 throws XMLSignatureException; 93 94 101 protected abstract void engineInitSign(Key signingKey) 102 throws XMLSignatureException; 103 104 112 protected abstract void engineInitSign( 113 Key signingKey, SecureRandom secureRandom) throws XMLSignatureException; 114 115 123 protected abstract void engineInitSign( 124 Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) 125 throws XMLSignatureException; 126 127 134 protected abstract byte[] engineSign() throws XMLSignatureException; 135 136 142 protected abstract void engineInitVerify(Key verificationKey) 143 throws XMLSignatureException; 144 145 153 protected abstract boolean engineVerify(byte[] signature) 154 throws XMLSignatureException; 155 156 163 protected abstract void engineSetParameter(AlgorithmParameterSpec params) 164 throws XMLSignatureException; 165 166 167 Document _doc = null; 168 169 174 protected void engineSetDocument(Document doc) { 175 this._doc = doc; 176 } 177 178 179 Element _constructionElement = null; 180 181 186 protected void engineGetContextFromElement(Element element) { 187 this._constructionElement = element; 188 } 189 190 196 protected abstract void engineSetHMACOutputLength(int HMACOutputLength) 197 throws XMLSignatureException; 198 } 199 | Popular Tags |