Package org.bouncycastle.asn1

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


            throws IOException
        {
            if (this.isASN1FormatString(format))
            {
                ASN1InputStream aIn = new ASN1InputStream(params);
                CAST5CBCParameters      p = CAST5CBCParameters.getInstance(aIn.readObject());

                keyLength = p.getKeyLength();

                iv = p.getIV();
View Full Code Here


        if (bytes != null)
        {
            try
            {
                ASN1InputStream dIn = new ASN1InputStream(bytes);
                ASN1Sequence    seq = (ASN1Sequence)dIn.readObject();
                List            list = new ArrayList();

                for (int i = 0; i != seq.size(); i++)
                {
                    list.add(((ASN1ObjectIdentifier)seq.getObjectAt(i)).getId());
View Full Code Here

                    buf.append("                       critical(").append(ext.isCritical()).append(") ");
                    try
                    {
                        if (oid.equals(Extension.basicConstraints))
                        {
                            buf.append(BasicConstraints.getInstance(dIn.readObject())).append(nl);
                        }
                        else if (oid.equals(Extension.keyUsage))
                        {
                            buf.append(KeyUsage.getInstance(dIn.readObject())).append(nl);
                        }
View Full Code Here

                        {
                            buf.append(BasicConstraints.getInstance(dIn.readObject())).append(nl);
                        }
                        else if (oid.equals(Extension.keyUsage))
                        {
                            buf.append(KeyUsage.getInstance(dIn.readObject())).append(nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeCertType))
                        {
                            buf.append(new NetscapeCertType((DERBitString)dIn.readObject())).append(nl);
                        }
View Full Code Here

                        {
                            buf.append(KeyUsage.getInstance(dIn.readObject())).append(nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeCertType))
                        {
                            buf.append(new NetscapeCertType((DERBitString)dIn.readObject())).append(nl);
                        }
                        else if (oid.equals(MiscObjectIdentifiers.netscapeRevocationURL))
                        {
                            buf.append(new NetscapeRevocationURL((DERIA5String)dIn.readObject())).append(nl);
                        }
View Full Code Here

    private Certificate readPKCS7Certificate(
        InputStream  in)
        throws IOException
    {
        BERInputStream  dIn = new BERInputStream(in);
        ASN1Sequence seq = (ASN1Sequence)dIn.readObject();

    if (seq.size() > 1
        && seq.getObjectAt(0) instanceof DERObjectIdentifier)
    {
          if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
View Full Code Here

  super("X.509");
  try {
      if ( encoding.equals( "PkiPath" ) )
      {
    DERInputStream derInStream = new DERInputStream(inStream);
    DERObject derObject = derInStream.readObject();
    if ( derObject == null || ! ( derObject instanceof ASN1Sequence ) )
    {
        throw new CertificateException("input stream does not contain a ASN1 SEQUENCE while reading PkiPath encoded data to load CertPath" );
    }
    Enumeration enumx = ((ASN1Sequence)derObject).getObjects();
View Full Code Here

  throws CertificateEncodingException
    {
  try {
      ByteArrayInputStream inStream = new ByteArrayInputStream( cert.getEncoded() );
      DERInputStream derInStream = new DERInputStream( inStream );
      return derInStream.readObject();
  } catch ( IOException ex ) {
      throw new CertificateEncodingException( "IOException caught while encoding certificate\n" + ex.toString() );
  }
    }
}
View Full Code Here

            try
            {
                ByteArrayInputStream    bIn = new ByteArrayInputStream(data);
                DERInputStream          dIn = new DERInputStream(bIn);

                key = (ASN1OctetString)dIn.readObject();
            }
            catch (IOException ex)
            {
                throw new IllegalArgumentException("error recovering public key");
            }
View Full Code Here

        throws IOException
    {
        ByteArrayInputStream    bIn = new ByteArrayInputStream(encoding);
        DERInputStream          dIn = new DERInputStream(bIn);

        return new DigestInfo((ASN1Sequence)dIn.readObject());
    }

    static public class SHA1WithRSAEncryption
        extends JDKDigestSignature
    {
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.