FileDocCategorySizeDatePackage
ParseTest.javaAPI DocBouncy Castle Crypto API 1.41 (Java 1.5)18814Wed Oct 01 10:56:10 BST 2008org.bouncycastle.sasn1.test

ParseTest

public class ParseTest extends TestCase
deprecated
obsolete test case

Fields Summary
private static byte[]
classCastTest
private static byte[]
derExpTest
byte[]
longTagged
Constructors Summary
Methods Summary
private voidparseEnveloped(byte[] data)

        Asn1InputStream aIn = new Asn1InputStream(data);
        
        ContentInfoParser cP = new ContentInfoParser((Asn1Sequence)aIn.readObject());
        
        EnvelopedDataParser eP = new EnvelopedDataParser((Asn1Sequence)cP.getContent(BerTag.SEQUENCE));
        
        eP.getRecipientInfos();
        
        EncryptedContentInfoParser ecP = eP.getEncryptedContentInfo();
        
        Asn1OctetString content = (Asn1OctetString)ecP.getEncryptedContent(BerTag.OCTET_STRING);
        
        InputStream in = content.getOctetStream();
        
        while (in.read() >= 0)
        {
            // do nothing
        }
    
public voidtestClassCast()

    
      
         
    
        parseEnveloped(classCastTest);
    
public voidtestDerExp()

        parseEnveloped(derExpTest);
    
public voidtestLongTag()

        Asn1InputStream aIn = new Asn1InputStream(longTagged);
        
        Asn1TaggedObject tagged = (Asn1TaggedObject)aIn.readObject();
        
        assertEquals(31, tagged.getTagNumber());