/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* MD5 and SHA-1 MessageDigests. Used for explicit RSA server authentication
* (RSA signed server key exchange for RSA_EXPORT and DHE_RSA) and RSA client
* authentication (RSA signed certificate verify message).
*
* It conforms to the standard JCA Signature API. It is registered in the
* SunJSSE provider to avoid more complicated getInstance() code and
* negative interaction with the JCA mechanisms for hardware providers.
*
* The class should be instantiated via the getInstance() method in this class,
* which returns the implementation from the prefered provider. The internal
* implementation allows the hashes to be explicitly set, which is required
* for RSA client authentication. It can be obtained via the
* getInternalInstance() method.
*
* This class is not thread safe.
*
*/
// flag indicating if the MessageDigests are in reset state
private boolean isReset;
super();
isReset = true;
}
/**
* Get an implementation for the RSA signature. Follows the standard
* JCA getInstance() model, so it return the implementation from the
* provider with the highest precedence, which may be this class.
*/
}
/**
* Get an internal implementation for the RSA signature. Used for RSA
* client authentication, which needs the ability to set the digests
* to externally provided values via the setHashes() method.
*/
}
/**
* Set the MD5 and SHA hashes to the provided objects.
*/
}
/**
* Reset the MessageDigests unless they are already reset.
*/
private void reset() {
if (isReset == false) {
isReset = true;
}
}
throw new InvalidKeyException("Key must not be null");
}
}
throws InvalidKeyException {
reset();
}
throws InvalidKeyException {
}
throws InvalidKeyException {
reset();
}
// lazily initialize the MessageDigests
private void initDigests() {
}
}
protected void engineUpdate(byte b) {
initDigests();
isReset = false;
}
initDigests();
isReset = false;
}
try {
initDigests();
byte[] data = new byte[36];
isReset = true;
return data;
} catch (DigestException e) {
// should never occur
throw new SignatureException(e);
}
}
}
}
throws SignatureException {
}
throws InvalidParameterException {
throw new InvalidParameterException
("Parameter not supported: " + param);
}
if (value instanceof MessageDigest[] == false) {
throw new InvalidParameterException
("value must be MessageDigest[]");
}
}
throws InvalidParameterException {
throw new InvalidParameterException("Parameters not supported");
}
}