Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.BERInputStream.readObject()


            }
        }

        ASN1InputStream aIn = new ASN1InputStream(data);
                                           
        return aIn.readObject();
    }
   
    /**
     * return true if the passed in String can be represented without
     * loss as a PrintableString, false otherwise.
View Full Code Here


                        buf.append("                       critical(").append(ext.isCritical()).append(") ");
                        try
                        {
                            if (oid.equals(X509Extension.reasonCode))
                            {
                                buf.append(CRLReason.getInstance(ASN1Enumerated.getInstance(dIn.readObject()))).append(nl);
                            }
                            else if (oid.equals(X509Extension.certificateIssuer))
                            {
                                buf.append("Certificate issuer: ").append(GeneralNames.getInstance(dIn.readObject())).append(nl);
                            }
View Full Code Here

                            {
                                buf.append(CRLReason.getInstance(ASN1Enumerated.getInstance(dIn.readObject()))).append(nl);
                            }
                            else if (oid.equals(X509Extension.certificateIssuer))
                            {
                                buf.append("Certificate issuer: ").append(GeneralNames.getInstance(dIn.readObject())).append(nl);
                            }
                            else
                            {
                                buf.append(oid.getId());
                                buf.append(" value = ").append(ASN1Dump.dumpAsString(dIn.readObject())).append(nl);
View Full Code Here

                                buf.append("Certificate issuer: ").append(GeneralNames.getInstance(dIn.readObject())).append(nl);
                            }
                            else
                            {
                                buf.append(oid.getId());
                                buf.append(" value = ").append(ASN1Dump.dumpAsString(dIn.readObject())).append(nl);
                            }
                        }
                        catch (Exception ex)
                        {
                            buf.append(oid.getId());
View Full Code Here

  static IssuerInformation issuerInformationFromPreCertificateSigningCert(
      Certificate certificate, byte[] keyHash) {
    try (ASN1InputStream aIssuerIn = new ASN1InputStream(certificate.getEncoded())) {
      org.bouncycastle.asn1.x509.Certificate parsedIssuerCert =
          org.bouncycastle.asn1.x509.Certificate.getInstance(aIssuerIn.readObject());

      Extensions issuerExtensions = parsedIssuerCert.getTBSCertificate().getExtensions();
      Extension x509authorityKeyIdentifier = null;
      if (issuerExtensions != null) {
        x509authorityKeyIdentifier =
View Full Code Here

    // parsing discards the order of the extensions. The signature from SCT we're verifying
    // is over the TBSCertificate in its original form, including the order of the extensions.
    // Get the list of extensions, in its original order, minus the poison extension.
    try (ASN1InputStream aIn = new ASN1InputStream(preCertificate.getEncoded())) {
      org.bouncycastle.asn1.x509.Certificate parsedPreCertificate =
          org.bouncycastle.asn1.x509.Certificate.getInstance(aIn.readObject());
      // Make sure that we have the X509akid of the real issuer if:
      // The PreCertificate has this extension, AND:
      // The PreCertificate was signed by a PreCertificate signing cert.
      if (hasX509AuthorityKeyIdentifier(parsedPreCertificate) &&
          issuerInformation.issuedByPreCertificateSigningCert()) {
View Full Code Here

    {
        try
        {
            ASN1InputStream         dIn = new ASN1InputStream(bytes);

            return (ASN1Sequence)dIn.readObject();
        }
        catch (Exception e)
        {
            throw new IllegalArgumentException("badly encoded request");
        }
View Full Code Here

            ASN1OctetString issuerNameHash = new DEROctetString(digest.digest());
            PublicKey issuerKey = issuerCert.getPublicKey();

            ASN1InputStream aIn = new ASN1InputStream(issuerKey.getEncoded());
            SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(aIn.readObject());

            digest.update(info.getPublicKeyData().getBytes());

            ASN1OctetString issuerKeyHash = new DEROctetString(digest.digest());
View Full Code Here

        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        DEROutputStream dOut = new DEROutputStream(bOut);

        ASN1InputStream contentIn = new ASN1InputStream(content.getOctets());
        ASN1Primitive obj = contentIn.readObject();

        dOut.writeObject(obj);

        info = new ContentInfo(info.getContentType(), new DEROctetString(bOut.toByteArray()));
View Full Code Here

                ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded());

                try
                {
                    tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject()));
                }
                catch (IOException e)
                {
                    throw new CRLException("exception processing encoding of CRL: " + e.toString());
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.