asn.1

How-to check the UID hash of an Apple AppReceipt server side in PHP?

旧时模样 提交于 2019-12-06 09:13:06
I'm asking this question in order to share a solution code. Context: Apple introduced the AppReceipt in iOS 7. It is also present for OS X IAP. This receipt is a PKCS#7 container (asn.1) with a payload which is also asn.1 structured. Documentation from Apple instructs how to control the validity of the receipt on-device and to parse it to check that is has been issued for the current device. There are also instructions to validate the receipt through an application server by contacting Apple server. In that latter case though, the returned json data from Apple does not include information

X.509v3 ASN.1 to C datastructs

爷,独闯天下 提交于 2019-12-05 20:29:03
I'm trying to create a X509 Request for a Proxy Certificate (ProxyCertInfo Extension RFC3820 ) in C (OpenSSL), but I cannot figure out how the datastructures of the ProxyCertInfo should be defined. The RFC defines the ASN.1 language as follows: PKIXproxy88 { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) proxy-cert-extns(25) } DEFINITIONS EXPLICIT TAGS ::= BEGIN -- EXPORTS ALL -- -- IMPORTS NONE -- -- PKIX specific OIDs id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) } --

Creating ASN1 encoded signature in C# to send to Java

烂漫一生 提交于 2019-12-05 19:22:45
I have a private/public secure cert. My Java counterparts have the public key. I have the need to take a string, sign it, and send it along to Java to then verify the data and signature. There appears to be a well known issue with how Microsoft and the rest of the world encodes/signs data, something about the way bytes are handled. It's so well known, that I can't find a solution. If they take my string and the private key, they can obviously sign it correctly, and verify it. If I take my string, I can sign and verify it within .Net fine. I have seen a slew of methods for converting from ASN1

Generate RSA private key from n, e, d, p, q values in bash with OpenSSL [duplicate]

流过昼夜 提交于 2019-12-05 12:43:23
This question already has answers here : How to Generate rsa keys using specific input numbers in openssl? (2 answers) Closed 3 years ago . I have calculated n, e, d, p, q values of an RSA key. Now, how can I generate a private key file (pem or der) with openssl command line tools? I was thinking about openssl asn1parse -genconf asn1.cnf -noout -out asn1.der but I cannot understand how to build the conf file. tintin The OpenSSL manpage for asn_generate_nconf comes with an example cnf for generating the private_key ASN.1 sequence that should work with your cmdline: asn1=SEQUENCE:private_key

SNMP MIB SMIv2 Conformance Group Issue

此生再无相见时 提交于 2019-12-05 01:41:12
I have a MIB that I started working on but smilint complains about a missing conformance group. How do I add this conformance group to my file? BLEH-PRODUCT-MIB DEFINITIONS ::= BEGIN -- Objects in this MIB are implemented in the local SNMP agent. IMPORTS MODULE-IDENTITY, OBJECT-TYPE, Integer32, enterprises FROM SNMPv2-SMI; blehProductMIB MODULE-IDENTITY LAST-UPDATED "201305290000Z" ORGANIZATION "Bleh Corporation" CONTACT-INFO " Joe Shmoe Postal: Bleh Corporation 23 Telnet Road Ottawa, ON, K1K 1K1 Canada Tel: +1 555 555 5555 x5555 Fax: +1 555 555 5556 E-mail: joe.shmoe@bleh.com" DESCRIPTION

How does [0] and [3] wơrk in ASN1?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 20:52:55
问题 I'm decoding ASN1 (as used in X.509 for HTTPS certificates). I'm doing pretty well, but there is a thing that I just cannot find and understandable documentation for. In this JS ASN1 parser you see a [0] and a [3] under a SEQUENCE element, the first looking like this in data: A0 03 02 01 02 ... . I want to know what this means and how to decode it. Another example is Anatomy of an X.509 v3 Certificate, there is a [0] right after the first two SEQUENCE elements. What I don't understand is how

Reading a ASN.1 DER-encoded RSA Public key

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 21:32:28
问题 I'm writing an app to get a better understanding of DKIM. The spec says I retrieve a "ASN.1 DER-encoded" public key from the domain TXT record. I can seen the key on "s1024._domainkey.yahoo.com" = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDrEee0Ri4Juz+QfiWYui/E9UGSXau/2P8LjnTD8V4Unn+2FAZVGE3kL23bzeoULYv4PeleB3gfm". How can I use this key from .net? The examples I've seen get the key from a X509Certificate2, or an XML file containing the RSAParameters. CORRECTION : I copy/pasted the key above

I need an example to understand Implicit Tagging in ASN.1

时光总嘲笑我的痴心妄想 提交于 2019-12-03 17:20:23
问题 I have been going through the following tutorial http://www.obj-sys.com/asn1tutorial/node12.html Can you help me understand implicit tagging with an example? 回答1: In ASN.1 tagging, in fact, serves two purposes: typing and naming. Typing means it tells an en-/decoder what kind of data type that is (is it a string, an integer, a boolean, a set, etc.), naming means that if there are multiple fields of the same type and some (or all of them) are optional, it tells the en-/decoder for which field

Java ASN.1 compiler

元气小坏坏 提交于 2019-12-03 13:34:16
问题 Right now I'm using BinaryNotes to parse ASN.1 files for use in a Java project. It takes an ASN.1 definition and produces Java class(s) that let me manipulate ASN.1 files. I've hit a wall with extension markers (...) because it doesn't support them. The source forge project page says they're coming in the next release, but the last release was nearly 2 years ago so I fear the project is dead. Can anyone recommend an easy (and $free) replacement that does a similar thing and does support

Decoding an ASN.1 DER OCTET STRING with OpenSSL

大憨熊 提交于 2019-12-03 12:50:38
Using the OpenSSL API, I have extracted a custom extension from a X.509v3 certificate with: X509_EXTENSION* ex = X509_get_ext(x509, 4); The X509_EXTENSION object contains a value (ex->value) that is an ASN.1 OCTET STRING. The OCTET STRING contains a DER encoded UTF-8 string. I'm trying to decode the OCTET STRING to get the plain UTF-8 string. I have tried a few things, such as: ASN1_STRING_to_UTF8(&buf, ex->value); and M_ASN1_OCTET_STRING_print(bio, ex->value); int len = BIO_read(bio, buf, buf_size); buf[len] = '\0'; These both give me the DER encoded string. How do I get the plain UTF-8