Package org.apache.geronimo.crypto.asn1.x509

Examples of org.apache.geronimo.crypto.asn1.x509.CRLDistPoint


        throws AnnotatedException
    {
        Set set = new HashSet();
        if (paramsPKIX.isUseDeltasEnabled())
        {
            CRLDistPoint freshestCRL = null;
            try
            {
                freshestCRL = CRLDistPoint
                    .getInstance(CertPathValidatorUtilities.getExtensionValue(cert, FRESHEST_CRL));
            }
View Full Code Here


        PublicKey workingPublicKey,
        List certPathCerts)
        throws AnnotatedException
    {
        AnnotatedException lastException = null;
        CRLDistPoint crldp = null;
        try
        {
            crldp = CRLDistPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(cert,
                RFC3280CertPathUtilities.CRL_DISTRIBUTION_POINTS));
        }
        catch (Exception e)
        {
            throw new AnnotatedException("CRL distribution point extension could not be read.", e);
        }
        try
        {
            CertPathValidatorUtilities.addAdditionalStoresFromCRLDistributionPoint(crldp, paramsPKIX);
        }
        catch (AnnotatedException e)
        {
            throw new AnnotatedException(
                "No additional CRL locations could be decoded from CRL distribution point extension.", e);
        }
        CertStatus certStatus = new CertStatus();
        ReasonsMask reasonsMask = new ReasonsMask();

        boolean validCrlFound = false;
        // for each distribution point
        if (crldp != null)
        {
            DistributionPoint dps[] = null;
            try
            {
                dps = crldp.getDistributionPoints();
            }
            catch (Exception e)
            {
                throw new AnnotatedException("Distribution points could not be read.", e);
            }
View Full Code Here

        if (extension == null) {
            return list;
        }

        // Convert extension raw data into CRL distribution point object.
        CRLDistPoint points = CRLDistPoint.getInstance(
            X509ExtensionUtil.fromExtensionValue(extension));

        // Iterate through the distribution point objects.
        for (DistributionPoint point : points.getDistributionPoints()) {
            DistributionPointName name = point.getDistributionPoint();

            // Look for URLs in full name.
            if (name != null && name.getType() == DistributionPointName.FULL_NAME) {
                GeneralName[] names = GeneralNames.getInstance(name.getName()).getNames();
View Full Code Here

      obj = null;
    }
      if (obj == null) {
          return null;
      }
      CRLDistPoint dist = CRLDistPoint.getInstance(obj);
      DistributionPoint[] dists = dist.getDistributionPoints();
      for (DistributionPoint p : dists) {
          DistributionPointName distributionPointName = p.getDistributionPoint();
          if (DistributionPointName.FULL_NAME != distributionPointName.getType()) {
              continue;
          }
View Full Code Here

        assertNotNull("CRL has no Freshest Distribution Point", cFreshestDpDER);

        ASN1InputStream aIn = new ASN1InputStream(new ByteArrayInputStream(cFreshestDpDER));
        ASN1OctetString octs = (ASN1OctetString) aIn.readObject();
        aIn = new ASN1InputStream(new ByteArrayInputStream(octs.getOctets()));
        CRLDistPoint cdp = new CRLDistPoint((ASN1Sequence) aIn.readObject());
        DistributionPoint[] distpoints = cdp.getDistributionPoints();

        assertEquals("More CRL Freshest distributions points than expected", 1, distpoints.length);
        assertEquals("Freshest CRL distribution point is different", freshestCdpURL, ((DERIA5String) ((GeneralNames) distpoints[0].getDistributionPoint()
                .getName()).getNames()[0].getName()).getString());
View Full Code Here

            if (!isDeltaCRL) {
                String crlFreshestDP = getCADefinedFreshestCRL();
                List<DistributionPoint> freshestDistPoints = generateDistributionPoints(crlFreshestDP);
                if (freshestDistPoints.size() > 0) {
                    CRLDistPoint ext = new CRLDistPoint((DistributionPoint[])freshestDistPoints.toArray(new DistributionPoint[freshestDistPoints.size()]));

                    // According to the RFC, the Freshest CRL extension on a
                    // CRL must not be marked as critical. Therefore it is
                    // hardcoded as not critical and is independent of
                    // getCrlDistributionPointOnCrlCritical().
View Full Code Here

        if ( (dpn != null) || (issuer != null) ) {
          distpoints.add(new DistributionPoint(dpn, null, issuer));                               
        }
      }
    }
    CRLDistPoint ret = null;
    if (!distpoints.isEmpty()) {
      ret = new CRLDistPoint((DistributionPoint[])distpoints.toArray(new DistributionPoint[distpoints.size()]));     
    }
    if (ret == null) {
      log.error("DrlDistributionPoints missconfigured, no distribution points available.");
    }
    return ret;
View Full Code Here

        final X509CA x509ca = (X509CA)ca;
        if(certProfile.getUseCADefinedFreshestCRL()){
            freshestcrldistpoint = x509ca.getCADefinedFreshestCRL();
        }
        // Multiple FCDPs are separated with the ';' sign
        CRLDistPoint ret = null;
        if (freshestcrldistpoint != null) {
          final StringTokenizer tokenizer = new StringTokenizer(freshestcrldistpoint, ";", false);
          final ArrayList<DistributionPoint> distpoints = new ArrayList<DistributionPoint>();
            while (tokenizer.hasMoreTokens()) {
              final String uri = tokenizer.nextToken();
                final GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(uri));
                if (log.isDebugEnabled()) {
                  log.debug("Added freshest CRL distpoint: "+uri);
                }
                final ASN1EncodableVector vec = new ASN1EncodableVector();
                vec.add(gn);
                final GeneralNames gns = new GeneralNames(new DERSequence(vec));
                final DistributionPointName dpn = new DistributionPointName(0, gns);
                distpoints.add(new DistributionPoint(dpn, null, null));
            }
            if (!distpoints.isEmpty()) {
                ret = new CRLDistPoint((DistributionPoint[])distpoints.toArray(new DistributionPoint[distpoints.size()]));
            }              
        }
    if (ret == null) {
            log.error("UseFreshestCRL is true, but no URI string defined!");
    }
View Full Code Here

        DEROctetString dosCrlDP = (DEROctetString) derObjCrlDP;
        byte[] crldpExtOctets = dosCrlDP.getOctets();
        ASN1InputStream oAsnInStream2 = new ASN1InputStream(
                new ByteArrayInputStream(crldpExtOctets));
        DERObject derObj2 = oAsnInStream2.readObject();
        CRLDistPoint distPoint = CRLDistPoint.getInstance(derObj2);
        List<String> crlUrls = new ArrayList<String>();
        for (DistributionPoint dp : distPoint.getDistributionPoints()) {
            DistributionPointName dpn = dp.getDistributionPoint();
            // Look for URIs in fullName
            if (dpn != null
                && dpn.getType() == DistributionPointName.FULL_NAME) {
                GeneralName[] genNames = GeneralNames.getInstance(
View Full Code Here

  private Set<String> getCrlUrls(final X509Certificate aCert) {
    final Set<String> tmpResult = new HashSet<String>();
    options.log("console.crlinfo.retrieveCrlUrl", aCert.getSubjectX500Principal().getName());
    final byte[] crlDPExtension = aCert.getExtensionValue(X509Extensions.CRLDistributionPoints.getId());
    if (crlDPExtension != null) {
      CRLDistPoint crlDistPoints = null;
      try {
        crlDistPoints = CRLDistPoint.getInstance(X509ExtensionUtil.fromExtensionValue(crlDPExtension));
      } catch (IOException e) {
        e.printStackTrace(options.getPrintWriter());
      }
      if (crlDistPoints != null) {
        final DistributionPoint[] distPoints = crlDistPoints.getDistributionPoints();
        distPoint: for (DistributionPoint dp : distPoints) {
          final DistributionPointName dpName = dp.getDistributionPoint();
          final GeneralNames generalNames = (GeneralNames) dpName.getName();
          if (generalNames != null) {
            final GeneralName[] generalNameArr = generalNames.getNames();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.asn1.x509.CRLDistPoint

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.