Package org.bouncycastle.asn1.x509.qualified

Examples of org.bouncycastle.asn1.x509.qualified.QCStatement


    {
        X509Extensions exts = c.getTBSCertificate().getExtensions();

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

        return null;
    }
View Full Code Here


    {
        X509Extensions exts = c.getTBSCertificate().getExtensions();

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

            if (ext != null)
            {
                ByteArrayOutputStream    bOut = new ByteArrayOutputStream();
                DEROutputStream            dOut = new DEROutputStream(bOut);
               
                try
                {
                    dOut.writeObject(ext.getValue());

                    return bOut.toByteArray();
                }
                catch (Exception e)
                {
View Full Code Here

                Enumeration     e = extensions.oids();

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

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

                       || oid.getId().equals("2.5.29.19"))
                    {
                        continue;
                    }

                    X509Extension       ext = extensions.getExtension(oid);

                    if (ext.isCritical())
                    {
                        return true;
                    }
                }
            }
View Full Code Here

            }

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

                if (ext.getValue() != null)
                {
                    byte[]                  octs = ext.getValue().getOctets();
                    ByteArrayInputStream    bIn = new ByteArrayInputStream(octs);
                    DERInputStream          dIn = new DERInputStream(bIn);
                    buf.append("                       critical(" + ext.isCritical() + ") ");
                    try
                    {
                        if (oid.equals(X509Extensions.BasicConstraints))
                        {
                            buf.append(new BasicConstraints((ASN1Sequence)dIn.readObject()) + nl);
View Full Code Here

            sig.initSign(key);
        }

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

        TBSCertificateStructure tbsCert = tbsGen.generateTBSCertificate();

        try
View Full Code Here

  private Set getExtensionOIDs(boolean critical)
  {
    if (this.getVersion() == 2)
    {
      HashSet         set = new HashSet();
      X509Extensions  extensions = c.getTBSCertList().getExtensions();
      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.getTBSCertList().getExtensions();

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

      if (ext != null)
      {
                ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
                DEROutputStream dOut = new DEROutputStream(bOut);
View Full Code Here

    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

TOP

Related Classes of org.bouncycastle.asn1.x509.qualified.QCStatement

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.