asn.1

Is the length of a DER-encoded RSAPublicKey (PKCS #1) for a 1024-bit RSA key pair consistent?

梦想与她 提交于 2019-12-12 04:45:45
问题 I've created multiple 1024-bit DER-encoded RSAPublicKeys (PKCS #1) with the openssl command: openssl genrsa 1024 | openssl rsa -outform DER -RSAPublicKey_out -out pubkey.der So far, every public key file created like this has been exactly 140 bytes. Are 1024-bit RSA public keys encoded in this format always 140 bytes, or can this size vary? I've learned that the size of a DER encoded private key can vary. 回答1: It should always be 140 bytes for a 1024-bit key using an exponent value of F4

ASN1 RFC1212 giving syntax error

喜欢而已 提交于 2019-12-12 03:59:28
问题 i am trying to compile ASN file using ASN.1 Studio. the file i m using is RFC-1212. i am getting "error A0120E: Parsing error: expecting typereference but found indextype." anyone had the same problem. if not please share the RFC-1212 mib file Regards Giri 来源: https://stackoverflow.com/questions/32561902/asn1-rfc1212-giving-syntax-error

decoding asn.1 compiler output as strings

点点圈 提交于 2019-12-12 02:36:00
问题 I ran the free online compiler (at http://lionet.info/asn1c/asn1c.cgi) and created source files for the IMSRecord (telecom CDR). It built okay, but when I run the generated C executable, it prints the strings as hex characters, as follows: sIP-Method: 49 4E 56 49 54 45 How can I get it to print as sIP-Method: INVITE I tried the various command-line options, but could not get it to change. Is this perhaps related to one of the online compiler options that I probably did not understand at the

Extract extension id from (ASN1) mozilla.rsa file

时间秒杀一切 提交于 2019-12-12 02:12:49
问题 How do you retrieve the extension ID from the xpi file? (It is needed f.ex. for global extension installation) In previous versions, you could get it from the install.rdf , which no longer exists in WebExtensions. http://www.di-mgt.com.au/how-mozilla-signs-addons.html describes that it is contained in the META-INF/mozilla.rsa file. In python, there is the pyasn1 library. I could not get it to work on the first attempt: from pyasn1.codec.der import decoder f = open('/path/to/addon-dir/META-INF

parsing ASN files using bouncy castle

余生颓废 提交于 2019-12-11 16:11:57
问题 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 kind of inputs it requires I have reached a point where I can parse CDR into lines like below [1][[0]#01, [1]#26fd, [3]#4131002400, [8]#14040020236233, [9]#21436500000041, [10]#196105000045ffffffffffff, [13]#13900049999957, [14]#21436549999961, [15]#05, [16]#05, [17]#116102999954ffffffffffff, [22]

Create ASN.1 from two big integers

别说谁变了你拦得住时间么 提交于 2019-12-11 15:16:55
问题 I have a java program using an HSM that with the native API gives me and R and S value of an ECDSA signature which is just the two Big Integers. I need to take those Integers and create ASN.1 encoding. Any idea on how I could do that? I do have BouncyCastle up and running but, I am not familiar with the options available to me. 回答1: A small example to illustrate: import org.bouncycastle.asn1.ASN1Integer; import org.bouncycastle.asn1.DERSequence; import javax.xml.bind.DatatypeConverter; import

what does it mean “compile asn.1”?

时间秒杀一切 提交于 2019-12-11 11:10:00
问题 I have heard many times " after compilation of an asn.1 there were many errors " or something like this. But what does it mean " compile asn.1 " at all? As I know asn.1 is a notation to describe data structures, how it should be compiled (translation from asn.1 to what language?) and what do I do with that compiled stuff? Update: is it just a generation of a structure encoder/decoder in a certain programming language? after that one can use encoder and decoder integrate these to an

Decoding Scapy ASN1 encoded SSL/TLS certificate fields

元气小坏坏 提交于 2019-12-11 08:06:24
问题 I am extracting SSL/TLS certificate fields from serverhello packet using scapy-ssl_tls library which I installed using pip. The problem is, I'm not able to figure out a way to extract values from ASN1 encoded fields: sign_algo2: <ASN1_OID['.1.2.840.113549.1.1.11']> sa2_value: <ASN1_NULL[0L]> not_before: <ASN1_UTC_TIME['170321131500Z']> not_after: <ASN1_UTC_TIME['200321131500Z']> pubkey_algo: <ASN1_OID['.1.2.840.113549.1.1.1']> version: <ASN1_INTEGER[2L]> sn: <ASN1_INTEGER[6348220899422160075L

ASN.1 module description

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 03:43:48
问题 I tried to use ASN.1 for a client server communication, but i'm not sure that i understand it correctly . The Client have to send an integer to the server, the server read it and send back a number and a String, the Client read them and send back a String the server read it and send back a String. It's something like this. Client ---> server 1 integer Server --> Client 1 integer Server --> Client 1 String Client ---> server 1 String Server --> Client 1 String I wrote the following ASN.1

ASN.1 Unmarshalling using go structs gives tags don't match error

最后都变了- 提交于 2019-12-11 00:24:07
问题 I am trying to do ASN.1 marshal/unmarshal for the following definition: ACEI ::= SEQUENCE { message MessageFields, neRegNumber OCTET STRING OPTIONAL, gpsInfo GpsInfo OPTIONAL, siteInfo OCTET STRING OPTIONAL, nlementID INTEGER(0..16777216) OPTIONAL, ... } GpsInfo ::= SEQUENCE { gpsLat INTEGER(-900000000..900000000) OPTIONAL, gpsLong INTEGER(-1800000000..1800000000) OPTIONAL, gpsAlt INTEGER OPTIONAL, ... } MessageFields ::= SEQUENCE { messageSequence INTEGER (1..65535), bsId INTEGER (1..65535)