Package org.bouncycastle2.asn1

Examples of org.bouncycastle2.asn1.ASN1Sequence


        {
            ASN1Set         set = ASN1Set.getInstance(e.nextElement());

            for (int i = 0; i < set.size(); i++)
            {
                   ASN1Sequence s = ASN1Sequence.getInstance(set.getObjectAt(i));

                   if (s.size() != 2)
                   {
                       throw new IllegalArgumentException("badly sized pair");
                   }

                   ordering.addElement(DERObjectIdentifier.getInstance(s.getObjectAt(0)));
                  
                   DEREncodable value = s.getObjectAt(1);
                   if (value instanceof DERString && !(value instanceof DERUniversalString))
                   {
                       String v = ((DERString)value).getString();
                       if (v.length() > 0 && v.charAt(0) == '#')
                       {
View Full Code Here


        ASN1Sequence   seq)
    {
        Enumeration e = seq.getObjects();
        while (e.hasMoreElements())
        {
            ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement());
            policies.addElement(s.getObjectAt(0));
        }
        // For now we just don't handle PolicyQualifiers
    }
View Full Code Here

            ASN1InputStream bIn = new ASN1InputStream(encoded);
            PrivateKey      privKey;

            try
            {
                ASN1Sequence         s = (ASN1Sequence)bIn.readObject();
                PrivateKeyInfo       in = new PrivateKeyInfo(s);

                DERObjectIdentifier  oid = in.getAlgorithmId().getObjectId();

                if (oid.equals(X9ObjectIdentifiers.id_ecPublicKey))
View Full Code Here

    private BigInteger[] derDecode(
        byte[]  encoding)
        throws IOException
    {
        ASN1Sequence s = (ASN1Sequence)ASN1Object.fromByteArray(encoding);
        return new BigInteger[]{
            ((DERInteger)s.getObjectAt(0)).getValue(),
            ((DERInteger)s.getObjectAt(1)).getValue()
        };
    }
View Full Code Here

    {
        Enumeration e = seq.getObjects();

        while (e.hasMoreElements())
        {
            ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement());
            attributes.addElement(new Attribute(s));
        }
    }
View Full Code Here

    private Certificate readDERCertificate(
        ASN1InputStream dIn)
        throws IOException, CertificateParsingException
    {
        ASN1Sequence    seq = (ASN1Sequence)dIn.readObject();

        if (seq.size() > 1
                && seq.getObjectAt(0) instanceof DERObjectIdentifier)
        {
            if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
            {
                sData = new SignedData(ASN1Sequence.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(1), true)).getCertificates();

                return getCertificate();
            }
        }
View Full Code Here

    private Certificate readPEMCertificate(
        InputStream  in)
        throws IOException, CertificateParsingException
    {
        ASN1Sequence seq = PEM_CERT_PARSER.readPEMObject(in);

        if (seq != null)
        {
            return new X509CertificateObject(
                            X509CertificateStructure.getInstance(seq));
View Full Code Here

   
    private CRL readPEMCRL(
        InputStream  in)
        throws IOException, CRLException
    {
        ASN1Sequence seq = PEM_CRL_PARSER.readPEMObject(in);

        if (seq != null)
        {
            return createCRL(
                            CertificateList.getInstance(seq));
View Full Code Here

    private CRL readDERCRL(
        ASN1InputStream  aIn)
        throws IOException, CRLException
    {
        ASN1Sequence     seq = (ASN1Sequence)aIn.readObject();

        if (seq.size() > 1
                && seq.getObjectAt(0) instanceof DERObjectIdentifier)
        {
            if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
            {
                sCrlData = new SignedData(ASN1Sequence.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(1), true)).getCRLs();
   
                return getCRL();
            }
        }
View Full Code Here

        DERInteger i1;
        DERInteger i2;

        try
        {
            ASN1Sequence s = (ASN1Sequence)aIn.readObject();

            i1 = (DERInteger)s.getObjectAt(0);
            i2 = (DERInteger)s.getObjectAt(1);
        }
        catch (IOException e)
        {
            throw new PGPException("exception encoding signature", e);
        }
View Full Code Here

TOP

Related Classes of org.bouncycastle2.asn1.ASN1Sequence

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.