ber

ASN Basic Encoding Rule of an integer

三世轮回 提交于 2020-01-15 10:37:32
问题 I'm currently studying the Abstract Syntax Notation One and reading the ITU-T Recommendation X.690. On page 15 in paragraph 8.3.2, there is written: If the contents octets of an integer value encoding consist of more than one octet, then the bits of the first octet and bit 8 of the second octet: shall not all be ones; and shall not all be zero. NOTE – These rules ensure that an integer value is always encoded in the smallest possible number of octets. I understand that for the integer to be

ASN.1 Decode Error

﹥>﹥吖頭↗ 提交于 2020-01-07 07:42:09
问题 I am using Objective System Inc(http://www.obj-sys.com/products/asn1c/index.php) ASN.1 Compiler and the specification file(cdr_spec.asn) generated Java source code. The CDRS are enecoded based on format BER(Basic Encoding Rule) Command to generate Java source: ./asn1c cdr_spec.asn -java -ber -reader -print -getset -pkgname com.testpkg The source is generated: ASN1C Compiler, Version 6.4.5 Copyright (c) 1997-2011 Objective Systems, Inc. All Rights Reserved. Registered to: XXXXXX Parsing ASN.1

Parsing PDOL for GET PROCESSING OPTIONS command in EMV transaction

社会主义新天地 提交于 2019-12-19 06:57:34
问题 I am trying to build a correctly formatted GET PROCESSING OPTIONS command to be sent to a contactless EMV card. This post has been very helpful but I just need to know a little more detail. When parsing the PDOL, is it safe to assume that each tag is 2 bytes in length, followed by the size of the data expected in return? For example, the PDOL 9F66049F02069F37049F1A02 is broken into 9F66 04 , 9F02 06 , etc. each with 2 byte tags and 1 byte for the expected length of the data value. Is it safe

Can't DER encode and BER decode RSA public key

偶尔善良 提交于 2019-12-11 09:33:30
问题 I have problems using Crypto++ to save a RSA public key (that I obtained loading a private key file in PKCS#8 format). When decoding the key, I always get a BERDecodeErr exception. Here is the code I am using: CryptoPP::RSASSA_PKCS1v15_SHA_Signer _signer; CryptoPP::RSASSA_PKCS1v15_SHA_Verifier _verifier; CryptoPP::ByteQueue bytes; //_signer.AccessPublicKey().Save(bytes); // seem to save private key instead _signer.AccessKey().DEREncodePublicKey(bytes); //_verifier.AccessKey().Load(bytes); //

Confused about BER (Basic Encoding Rules)

拈花ヽ惹草 提交于 2019-12-10 21:27:59
问题 I'm trying to study and understand BER (Basic Encoding Rules). I've been using the website http://asn1-playground.oss.com/ to experiment with different ASN.1 objects and encoding them using BER. However, even the simplest encodings seem to confuse me. Let's take a simple ASN.1 schema: World-Schema DEFINITIONS AUTOMATIC TAGS ::= BEGIN Human ::= SEQUENCE { name UTF8String } END So basically this is just a SEQUENCE with a single UTF8String type field called name . An example of a value that

Parsing PDOL for GET PROCESSING OPTIONS command in EMV transaction

可紊 提交于 2019-12-01 05:18:35
I am trying to build a correctly formatted GET PROCESSING OPTIONS command to be sent to a contactless EMV card. This post has been very helpful but I just need to know a little more detail. When parsing the PDOL, is it safe to assume that each tag is 2 bytes in length, followed by the size of the data expected in return? For example, the PDOL 9F66049F02069F37049F1A02 is broken into 9F66 04 , 9F02 06 , etc. each with 2 byte tags and 1 byte for the expected length of the data value. Is it safe to assume that each tag is 2 bytes in length when parsing? No, you can't expect that each tag consists