Home Decrypt apple-app-site-association in browser
Reply: 1

Decrypt apple-app-site-association in browser

Tyler
1#
Tyler Published in 2018-02-14 05:20:09Z

I'm building a tool to verify deep links set up with Apple's apple-app-site-association files. In some cases, these files are pkcs7-mime encrypted.

Is there any way currently to decrypt these files entirely on the client? I've researched WebCrypto and similar tools but I can't find a solution.

Essentially, I'd like to replicate the following openssl command in JS:

openssl smime -verify -inform DER -noverify -in apple-app-site-association.p7m

This should successfully output valid JSON, such as:

{
"applinks": {
    "apps": [],
    "details": [
        {
            "appID": "4MU37S3E4Q.com.couchsurfing.CouchSurfing",
            "paths": [
                        "NOT /people/*/*",
                        "NOT /users/*/*",
                        "NOT /events/*/*",
                        "NOT /events/past",
                        "NOT /events/attending",
                        "NOT /events/organizing",
                        "NOT /events/featured",
                        "NOT /users/confirmation",
                        "/users/*",
                        "/people/*",
                        "/events/*",
                        "/get_verified",
                        "/messages/*",
                        "/hosting",
                        "/mobile-hangouts"
                     ]
        }
    ]
}
}

Any help is much appreciated!

rmhrisk
2#
rmhrisk Reply to 2018-02-16 05:32:25Z

You can use PKIjs. This is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins to work in modern browsers.

Here is an example of decoding CMS/PKCS#7 files:

  • Demo
  • Source
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.396701 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO