Questions tagged [asn.1]

ASN.1 stands for Abstract Syntax Notation One. It is a data specification language and a set of encoding rules for serializing the data.

0
votes
1answer
12 views

Validate signature from public key, automatically detect algorithm in BouncyCastle

My question is: how can I write my signature validation function to be agnostic of the public key algorithm? I'm working with .Net's BouncyCastle library (v1.8.4). I'm trying to validate a signature ...
0
votes
0answers
31 views

Control Transfer failing Android Unity

I am trying to configure a neonode sensor by doing a controlTransfer over USB. My transfer keeps failing even though I have given my android device(a hikey 960 board) permisssion to the USB and the ...
0
votes
0answers
26 views

SNMP BER Integer encoding

I'm trying to learn this "simple" protocol. Too simple to have two versions of the simple integer BER encoding. One: https://www.rane.com/note161.html Second: https://en.wikipedia.org/wiki/X.690#...
1
vote
1answer
18 views

Is this double constraint syntax from PKCS#9 legal?

In the PKCS#9 standard they have the following assignment. The first line defines a type PrintableString, that can only two characters long, and must be one of the two letter country acronyms defined ...
0
votes
0answers
33 views

How to encode byte[] to DER Encoding in java?

I need to encode a byte[] to ASN.1 DER encoding format. Is there a code sample to do it in java?
0
votes
1answer
30 views

Digital Signature in Python Without ASN.1 Encoding?

We need to generate a digital signature without ASN.1 encodings for verification by a downstream application. We can do this with openssl on the command line via: openssl pkeyutl -sign -inkey keyfile ...
1
vote
2answers
93 views

Verify a signature file (PKCS7) with WinCrypt or CNG

I need to verify a signed JAR file using Windows crypto API methods. I have only a basic understanding of encryption and signing matters. I'm also new to those crypto APIs (WinCrypt, Bcrypt, Ncrypt). ...
2
votes
1answer
60 views

What is the double brace syntax in ASN.1?

I'm reading the PKCS #7 ASN.1 definition, and came across this type. I can't seem to find out what {{Authenticated}} is doing in this code, or what production this would be called. I've also seen as {{...
1
vote
1answer
32 views

Is decoding of PKCS8 key from Base64 encoded ASN1 structure fault tolerant?

I'm using Spongy Castle library to encode my users private key (PKCS8) into an ASN1 entity and afterwards as Base64 encoded string into a QR code. One of my colleagues found out that it's possible to ...
2
votes
1answer
70 views

Building an ASN1 set using the openssl C API

I'm trying to build a set of sequences using the openssl C API. As was noted in various places, the documentation is VERY sparse on this and code samples seem to be non-existent. I've found various ...
1
vote
2answers
69 views

Print human readable values for LDAP protocol fields in asn1c

I use asn1c to parse the LDAP messages. For this purpose, after compiling the ASN.1 Definition defined in rfc4511, I use the ber_decode and xer_fprint functions for decoding and printing content in ...
1
vote
1answer
64 views

How add a message optional parts in the ASN.1 generated C codes

I have used the C code from libosmo-asn1-map to obtain an implementation of the GSM_MAP protocol. Then I try to encode a "Send authentication Info" message. As mentioned in the 3GPP TS 29.002, this ...
2
votes
0answers
84 views

File name conflict in C codes generated by osmocom asn1c for GSM_MAP/TCAP protocols

I have used the osmocom asn1c compiler (the aper-prefix branch), to obtain an implementation of the GSM_MAP and TCAP protocols. Each protocol has been successfully compiled. But during the use of both ...
2
votes
1answer
73 views

Problem in compiling C code generated by osmocom asn1c

I have installed the osmocom asn1c compiler, the aper-prefix branch, to obtain an implementation of the TCAP protocol. I have used the respective script to compile the ".asn" files. The C files are ...
1
vote
0answers
49 views

Opensource TCAP/MAP C/C++ implementation

I am looking for C/C++ implementation for encoding and decoding of TCAP/MAP layers. I am already aware of osmocom. I would like to know whether there exists any other reliable opensource tool for this ...
0
votes
1answer
82 views

Error in generating C code from GSM-TCAP asn1 files

I am trying to generate C code for the GSM-TCAP asn1 files obtained from libosmo-asn1-TCAP. I have installed the osmocom libasnc1 compiler (tried both master and aper-prefix branches) and run this ...
0
votes
0answers
27 views

Is there a ASN.1 reparser / compound ASN.1 display tool?

I'm writing a standard / reference implementation of (certain aspects of) CMS (Cryptographic Message Syntax, RFC 5652), described across several tens of RFC's, where some of the ASN.1 goes back for ...
0
votes
0answers
28 views

