Package br.net.woodstock.rockframework.security.cert

Examples of br.net.woodstock.rockframework.security.cert.CertificateException


      crlConverter.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
      X509CRL crl = crlConverter.getCRL(crlh);

      return new CRLResponse(crl);
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here


        return CollectionUtils.toArray(errors, ValidationError.class);
      }

      return new ValidationError[0];
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

      OCSPResp ocspResp = new OCSPRespBuilder().build(OCSPRespBuilder.SUCCESSFUL, basicResp);

      OCSPResponse response = new OCSPResponse(ocspResp.getEncoded());
      return response;
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

        return new ValidationError[] { new ValidationError(CRLCertificateValidator.VALIDATOR_NAME, "Certificate revoked") };
      }

      return new ValidationError[0];
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

        response = this.buildV1Certificate(bcRequest);
      }

      return response;
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

      return new ValidationError[0];
    } catch (CertPathBuilderException e) {
      SecurityLog.getInstance().getLogger().info("Validation error: " + e.getMessage());
      return new ValidationError[] { new ValidationError(PKIXCertificateValidator.VALIDATOR_NAME, "Invalid certificate infrastructure") };
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

          list.add(new ValidationError(HierarchyCertificateValidator.VALIDATOR_NAME, "Certificate issuer '" + BouncyCastleProviderHelper.getName(issuer.getSubjectX500Principal()) + "' is not a CA"));
        }
      } catch (SignatureException e) {
        list.add(new ValidationError(HierarchyCertificateValidator.VALIDATOR_NAME, "Certificate '" + BouncyCastleProviderHelper.getName(certificate.getSubjectX500Principal()) + "' not signed by '" + BouncyCastleProviderHelper.getName(issuer.getSubjectX500Principal()) + "'"));
      } catch (Exception e) {
        throw new CertificateException(e);
      }
    }

    try {
      if (ConditionUtils.isNotEmpty(this.certificates)) {
        boolean requiredOk = false;
        outer: for (int i = 1; i < chain.length; i++) {
          X509Certificate issuer = (X509Certificate) chain[i];
          for (Certificate required : this.certificates) {
            X509Certificate x509Required = (X509Certificate) required;
            if (Arrays.equals(issuer.getEncoded(), x509Required.getEncoded())) {
              requiredOk = true;
              break outer;
            }
          }
        }

        if (!requiredOk) {
          list.add(new ValidationError(HierarchyCertificateValidator.VALIDATOR_NAME, "Certificate chain is invalid, a required certificate could not be found"));
        }
      }
    } catch (CertificateEncodingException e) {
      throw new CertificateException(e);
    }

    return CollectionUtils.toArray(list, ValidationError.class);
  }
View Full Code Here

    } catch (CertificateExpiredException e) {
      return new ValidationError[] { new ValidationError(DateCertificateValidator.VALIDATOR_NAME, "Certificate expired") };
    } catch (CertificateNotYetValidException e) {
      return new ValidationError[] { new ValidationError(DateCertificateValidator.VALIDATOR_NAME, "Certificate not yet valid") };
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

        privateKeyHolder = this.buildV1Certificate(bcRequest);
      }

      return privateKeyHolder;
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

          break;
        }
      }
      return ok;
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.security.cert.CertificateException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.