Package gnu.java.security.x509

Examples of gnu.java.security.x509.X509Certificate


    return Collections.unmodifiableSet(s);
  }

  public byte[] getExtensionValue(String oid)
  {
    Extension e = getExtension(new OID(oid));
    if (e != null)
      {
        return e.getValue().getEncoded();
      }
    return null;
  }
View Full Code Here


            val = der.read();
            if (!val.isConstructed())
              throw new IOException("malformed Extension");
            if (Configuration.DEBUG)
              log.fine("start Extension  len == " + val.getLength());
            Extension e = new Extension(val.getEncoded());
            extensions.put(e.getOid(), e);
            der.skip(val.getLength());
            len += val.getEncodedLength();
            if (Configuration.DEBUG)
              log.fine("current count == " + len);
          }
View Full Code Here

              }
          }
        PolicyConstraint constr = null;
        if (p[i] instanceof GnuPKIExtension)
          {
            Extension pcx = ((GnuPKIExtension) p[i]).getExtension(PolicyConstraint.ID);
            if (pcx != null)
              constr = (PolicyConstraint) pcx.getValue();
          }
        else
          {
            byte[] pcx = p[i].getExtensionValue(PolicyConstraint.ID.toString());
            if (pcx != null)
View Full Code Here

    if (cert instanceof GnuPKIExtension)
      {
        Collection exts = ((GnuPKIExtension) cert).getExtensions();
        for (Iterator it = exts.iterator(); it.hasNext();)
          {
            Extension ext = (Extension) it.next();
            if (ext.isCritical() && ! ext.isSupported())
              s.add(ext.getOid().toString());
          }
      }
    else
      s.addAll(cert.getCriticalExtensionOIDs());
    return s;
View Full Code Here

    for (int i = index - 1; i > 0; i--)
      {
        if (! path[i].getIssuerDN().equals(path[i].getSubjectDN()))
          pathLen++;
      }
    Extension e = null;
    if (cert instanceof GnuPKIExtension)
      {
        e = ((GnuPKIExtension) cert).getExtension(BasicConstraints.ID);
      }
    else
      {
        try
          {
            e = new Extension(cert.getExtensionValue(BasicConstraints.ID.toString()));
          }
        catch (Exception x)
          {
          }
      }
    if (e == null)
      throw new CertPathValidatorException("no basicConstraints");
    BasicConstraints bc = (BasicConstraints) e.getValue();
    if (! bc.isCA())
      throw new CertPathValidatorException(
          "certificate cannot be used to verify signatures");
    if (bc.getPathLengthConstraint() >= 0
        && bc.getPathLengthConstraint() < pathLen)
View Full Code Here

              }
          }
      }
    while (! stack.isEmpty());

    Extension e = null;
    CertificatePolicies policies = null;
    List qualifierInfos = null;
    if (cert instanceof GnuPKIExtension)
      {
        e = ((GnuPKIExtension) cert).getExtension(CertificatePolicies.ID);
        if (e != null)
          policies = (CertificatePolicies) e.getValue();
      }

    List cp = null;
    if (policies != null)
      cp = policies.getPolicies();
View Full Code Here

    if (pathToNames != null)
      {
        NameConstraints nc = null;
        if (cert instanceof GnuPKIExtension)
          {
            Extension e =
              ((GnuPKIExtension) cert).getExtension(NameConstraints.ID);
            if (e != null)
              nc = (NameConstraints) e.getValue();
          }
        else
          {
            byte[] b = cert.getExtensionValue(NameConstraints.ID.toString());
            if (b != null)
View Full Code Here

      case x400Address:
      case otherName:
        throw new IOException("cannot decode string representation of "
                              + kind);
    }
    return new GeneralName(kind, nameBytes);
  }
View Full Code Here

   * @param name The DER-encoded bytes of the name to match.
   * @throws IOException If the name DER is malformed.
   */
  public void addPathToName(int id, byte[] name) throws IOException
  {
    GeneralName generalName = new GeneralName(GeneralName.Kind.forTag(id), name);
    if (pathToNames == null)
      pathToNames = new LinkedList<GeneralName>();
    pathToNames.add(generalName);
  }
View Full Code Here

   * @param name The name.
   * @throws IOException If the name cannot be decoded.
   */
  public void addPathToName(int id, String name) throws IOException
  {
    GeneralName generalName = makeName(id, name);
    if (pathToNames == null)
      pathToNames = new LinkedList<GeneralName>();
    pathToNames.add(generalName);
  }
View Full Code Here

TOP

Related Classes of gnu.java.security.x509.X509Certificate

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.