How to check the starting point of ASN.1 messages in a long hex with PYASN1

I have a very long hex stream in input containing several ASN.1 messages, but they are not at fixed position, can start anywhere and have any length, also the stuff that is in between them is random ...
0
votes
1answer
85 views

How to prettyprint as hex a pyasn1 octect string that is printed as ascii

I have some pyasn1 octect string objects defined like this: LInfo.componentType = namedtype.NamedTypes(namedtype.NamedType('XXX', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(...
4
votes
1answer
126 views

Why is unmarshalling of a DER ASN.1 large integer limited to SEQUENCE in Golang?

I would like to be able to unmarshal a large integer from a DER file using the encoding/asn1 package, but it looks like it only works for a SEQUENCE of integers. For example, this does not work, ...
0
votes
0answers
147 views

C++ How to Convert Pem to ASN.1

My main goal is extract ocsp response in cms signed data. But, c++ openssl doesn't provide it. So, I'd like to do it step by step. Convert CMS signed Data(Base64) to asn.1 Find OCSP Response(OID: 1....
0
votes
0answers
67 views

ASN.1 with Python: How to navigate ASN.1 file using Python (keeping the position of data in the binary file)

I have to find values of some specific field tags in ASN.1 files that I receive (say in HEX format). What I need to do is to go field by field, and what I find the ones that need to be rehashed ...
0
votes
2answers
155 views

parsing ASN files using bouncy castle

am trying to parse binary CDRs using JASN1 I have successfully generated Java classes using grammer file not I have a CDR which I need to decode, but I can't get it to work, I don't understand what ...
0
votes
3answers
112 views

ASN.1 BER Encode Integer 0x‭10000000FFFFFFFC Indefinite Length Encoded

I am implementing BER according to spec and I am asking myself the question: How would I encode an Integer 0x‭10000000FFFFFFFC as BER Integer (Tag 0x02) when I use the indefinite length encoding? I ...
0
votes
0answers
31 views

Bouncycastle asn.1 [duplicate]

How to compile asn.1 files to java using bouncycastle ? PrivateKeyInfo ::= SEQUENCE { version Version, privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, privateKey PrivateKey, attributes [0] ...
0
votes
0answers
49 views

bouncycastle compile asn to create CSR: Certificate Signing Request

How can i compile asn file with bouncycastle to create a csr ?? ASN.1 files are a security specification for message signing. https://forge.etsi.org/gitlab/ITS/ITS_ASN1/tree/...
0
votes
1answer
65 views

Antlr4 compile ASN.1

Antlr4 gives me an error by compiling the following file: IEEE1609dot2 {iso(1) identified-organization(3) ieee(111) standards-association-numbered-series-standards(2) wave-stds(1609) dot2(2) base (...
1
vote
1answer
101 views

Decoding timestamp encoded in ASN.1 (javascript)

I am trying to decode the timestamp which I am receiving from my HTTP post request, but this is a really complex task, I do not even have any proper insight into ASN.1/RFC 3161 so if anyone out there ...
0
votes
0answers
120 views

Asn1 Schema parsing

My requirement is to create a dictionary based on the asn file and then fill its value using an excel sheet and then later encode/decode, Now here for the below schema, Is the Parsed output and ...
0
votes
1answer
137 views

ASN.1 type 0x80

My ASN.1 decoder was working fine up until I faced an interesting type: 0x80 which was decoded by online tools as a simple type with name [0]. I found some sources mentioning this to be "indefinite ...
-1
votes
1answer
49 views

How to implement ASN1 decoding in Java Spring?

I need to decode ASN1 strings from a complex sequence but I just cannot figure out how this whole thing works. I'd like to do something like decoder = ASN1Library.initWithSequence(sequenceString); ...
1
vote
1answer
84 views

CAdES signature with win32 low level message apis

I am trying to use the low level message functions to create a CAdES-BES compliant signature. The signature has to be in proper PKCS#7 format along with four signed attributes present. The first two,...
1
vote
1answer
74 views

ASN.1 object identifier values greater than 128

So I understand the way the values are encoded when their values are less than 127. However, after reading https://docs.microsoft.com/en-us/windows/desktop/seccertenroll/about-object-identifier, i ...
-1
votes
1answer
74 views

Parsing and editing ASN1 binary blob in C

I have a valid encoded ASN1 binary blob, which I want to modify. Moreover, I don't have the encoded ASN1's definitions file, but I know it's structure (e.g. let's say it's a sequence that contains few ...
1
vote
1answer
281 views

Why is an error thrown in Python cryptography RSA decryption of encrypted AES key?

I am trying to decrypt an AES key from a DER-encoded file that has been encrypted in RSA format. With the following code: for key, value in configfile['File Extensions'].items(): ...
0
votes
0answers
43 views

How do I get access to RSA-encrypted AES key data from EncryptedKey object? Python

I am trying to access key data bytes from an EncryptedKey object. I am unclear on whether this is a PyAsn1 object or a Python object or a Python cryptography object. How do I access the key data? I ...
0
votes
2answers
122 views

Encoding SNMP Message and Reading Response From Agent

I am trying to send a very basic SNMP Get request to a client using Go. I have an SNMP message for getting the OID 1.3.6.1.2.1.1 that I manually encoded into a byte slice according to this post as ...
0
votes
3answers
61 views

Can ASN.1 support putting field lengths in a different place?

I have a protocol whose on-the-wire format is already defined and I'd like to use ASN.1 to encode/decode it, but it seems to break the defined BER/DER/PER options. For whatever reason, the protocol ...
2
votes
1answer
211 views

Decode ASN.1 - PKCS#7 non-detached signature

I am pretty new to ASN.1 format. I have a PKCS#7 signature which after doing an ASNdump looks like the one below. Can someone help me understand what each element below signifies? I could only ...
0
votes
1answer
228 views

Go invalid ASN.1 Object Identifier encoding error

I am trying to create a DER file using encoding/asn1, and I keep getting an invalid Object Identifier runtime error. asn1.ObjectIdentifier is just an []int, so I'm not sure what's invalid. package ...
3
votes
1answer
298 views

Convert RSA Public key (1024 bit) format to DER ASN.1 public key for Java

Here is my Code for generating RSA key public static void generateRsaKeyPair() { try { KeyPairGenerator keyPairGene = KeyPairGenerator.getInstance("RSA"); keyPairGene.initialize(512); ...
0
votes
0answers
39 views

How to extract some Info from certificate handshake messages in ssl protocol using ASN1?

I want to extract some informations (like CountryName, OrganizationName and ... for subject and issuer) form handshake messages which its handshake type is certificate, and i want to use ASN.1 to ...
0
votes
1answer
148 views

How to decode ASN.1 Per in Android?

I have a binary or hex decimal information which is encoded using the ASN.1 PER aligned and unaligned type(ASN.1 PER ISO 8825-2) from an NFC tag. Is there any library supports the encoding and ...
0
votes
1answer
76 views

How to recover the substrate from a pyasn1 object?

I have a complicated nested ASN.1 structure as bytes. I want to find all T61Strings (say) in that structure, in the original byte encoding. Is this possible in pyasn1? So far, I only know how to ...
0
votes
2answers
255 views

Identify if a file uses BER encoding

I'm new to ASN.1 encoding, and I'm wondering if a BER encoded file has a header or anything that identifies it as a BER encoded file. I mean, if someone just hands me a file, could I tell that it is ...
0
votes
2answers
57 views

value notation for ENUMERATED alternative of a CHOICE

With following specification G-011 DEFINITIONS AUTOMATIC TAGS ::= BEGIN Payment-method ::= CHOICE { check NumericString(SIZE (15)), credit-card Credit-card, cash NULL } ...
0
votes
0answers
31 views

can BERDecoder().decode(args..) API of ASN1 Binary notes, decode more than 2 MB binary data in single instance?

I am trying to decode the ASN1 BER encoded data(more than 2 MB data) in single instance using Java BERDecoder().decode(InputStream arg0, Class arg1) API of ASN1 binary notes, But I am not able to ...
0
votes
0answers
61 views

BouncyCastle add KeyUsage extension to CertificationRequestInfo

I would like to add KeyUsage extension to CertificationRequestInfo using BouncyCastle. I have the following: PublicKey publicKey = keyPair.getPublicKey(); X500Name x500Name = new X500Name("CN=Test"); ...
0
votes
1answer
137 views

Add Key Usage to CertificateSigningInfo in Java

I am trying to add Key Usage to certificateSigningInfo in Java without using BouncyCastle. I have the following method which will create certificateSigningInfo that can be further signed to create ...
0
votes
3answers
141 views

I am new to ASN.1 coding. I am trying to create parse data from a ASN.1 format, replace values to the tag and regenerate a file in same format

This is my input template: headerValue ProfileElement ::= header : { major-version 2, minor-version 0, profileType "GSMA Profile Package", iccid '89019990001234567893'H, eUICC-Mandatory-services ...

http://mssss.yulina-kosm.ru