Package org.bouncycastle.asn1.x509

Examples of org.bouncycastle.asn1.x509.CRLDistPoint


    return false;
  }

  private Set getExtensionOIDs(boolean critical)
  {
    X509Extensions extensions = c.getExtensions();

    if ( extensions != null )
    {
      HashSet      set = new HashSet();
      Enumeration    e = extensions.oids();

      while (e.hasMoreElements())
      {
        DERObjectIdentifier  oid = (DERObjectIdentifier)e.nextElement();
        X509Extension    ext = extensions.getExtension(oid);

        if (critical == ext.isCritical())
        {
          set.add(oid.getId());
        }
View Full Code Here


    return getExtensionOIDs(false);
  }

    public byte[] getExtensionValue(String oid)
  {
    X509Extensions exts = c.getExtensions();

    if (exts != null)
    {
      X509Extension ext = exts.getExtension(new DERObjectIdentifier(oid));

      if (ext != null)
      {
        return ext.getValue().getOctets();
      }
View Full Code Here

    buf.append("      userCertificate: " + this.getSerialNumber() + nl);
    buf.append("       revocationDate: " + this.getRevocationDate() + nl);


    X509Extensions extensions = c.getExtensions();

    if ( extensions != null )
    {
      Enumeration e = extensions.oids();
      if ( e.hasMoreElements() )
      {
        buf.append("   crlEntryExtensions:" + nl);

        while ( e.hasMoreElements() )
        {
          DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
          X509Extension ext = extensions.getExtension(oid);
          buf.append(ext);
        }
      }
    }
View Full Code Here

            sig.initSign(key);
        }

        if (extensions != null)
        {
            tbsGen.setExtensions(new X509Extensions(extOrdering, extensions));
        }

        TBSCertList tbsCrl = tbsGen.generateTBSCertList();

        try
View Full Code Here

   
    certificateGenerator.setSignatureAlgorithm( "MD5WithRSAEncryption" );
   
    certificateGenerator.setSerialNumber( new BigInteger( ""+SystemTime.getCurrentTime()));
         
    X509Name  issuer_dn = new X509Name(true,cert_dn);
   
    certificateGenerator.setIssuerDN(issuer_dn);
   
    X509Name  subject_dn = new X509Name(true,cert_dn);
   
    certificateGenerator.setSubjectDN(subject_dn);
   
    Calendar  not_after = Calendar.getInstance();
   
View Full Code Here

            // Add the signerInfo version
            //
            signerinfo.add(new DERInteger(signerversion));

            IssuerAndSerialNumber isAnds = new IssuerAndSerialNumber(
                        new X509Name((ASN1Sequence)getIssuer(signCert.getTBSCertificate())),
                        new DERInteger(signCert.getSerialNumber()));
            signerinfo.add(isAnds);

            // Add the digestAlgorithm
            //
View Full Code Here

        if (paramsPKIX.isRevocationEnabled())
        {
            // check if revocation is available
            if (attrCert.getExtensionValue(NO_REV_AVAIL) == null)
            {
                CRLDistPoint crldp = null;
                try
                {
                    crldp = CRLDistPoint.getInstance(CertPathValidatorUtilities
                        .getExtensionValue(attrCert, CRL_DISTRIBUTION_POINTS));
                }
                catch (AnnotatedException e)
                {
                    throw new CertPathValidatorException(
                        "CRL distribution point extension could not be read.",
                        e);
                }
                try
                {
                    CertPathValidatorUtilities
                        .addAdditionalStoresFromCRLDistributionPoint(crldp,
                            paramsPKIX);
                }
                catch (AnnotatedException e)
                {
                    throw new CertPathValidatorException(
                        "No additional CRL locations could be decoded from CRL distribution point extension.",
                        e);
                }
                CertStatus certStatus = new CertStatus();
                ReasonsMask reasonsMask = new ReasonsMask();

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

        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

                        }
                        else if (oid
                            .equals(X509Extensions.CRLDistributionPoints))
                        {
                            buf.append(
                                new CRLDistPoint((ASN1Sequence) dIn
                                    .readObject())).append(nl);
                        }
                        else if (oid.equals(X509Extensions.FreshestCRL))
                        {
                            buf.append(
                                new CRLDistPoint((ASN1Sequence) dIn
                                    .readObject())).append(nl);
                        }
                        else
                        {
                            buf.append(oid.getId());
View Full Code Here

TOP

Related Classes of org.bouncycastle.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.