--- old/src/java.base/share/classes/java/security/SignatureSpi.java 2019-04-10 18:51:42.098283500 -0400 +++ new/src/java.base/share/classes/java/security/SignatureSpi.java 2019-04-10 18:51:41.195193200 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,33 +72,6 @@ /** * Initializes this signature object with the specified - * public key for verification operations. - * - * @param publicKey the public key of the identity whose signature is - * going to be verified. - * @param params the parameters for generating this signature - * - * @exception InvalidKeyException if the key is improperly - * encoded, does not work with the given parameters, and so on. - * @exception InvalidAlgorithmParameterException if the given parameters - * is invalid. - */ - void engineInitVerify(PublicKey publicKey, - AlgorithmParameterSpec params) - throws InvalidKeyException, InvalidAlgorithmParameterException { - if (params != null) { - try { - engineSetParameter(params); - } catch (UnsupportedOperationException usoe) { - // error out if not overrridden - throw new InvalidAlgorithmParameterException(usoe); - } - } - engineInitVerify(publicKey); - } - - /** - * Initializes this signature object with the specified * private key for signing operations. * * @param privateKey the private key of the identity whose signature @@ -125,41 +98,10 @@ * encoded, parameters are missing, and so on. */ protected void engineInitSign(PrivateKey privateKey, - SecureRandom random) - throws InvalidKeyException { - this.appRandom = random; - engineInitSign(privateKey); - } - - /** - * Initializes this signature object with the specified - * private key and source of randomness for signing operations. - * - *

This concrete method has been added to this previously-defined - * abstract class. (For backwards compatibility, it cannot be abstract.) - * - * @param privateKey the private key of the identity whose signature - * will be generated. - * @param params the parameters for generating this signature - * @param random the source of randomness - * - * @exception InvalidKeyException if the key is improperly - * encoded, parameters are missing, and so on. - * @exception InvalidAlgorithmParameterException if the parameters is - * invalid. - */ - void engineInitSign(PrivateKey privateKey, - AlgorithmParameterSpec params, SecureRandom random) - throws InvalidKeyException, InvalidAlgorithmParameterException { - if (params != null) { - try { - engineSetParameter(params); - } catch (UnsupportedOperationException usoe) { - // error out if not overrridden - throw new InvalidAlgorithmParameterException(usoe); - } - } - engineInitSign(privateKey, random); + SecureRandom random) + throws InvalidKeyException { + this.appRandom = random; + engineInitSign(privateKey); } /** @@ -185,7 +127,7 @@ * properly */ protected abstract void engineUpdate(byte[] b, int off, int len) - throws SignatureException; + throws SignatureException; /** * Updates the data to be signed or verified using the specified @@ -281,7 +223,7 @@ * @since 1.2 */ protected int engineSign(byte[] outbuf, int offset, int len) - throws SignatureException { + throws SignatureException { byte[] sig = engineSign(); if (len < sig.length) { throw new SignatureException @@ -309,7 +251,7 @@ * process the input data provided, etc. */ protected abstract boolean engineVerify(byte[] sigBytes) - throws SignatureException; + throws SignatureException; /** * Verifies the passed-in signature in the specified array @@ -331,7 +273,7 @@ * @since 1.4 */ protected boolean engineVerify(byte[] sigBytes, int offset, int length) - throws SignatureException { + throws SignatureException { byte[] sigBytesCopy = new byte[length]; System.arraycopy(sigBytes, offset, sigBytesCopy, 0, length); return engineVerify(sigBytesCopy); @@ -363,7 +305,7 @@ */ @Deprecated protected abstract void engineSetParameter(String param, Object value) - throws InvalidParameterException; + throws InvalidParameterException; /** *

This method is overridden by providers to initialize @@ -379,8 +321,8 @@ * are inappropriate for this signature engine */ protected void engineSetParameter(AlgorithmParameterSpec params) - throws InvalidAlgorithmParameterException { - throw new UnsupportedOperationException(); + throws InvalidAlgorithmParameterException { + throw new UnsupportedOperationException(); } /**