using System.Collections.Generic;
namespace BinaryObjectScanner.ASN1
{
///
/// ASN.1 Parser
///
public static class AbstractSyntaxNotationOne
{
///
/// Parse a byte array into a DER-encoded ASN.1 structure
///
/// Byte array representing the data
/// Current pointer into the data
///
public static List Parse(byte[] data, int pointer)
{
// Create the output list to return
var topLevelValues = new List();
// Loop through the data and return all top-level values
while (pointer < data.Length)
{
var topLevelValue = new TypeLengthValue(data, ref pointer);
topLevelValues.Add(topLevelValue);
}
return topLevelValues;
}
}
}