/**
 * DER
 * 
 * A basic class to parse DER structures.
 * It is very incomplete, but sufficient to extract whatever data we need so far.
 * Copyright (c) 2007 Henri Torgemane
 * 
 * See LICENSE.txt for full license information.
 */
package com.hurlant.util.der
{
    import com.hurlant.math.BigInteger;
    
    import flash.utils.ByteArray;
    import com.hurlant.util.der.Sequence;
    import com.hurlant.util.Hex;
    
    // goal 1: to be able to parse an RSA Private Key PEM file.
    // goal 2: to parse an X509v3 cert. kinda.
    
    /**
     * DER for dummies:
     * http://luca.ntop.org/Teaching/Appunti/asn1.html
     * 
     * This class does the bare minimum to get by. if that.
     */
    public class DER
    {
        public static var indent:String = "";
        
        public static function parse(der:ByteArray, structure:*=n