code: protected void verifyCertificateTrust(WSHandlerResult result) throws WSSecurityException {
          List<WSSecurityEngineResult> signResults = result.getActionResults().getOrDefault(WSConstants.SIGN, emptyList());
          if (signResults.isEmpty()) {
              throw new Wss4jSecurityValidationException("No action results for 'Perform Signature' found");
          } else if (signResults.size() > 1) {
              throw new Wss4jSecurityValidationException("Multiple action results for 'Perform Signature' found. Expected only 1.");
          }
          WSSecurityEngineResult signResult = signResults.get(0);
  
          if (signResult != null) {
              X509Certificate returnCert =
                      (X509Certificate) signResult.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);
              Credential credential = new Credential();
              credential.setCertificates(new X509Certificate[]{returnCert});
  
              RequestData requestData = new RequestData();
              requestData.setSigVerCrypto(validationSignatureCrypto);
              requestData.setEnableRevocation(enableRevocation);
              requestData.setSubjectCertConstraints(OrgnummerExtractor.PATTERNS);
  
              SignatureTrustValidator validator = new SignatureTrustValidator();
              validator.validate(credential, requestData);
          }
      }
docs: Verifies the trust of a certificate.