Package org.bouncycastle.asn1.x509

Examples of org.bouncycastle.asn1.x509.X509CertificateStructure


        }
        return result;
    }

    private static X509AuxCertificate certificateFromASN1(DEREncodable current) throws PKCS7Exception {
        X509CertificateStructure struct = X509CertificateStructure.getInstance(current);
        try {
            return new X509AuxCertificate(new X509CertificateObject(struct));
        } catch (CertificateParsingException cpe) {
            throw new PKCS7Exception(PKCS7.F_B64_READ_PKCS7, PKCS7.R_CERTIFICATE_VERIFY_ERROR, cpe);
        }
View Full Code Here


                                    * Parse the certificates.
                                    */
                                    Certificate cert = Certificate.parse(is);
                                    assertEmpty(is);

                                    X509CertificateStructure x509Cert = cert.certs[0];
                                    SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();

                                    try
                                    {
                                        this.serverPublicKey = PublicKeyFactory.createKey(keyInfo);
                                    }
View Full Code Here

    }
   
    public byte[] getEncoded()
        throws CertificateEncodingException
    {
        X509CertificateStructure f = null;
        X509CertificateStructure r = null;
        try
        {
            if (forward != null)
            {
                f = X509CertificateStructure.getInstance(new ASN1InputStream(
View Full Code Here

        {
            extensions = new Hashtable();
            extOrdering = new Vector();
        }

        extensions.put(OID, new X509Extension(critical, new DEROctetString(value)));
        extOrdering.addElement(OID);
    }
View Full Code Here

      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

  {
    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);

                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 (critical == ext.isCritical())
        {
          set.add(oid.getId());
        }
      }
View Full Code Here

  {
    X509Extensions exts = c.getExtensions();

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

      if (ext != null)
      {
        return ext.getValue().getOctets();
      }
    }

    return null;
  }
View Full Code Here

        buf.append("   crlEntryExtensions:" + nl);

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

        {
            extensions = new Hashtable();
            extOrdering = new Vector();
        }

        extensions.put(OID, new X509Extension(critical, new DEROctetString(value)));
        extOrdering.addElement(OID);
    }
View Full Code Here

TOP

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

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.