0

I am able to parse the data using Asn1 (openssl). On parse I get the data in Hex format in "OCTET STRING". I found online tool which exactly what i need to do in Objective c i.e. Hex ASN decrypter

how do i Decode this Hex value in Objective C?

RohitK
  • 1,444
  • 1
  • 14
  • 37
  • Find a library that handles ASN.1 encoding, it will turn it into a set of bytes. Hexadecimal is just the way openssl prints the raw bytes, they're not stored that way. – Marc Sep 18 '20 at 15:11
  • I have parsed the data using "ASN1_parse" from openssl method. In that character buffer I get some valid info( in plain text) and some get in hex for "OCTET STRING". So how I get the plain text for "OCTET STRING" or decode the Hex value? – RohitK Sep 21 '20 at 12:20
  • I have decoded using option provided in https://stackoverflow.com/questions/6421282/how-to-convert-hex-to-nsstring-in-objective-c but it adds different characters like '\x15', '\x1a','\x1d',etc. – RohitK Sep 21 '20 at 12:23
  • Again: an OCTET STRING is just raw bytes, the hexadecimal is only openssl's way of display them in a friendly way. What these raw bytes are depends on the context. Please post your code and ASN1 data to be decoded. – Marc Sep 21 '20 at 12:23

0 Answers0