< prev index next >
src/java.base/share/classes/java/security/cert/X509CRL.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2019, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 237,255 ****
* @since 1.8
*/
public void verify(PublicKey key, Provider sigProvider)
throws CRLException, NoSuchAlgorithmException,
InvalidKeyException, SignatureException {
- String sigAlgName = getSigAlgName();
Signature sig = (sigProvider == null)
! ? Signature.getInstance(sigAlgName)
! : Signature.getInstance(sigAlgName, sigProvider);
try {
! byte[] paramBytes = getSigAlgParams();
! SignatureUtil.initVerifyWithParam(sig, key,
! SignatureUtil.getParamSpec(sigAlgName, paramBytes));
} catch (ProviderException e) {
throw new CRLException(e.getMessage(), e.getCause());
} catch (InvalidAlgorithmParameterException e) {
throw new CRLException(e);
}
--- 237,256 ----
* @since 1.8
*/
public void verify(PublicKey key, Provider sigProvider)
throws CRLException, NoSuchAlgorithmException,
InvalidKeyException, SignatureException {
Signature sig = (sigProvider == null)
! ? Signature.getInstance(getSigAlgName())
! : Signature.getInstance(getSigAlgName(), sigProvider);
+ sig.initVerify(key);
+
+ // set parameters after Signature.initSign/initVerify call,
+ // so the deferred provider selections occur when key is set
try {
! SignatureUtil.specialSetParameter(sig, getSigAlgParams());
} catch (ProviderException e) {
throw new CRLException(e.getMessage(), e.getCause());
} catch (InvalidAlgorithmParameterException e) {
throw new CRLException(e);
}
< prev index next >