BOS.ASN1 -> BOS.ASN1

This commit is contained in:
Matt Nadareski
2023-03-07 12:42:39 -05:00
parent 777fdc14c8
commit e32b24c9f6
15 changed files with 15 additions and 15 deletions

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
namespace BinaryObjectScanner.ASN1
{
/// <summary>
/// ASN.1 Parser
/// </summary>
public static class AbstractSyntaxNotationOne
{
/// <summary>
/// Parse a byte array into a DER-encoded ASN.1 structure
/// </summary>
/// <param name="data">Byte array representing the data</param>
/// <param name="pointer">Current pointer into the data</param>
/// <returns></returns>
public static List<TypeLengthValue> Parse(byte[] data, int pointer)
{
// Create the output list to return
var topLevelValues = new List<TypeLengthValue>();
// 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;
}
}
}