1 /* 2 * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. 3 * Copyright (C) 2014 The Android Open Source Project 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. Oracle designates this 9 * particular file as subject to the "Classpath" exception as provided 10 * by Oracle in the LICENSE file that accompanied this code. 11 * 12 * This code is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * version 2 for more details (a copy is included in the LICENSE file that 16 * accompanied this code). 17 * 18 * You should have received a copy of the GNU General Public License version 19 * 2 along with this work; if not, write to the Free Software Foundation, 20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 * 22 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 23 * or visit www.oracle.com if you need additional information or have any 24 * questions. 25 */ 26 27 package java.security; 28 29 import android.compat.annotation.UnsupportedAppUsage; 30 31 @SuppressWarnings({"unchecked", "deprecation", "all"}) 32 public abstract class Signature extends java.security.SignatureSpi { 33 Signature(java.lang.String algorithm)34 protected Signature(java.lang.String algorithm) { 35 throw new RuntimeException("Stub!"); 36 } 37 getInstance(java.lang.String algorithm)38 public static java.security.Signature getInstance(java.lang.String algorithm) 39 throws java.security.NoSuchAlgorithmException { 40 throw new RuntimeException("Stub!"); 41 } 42 43 @UnsupportedAppUsage getInstance( sun.security.jca.GetInstance.Instance instance, java.lang.String algorithm)44 private static java.security.Signature getInstance( 45 sun.security.jca.GetInstance.Instance instance, java.lang.String algorithm) { 46 throw new RuntimeException("Stub!"); 47 } 48 isSpi(java.security.Provider.Service s)49 private static boolean isSpi(java.security.Provider.Service s) { 50 throw new RuntimeException("Stub!"); 51 } 52 getInstance( java.lang.String algorithm, java.lang.String provider)53 public static java.security.Signature getInstance( 54 java.lang.String algorithm, java.lang.String provider) 55 throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException { 56 throw new RuntimeException("Stub!"); 57 } 58 getInstance( java.lang.String algorithm, java.security.Provider provider)59 public static java.security.Signature getInstance( 60 java.lang.String algorithm, java.security.Provider provider) 61 throws java.security.NoSuchAlgorithmException { 62 throw new RuntimeException("Stub!"); 63 } 64 getInstanceRSA(java.security.Provider p)65 private static java.security.Signature getInstanceRSA(java.security.Provider p) 66 throws java.security.NoSuchAlgorithmException { 67 throw new RuntimeException("Stub!"); 68 } 69 getProvider()70 public final java.security.Provider getProvider() { 71 throw new RuntimeException("Stub!"); 72 } 73 chooseFirstProvider()74 void chooseFirstProvider() { 75 throw new RuntimeException("Stub!"); 76 } 77 initVerify(java.security.PublicKey publicKey)78 public final void initVerify(java.security.PublicKey publicKey) 79 throws java.security.InvalidKeyException { 80 throw new RuntimeException("Stub!"); 81 } 82 initVerify(java.security.cert.Certificate certificate)83 public final void initVerify(java.security.cert.Certificate certificate) 84 throws java.security.InvalidKeyException { 85 throw new RuntimeException("Stub!"); 86 } 87 initSign(java.security.PrivateKey privateKey)88 public final void initSign(java.security.PrivateKey privateKey) 89 throws java.security.InvalidKeyException { 90 throw new RuntimeException("Stub!"); 91 } 92 initSign( java.security.PrivateKey privateKey, java.security.SecureRandom random)93 public final void initSign( 94 java.security.PrivateKey privateKey, java.security.SecureRandom random) 95 throws java.security.InvalidKeyException { 96 throw new RuntimeException("Stub!"); 97 } 98 sign()99 public final byte[] sign() throws java.security.SignatureException { 100 throw new RuntimeException("Stub!"); 101 } 102 sign(byte[] outbuf, int offset, int len)103 public final int sign(byte[] outbuf, int offset, int len) 104 throws java.security.SignatureException { 105 throw new RuntimeException("Stub!"); 106 } 107 verify(byte[] signature)108 public final boolean verify(byte[] signature) throws java.security.SignatureException { 109 throw new RuntimeException("Stub!"); 110 } 111 verify(byte[] signature, int offset, int length)112 public final boolean verify(byte[] signature, int offset, int length) 113 throws java.security.SignatureException { 114 throw new RuntimeException("Stub!"); 115 } 116 update(byte b)117 public final void update(byte b) throws java.security.SignatureException { 118 throw new RuntimeException("Stub!"); 119 } 120 update(byte[] data)121 public final void update(byte[] data) throws java.security.SignatureException { 122 throw new RuntimeException("Stub!"); 123 } 124 update(byte[] data, int off, int len)125 public final void update(byte[] data, int off, int len) 126 throws java.security.SignatureException { 127 throw new RuntimeException("Stub!"); 128 } 129 update(java.nio.ByteBuffer data)130 public final void update(java.nio.ByteBuffer data) throws java.security.SignatureException { 131 throw new RuntimeException("Stub!"); 132 } 133 getAlgorithm()134 public final java.lang.String getAlgorithm() { 135 throw new RuntimeException("Stub!"); 136 } 137 toString()138 public java.lang.String toString() { 139 throw new RuntimeException("Stub!"); 140 } 141 142 @Deprecated setParameter(java.lang.String param, java.lang.Object value)143 public final void setParameter(java.lang.String param, java.lang.Object value) 144 throws java.security.InvalidParameterException { 145 throw new RuntimeException("Stub!"); 146 } 147 setParameter(java.security.spec.AlgorithmParameterSpec params)148 public final void setParameter(java.security.spec.AlgorithmParameterSpec params) 149 throws java.security.InvalidAlgorithmParameterException { 150 throw new RuntimeException("Stub!"); 151 } 152 getParameters()153 public final java.security.AlgorithmParameters getParameters() { 154 throw new RuntimeException("Stub!"); 155 } 156 157 @Deprecated getParameter(java.lang.String param)158 public final java.lang.Object getParameter(java.lang.String param) 159 throws java.security.InvalidParameterException { 160 throw new RuntimeException("Stub!"); 161 } 162 clone()163 public java.lang.Object clone() throws java.lang.CloneNotSupportedException { 164 throw new RuntimeException("Stub!"); 165 } 166 getCurrentSpi()167 public java.security.SignatureSpi getCurrentSpi() { 168 throw new RuntimeException("Stub!"); 169 } 170 171 private static final java.lang.String RSA_CIPHER = "RSA/ECB/PKCS1Padding"; 172 173 private static final java.lang.String RSA_SIGNATURE = "NONEwithRSA"; 174 175 protected static final int SIGN = 2; // 0x2 176 177 protected static final int UNINITIALIZED = 0; // 0x0 178 179 protected static final int VERIFY = 3; // 0x3 180 181 private java.lang.String algorithm; 182 183 java.security.Provider provider; 184 185 private static final java.util.List<sun.security.jca.ServiceId> rsaIds; 186 187 static { 188 rsaIds = null; 189 } 190 191 private static final java.util.Map<java.lang.String, java.lang.Boolean> signatureInfo; 192 193 static { 194 signatureInfo = null; 195 } 196 197 protected int state = 0; // 0x0 198 199 @SuppressWarnings({"unchecked", "deprecation", "all"}) 200 private static class CipherAdapter extends java.security.SignatureSpi { 201 CipherAdapter(javax.crypto.Cipher cipher)202 CipherAdapter(javax.crypto.Cipher cipher) { 203 throw new RuntimeException("Stub!"); 204 } 205 engineInitVerify(java.security.PublicKey publicKey)206 protected void engineInitVerify(java.security.PublicKey publicKey) 207 throws java.security.InvalidKeyException { 208 throw new RuntimeException("Stub!"); 209 } 210 engineInitSign(java.security.PrivateKey privateKey)211 protected void engineInitSign(java.security.PrivateKey privateKey) 212 throws java.security.InvalidKeyException { 213 throw new RuntimeException("Stub!"); 214 } 215 engineInitSign( java.security.PrivateKey privateKey, java.security.SecureRandom random)216 protected void engineInitSign( 217 java.security.PrivateKey privateKey, java.security.SecureRandom random) 218 throws java.security.InvalidKeyException { 219 throw new RuntimeException("Stub!"); 220 } 221 engineUpdate(byte b)222 protected void engineUpdate(byte b) throws java.security.SignatureException { 223 throw new RuntimeException("Stub!"); 224 } 225 engineUpdate(byte[] b, int off, int len)226 protected void engineUpdate(byte[] b, int off, int len) 227 throws java.security.SignatureException { 228 throw new RuntimeException("Stub!"); 229 } 230 engineSign()231 protected byte[] engineSign() throws java.security.SignatureException { 232 throw new RuntimeException("Stub!"); 233 } 234 engineVerify(byte[] sigBytes)235 protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException { 236 throw new RuntimeException("Stub!"); 237 } 238 engineSetParameter(java.lang.String param, java.lang.Object value)239 protected void engineSetParameter(java.lang.String param, java.lang.Object value) 240 throws java.security.InvalidParameterException { 241 throw new RuntimeException("Stub!"); 242 } 243 engineGetParameter(java.lang.String param)244 protected java.lang.Object engineGetParameter(java.lang.String param) 245 throws java.security.InvalidParameterException { 246 throw new RuntimeException("Stub!"); 247 } 248 249 private final javax.crypto.Cipher cipher; 250 251 { 252 cipher = null; 253 } 254 255 private java.io.ByteArrayOutputStream data; 256 } 257 258 @SuppressWarnings({"unchecked", "deprecation", "all"}) 259 private static class Delegate extends java.security.Signature { 260 Delegate(java.security.SignatureSpi sigSpi, java.lang.String algorithm)261 Delegate(java.security.SignatureSpi sigSpi, java.lang.String algorithm) { 262 super(null); 263 throw new RuntimeException("Stub!"); 264 } 265 Delegate(java.lang.String algorithm)266 Delegate(java.lang.String algorithm) { 267 super(null); 268 throw new RuntimeException("Stub!"); 269 } 270 clone()271 public java.lang.Object clone() throws java.lang.CloneNotSupportedException { 272 throw new RuntimeException("Stub!"); 273 } 274 newInstance(java.security.Provider.Service s)275 private static java.security.SignatureSpi newInstance(java.security.Provider.Service s) 276 throws java.security.NoSuchAlgorithmException { 277 throw new RuntimeException("Stub!"); 278 } 279 chooseFirstProvider()280 void chooseFirstProvider() { 281 throw new RuntimeException("Stub!"); 282 } 283 chooseProvider( int type, java.security.Key key, java.security.SecureRandom random)284 private void chooseProvider( 285 int type, java.security.Key key, java.security.SecureRandom random) 286 throws java.security.InvalidKeyException { 287 throw new RuntimeException("Stub!"); 288 } 289 init( java.security.SignatureSpi spi, int type, java.security.Key key, java.security.SecureRandom random)290 private void init( 291 java.security.SignatureSpi spi, 292 int type, 293 java.security.Key key, 294 java.security.SecureRandom random) 295 throws java.security.InvalidKeyException { 296 throw new RuntimeException("Stub!"); 297 } 298 engineInitVerify(java.security.PublicKey publicKey)299 protected void engineInitVerify(java.security.PublicKey publicKey) 300 throws java.security.InvalidKeyException { 301 throw new RuntimeException("Stub!"); 302 } 303 engineInitSign(java.security.PrivateKey privateKey)304 protected void engineInitSign(java.security.PrivateKey privateKey) 305 throws java.security.InvalidKeyException { 306 throw new RuntimeException("Stub!"); 307 } 308 engineInitSign( java.security.PrivateKey privateKey, java.security.SecureRandom sr)309 protected void engineInitSign( 310 java.security.PrivateKey privateKey, java.security.SecureRandom sr) 311 throws java.security.InvalidKeyException { 312 throw new RuntimeException("Stub!"); 313 } 314 engineUpdate(byte b)315 protected void engineUpdate(byte b) throws java.security.SignatureException { 316 throw new RuntimeException("Stub!"); 317 } 318 engineUpdate(byte[] b, int off, int len)319 protected void engineUpdate(byte[] b, int off, int len) 320 throws java.security.SignatureException { 321 throw new RuntimeException("Stub!"); 322 } 323 engineUpdate(java.nio.ByteBuffer data)324 protected void engineUpdate(java.nio.ByteBuffer data) { 325 throw new RuntimeException("Stub!"); 326 } 327 engineSign()328 protected byte[] engineSign() throws java.security.SignatureException { 329 throw new RuntimeException("Stub!"); 330 } 331 engineSign(byte[] outbuf, int offset, int len)332 protected int engineSign(byte[] outbuf, int offset, int len) 333 throws java.security.SignatureException { 334 throw new RuntimeException("Stub!"); 335 } 336 engineVerify(byte[] sigBytes)337 protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException { 338 throw new RuntimeException("Stub!"); 339 } 340 engineVerify(byte[] sigBytes, int offset, int length)341 protected boolean engineVerify(byte[] sigBytes, int offset, int length) 342 throws java.security.SignatureException { 343 throw new RuntimeException("Stub!"); 344 } 345 engineSetParameter(java.lang.String param, java.lang.Object value)346 protected void engineSetParameter(java.lang.String param, java.lang.Object value) 347 throws java.security.InvalidParameterException { 348 throw new RuntimeException("Stub!"); 349 } 350 engineSetParameter(java.security.spec.AlgorithmParameterSpec params)351 protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params) 352 throws java.security.InvalidAlgorithmParameterException { 353 throw new RuntimeException("Stub!"); 354 } 355 engineGetParameter(java.lang.String param)356 protected java.lang.Object engineGetParameter(java.lang.String param) 357 throws java.security.InvalidParameterException { 358 throw new RuntimeException("Stub!"); 359 } 360 engineGetParameters()361 protected java.security.AlgorithmParameters engineGetParameters() { 362 throw new RuntimeException("Stub!"); 363 } 364 getCurrentSpi()365 public java.security.SignatureSpi getCurrentSpi() { 366 throw new RuntimeException("Stub!"); 367 } 368 369 private static final int I_PRIV = 2; // 0x2 370 371 private static final int I_PRIV_SR = 3; // 0x3 372 373 private static final int I_PUB = 1; // 0x1 374 375 private final java.lang.Object lock; 376 377 { 378 lock = null; 379 } 380 381 private java.security.SignatureSpi sigSpi; 382 383 private static int warnCount = 10; // 0xa 384 } 385 } 386