Giter Club home page Giter Club logo

bertlv.net's Introduction

BerTlv.NET

Build status

BerTlv.NET is a library that makes parsing TLV data easy. It is especially useful for parsing things like EMV credit card transaction data.

Get It

You can install BerTlv.NET from nuget:

PM> Install-Package BerTlv.NET

Or download and build the source from here and reference the BerTlv.dll.

Use It

Using BerTlv.NET is very simple. Two static methods are exposed to you in the Tlv class (one for hex and one for a byte array). Example:

First add the using statement:

using BerTlv;

then:

ICollection<Tlv> tlvs = Tlv.ParseTlv("6F1A840E315041592E5359532E4444463031A5088801025F2D02656E");

// Use the tlvs collection now.

Changelog

2.0.3

Fixes issue with parsing of null bytes (0x00) before, between, or after a valid tag

2.0.2

Add netstandard2.0 support.

2.0.1

Add back net45 support.

2.0.0

Change project to use netstandard1.1.

1.0.1

Renamed Tlv.DataHex property to Tlv.HexData to be consistent with the naming convention of the rest of the Tlv.Hex* properties.

1.0.0

Initial release.

bertlv.net's People

Contributors

bepursuant avatar kspearrin avatar mark-rsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bertlv.net's Issues

TLV String not working properly

HI I have a problem with a particular Strigng Hex. I tested the Hex String on a thirdparty webpage and had result, but with the library had the next message error.

The TLV String:
78795C185F605F615F625F635F645F6A5F215F225F235F7D5F7B5F7C5F600834353936393633305F6101355F620556494C43415F63075A4150415441205F64114B4154484552494E452043594E544849415F6A01465F21063134303133325F22063035303438365F2304202409055F7D005F7B005F7C041900010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

The app that I testestd the String:
http://www.emvlab.org/tlvutils/

The Exception:
Message = "Index was outside the bounds of the array."
StackTrace = " at BerTlv.Tlv.ParseTlv(Byte[] rawTlv, ICollection1 result)\r\n at BerTlv.Tlv.ParseTlv(Byte[] tlv)\r\n at BerTlv.Tlv.ParseTlv(String tlv)\r\n at PCSC.DNIe.Logic.DNIe.SetPersonalData(Response response) in D:\\TFS\\TFS_Outlook_jdp\\DNIe\\PCSC.DNIe\\... TargetSite = {Void ParseTlv(Byte[], System.Collections.Generic.ICollection1[BerTlv.Tlv])}
InvocationFlags = INVOCATION_FLAGS_INITIALIZED | INVOCATION_FLAGS_NEED_SECURITY

Thanks.

Greeting.

Error with simple TLV

Hello,
I get an error when I try to parse a very short TLV string, just one tag:
Tlv.ParseTlv("FF01014C");
where FF01 is a tag in 2 bytes
second 01 is len
4C is value

The returned exception is a System.IndexOutOfRangeException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.