javadoc and forbiddenApis fix

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898356 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2022-02-23 23:54:45 +00:00
parent 20d63696ed
commit 79caf82ae0
2 changed files with 5 additions and 4 deletions

View File

@ -194,7 +194,7 @@ subprojects {
failOnError = true failOnError = true
maxMemory = "1024M" maxMemory = "1024M"
javadocTool = javaToolchains.javadocToolFor { javadocTool = javaToolchains.javadocToolFor {
languageVersion = JavaLanguageVersion.of(11) languageVersion = JavaLanguageVersion.of(Math.max(11,jdkVersion))
} }
doFirst { doFirst {

View File

@ -38,6 +38,7 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
import javax.security.auth.x500.X500Principal;
import javax.xml.XMLConstants; import javax.xml.XMLConstants;
import javax.xml.crypto.XMLStructure; import javax.xml.crypto.XMLStructure;
import javax.xml.crypto.dom.DOMStructure; import javax.xml.crypto.dom.DOMStructure;
@ -309,6 +310,7 @@ public class XAdESSignatureFacet implements SignatureFacet {
protected static void setCertID protected static void setCertID
(CertIDType certId, SignatureConfig signatureConfig, boolean issuerNameNoReverseOrder, X509Certificate certificate) { (CertIDType certId, SignatureConfig signatureConfig, boolean issuerNameNoReverseOrder, X509Certificate certificate) {
X509IssuerSerialType issuerSerial = certId.addNewIssuerSerial(); X509IssuerSerialType issuerSerial = certId.addNewIssuerSerial();
X500Principal issuerPrincipal = certificate.getIssuerX500Principal();
String issuerName; String issuerName;
if (issuerNameNoReverseOrder) { if (issuerNameNoReverseOrder) {
/* /*
@ -319,10 +321,9 @@ public class XAdESSignatureFacet implements SignatureFacet {
* XXX: not correct according to RFC 4514. * XXX: not correct according to RFC 4514.
*/ */
// TODO: check if issuerName is different on getTBSCertificate // TODO: check if issuerName is different on getTBSCertificate
// issuerName = PrincipalUtil.getIssuerX509Principal(certificate).getName().replace(",", ", "); issuerName = issuerPrincipal.getName().replace(",", ", ");
issuerName = certificate.getIssuerDN().getName().replace(",", ", ");
} else { } else {
issuerName = certificate.getIssuerX500Principal().toString(); issuerName = issuerPrincipal.toString();
} }
issuerSerial.setX509IssuerName(issuerName); issuerSerial.setX509IssuerName(issuerName);
issuerSerial.setX509SerialNumber(certificate.getSerialNumber()); issuerSerial.setX509SerialNumber(certificate.getSerialNumber());