Package org.bouncycastle.asn1.x509

Examples of org.bouncycastle.asn1.x509.DistributionPointName


    CRLDistPoint distPoint = CRLDistPoint.getInstance(crldistribuitionPointsObject);

    Set<URL> urls = new HashSet<URL>();

    for (DistributionPoint distribuitionPoint : distPoint.getDistributionPoints()) {
      DistributionPointName distribuitionPointName = distribuitionPoint.getDistributionPoint();
      if ((distribuitionPointName != null) && (distribuitionPointName.getType() == DistributionPointName.FULL_NAME)) {
        GeneralName[] genNames = GeneralNames.getInstance(distribuitionPointName.getName()).getNames();
        for (int i = 0; i < genNames.length; i++) {
          if (genNames[i].getTagNo() == GeneralName.uniformResourceIdentifier) {
            String urlStr = DERIA5String.getInstance(genNames[i].getName()).getString();
            URL url = new URL(urlStr);
            urls.add(url);
View Full Code Here


      ASN1EncodableVector vec = new ASN1EncodableVector();
      vec.add(gn);

      GeneralNames generalNames = new GeneralNames(new DERSequence(vec));
      DistributionPointName distributionPointName = new DistributionPointName(0, generalNames);
      CRLDistPoint crlDistPoint = new CRLDistPoint(new DistributionPoint[] { new DistributionPoint(distributionPointName, null, null) });

      builder.addExtension(X509Extension.cRLDistributionPoints, false, crlDistPoint);
      builder.addExtension(MiscObjectIdentifiers.netscapeCApolicyURL, false, new DERIA5String(request.getCrlDistPoint()));
    }
View Full Code Here

    CRLDistPoint distPoint = CRLDistPoint.getInstance(crldistribuitionPointsObject);

    Set<URL> urls = new HashSet<URL>();

    for (DistributionPoint distribuitionPoint : distPoint.getDistributionPoints()) {
      DistributionPointName distribuitionPointName = distribuitionPoint.getDistributionPoint();
      if ((distribuitionPointName != null) && (distribuitionPointName.getType() == DistributionPointName.FULL_NAME)) {
        GeneralName[] genNames = GeneralNames.getInstance(distribuitionPointName.getName()).getNames();
        for (int i = 0; i < genNames.length; i++) {
          if (genNames[i].getTagNo() == GeneralName.uniformResourceIdentifier) {
            String urlStr = DERIA5String.getInstance(genNames[i].getName()).getString();
            URL url = new URL(urlStr);
            urls.add(url);
View Full Code Here

      ASN1EncodableVector vec = new ASN1EncodableVector();
      vec.add(gn);

      GeneralNames generalNames = GeneralNames.getInstance(new DERSequence(vec));
      DistributionPointName distributionPointName = new DistributionPointName(0, generalNames);
      CRLDistPoint crlDistPoint = new CRLDistPoint(new DistributionPoint[] { new DistributionPoint(distributionPointName, null, null) });

      builder.addExtension(X509Extension.cRLDistributionPoints, false, crlDistPoint);
      builder.addExtension(MiscObjectIdentifiers.netscapeCApolicyURL, false, new DERIA5String(request.getCrlDistPoint()));
    }
View Full Code Here

      ASN1EncodableVector vec = new ASN1EncodableVector();
      vec.add(gn);

      GeneralNames generalNames = new GeneralNames(new DERSequence(vec));
      DistributionPointName distributionPointName = new DistributionPointName(0, generalNames);
      CRLDistPoint crlDistPoint = new CRLDistPoint(new DistributionPoint[] { new DistributionPoint(distributionPointName, null, null) });

      builder.addExtension(X509Extension.cRLDistributionPoints, false, crlDistPoint);
      builder.addExtension(MiscObjectIdentifiers.netscapeCApolicyURL, false, new DERIA5String(request.getCrlDistPoint()));
    }
View Full Code Here

                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;
                }
                GeneralNames generalNames = (GeneralNames)distributionPointName.getName();
                GeneralName[] names = generalNames.getNames();
                for (GeneralName name : names) {
                    if (name.getTagNo() != GeneralName.uniformResourceIdentifier) {
                        continue;
                    }
View Full Code Here

                throw new AnnotatedException(
                    "Distribution points could not be read.", e);
            }
            for (int i = 0; i < dps.length; i++)
            {
                DistributionPointName dpn = dps[i].getDistributionPoint();
                // look for URIs in fullName
                if (dpn.getType() == DistributionPointName.FULL_NAME)
                {
                    GeneralName[] genNames = GeneralNames.getInstance(
                        dpn.getName()).getNames();
                    // look for an URI
                    for (int j = 0; j < genNames.length; j++)
                    {
                        if (genNames[j].getTagNo() == GeneralName.uniformResourceIdentifier)
                        {
View Full Code Here

                            throw new AnnotatedException(
                                "Issuer from certificate for CRL could not be reencoded.",
                                e);
                        }
                        DistributionPoint dp = new DistributionPoint(
                            new DistributionPointName(0, new GeneralNames(
                                new GeneralName(GeneralName.directoryName,
                                    issuer))), null, null);
                        ExtendedPKIXParameters paramsPKIXClone = (ExtendedPKIXParameters) paramsPKIX
                            .clone();
                        checkCRL(dp, attrCert, paramsPKIXClone, validDate,
View Full Code Here

            }
            // distribution point name is present
            if (idp != null && idp.getDistributionPoint() != null)
            {
                // make list of names
                DistributionPointName dpName = IssuingDistributionPoint
                    .getInstance(idp).getDistributionPoint();
                List names = new ArrayList();
                if (dpName.getType() == DistributionPointName.FULL_NAME)
                {
                    GeneralName[] genNames = GeneralNames.getInstance(
                        dpName.getName()).getNames();
                    for (int j = 0; j < genNames.length; j++)
                    {
                        names.add(genNames[j].getDEREncoded());
                    }
                }
                boolean matches = false;
                // verify that one of the names in the IDP matches one
                // of the names in the DP.
                if (dp.getDistributionPoint() != null)
                {
                    dpName = dp.getDistributionPoint();
                    if (dpName.getType() == DistributionPointName.FULL_NAME)
                    {
                        GeneralName[] genNames = GeneralNames.getInstance(
                            dpName.getName()).getNames();
                        for (int j = 0; j < genNames.length; j++)
                        {
                            if (names.contains(genNames[j]))
                            {
                                matches = true;
View Full Code Here

                        throw new AnnotatedException(
                            "Issuer from certificate for CRL could not be reencoded.",
                            e);
                    }
                    DistributionPoint dp = new DistributionPoint(
                        new DistributionPointName(0, new GeneralNames(
                            new GeneralName(GeneralName.directoryName, issuer))),
                        null, null);
                    ExtendedPKIXParameters paramsPKIXClone = (ExtendedPKIXParameters) paramsPKIX
                        .clone();
                    checkCRL(dp, paramsPKIXClone, cert, validDate, sign,
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.x509.DistributionPointName

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.