npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@activeprospect/trustedform-cert-id

v1.1.5

Published

Node.JS library for decrypting the TrustedForm Certificate URL

Downloads

1,214

Readme

TrustedForm Cert ID

This library handles decrypting TrustedForm certificate IDs, which contain metadata about the certificate. Generally speaking, this library can extract the certificate type and the certificate creation date.

Certificate ID Types

There are several different formats of certificate IDs, depending on the certificate type.

Web Certificate ID

This is the most common form of certificate identifier. It looks like a SHA1 hash (40 character hexidecimal string). Web certificate IDs contain two properties:

  • type: 'web' — The type of these certificates will always be "web"
  • createdAt — The Date the certificate was created

Example: eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947

Mobile Certificate ID

Mobile certificates are created by the TrustedForm Mobile SDK, which supports collecting certs from mobile platform applications built on iOS and Android. Mobile certificates IDs contain two properties:

  • type: 'mobile' — The type of these certificates will always be "mobile"
  • createdAt — The Date the certificate was created

Example: 11NgkzK_mroUbOD1-x66NigDliU1kdvbaCtLGvyja1K80vU1sKh9grlwP78vzKSp4ncwAfJAlNPNVY8f

Facebook Certificate ID

Certificates generated for Facebook Lead Ads contain extra metadata:

  • type: 'facebook' — The type of these certificates will always be "facebook"
  • createdAt — The Date the certificate was created
  • accountId — The ActiveProspect account ID for the account that generated the certificate
  • pageId — the Facebook page identifier where the certificate was generated
  • leadId — the Facebook lead identifier associated with the certificate

Example: 0.rpM21ddljS9BNNUOm6FZVVqb5C5JMk1cofI4nDGdwy5ezucyxjok9qLyUXMu9diW62Xac8xNMpomBf1B-XDpfbYvaFMr0YC-54TzHcLrni4.OHOMoMFXaX9YW9DoX_xeng.1vnf6DTWU7sJo6XAxlRP_w

Ping ID

TrustedForm implements ping URLs to be used during the ping phase of a ping/post lead auction. Ping IDs are really just a pointer to the real certificate ID. The properties of these IDs are:

  • type — The type of the real certificate
  • createdAt — The Date the real certificate was created

Example: 0.1JT7QUPI1sOFZxpr72ZK45K0ck75kEBO9H3jNJuX8NkqMTv4UF-zrapBUlsefTP3lkXWh6qM.fF0DNrov0zNUNVRCqDV5dw.E2eYOJ5-dnAgiX02-96FNQ

Masked ID

TrustedForm supports certificate masking. A masked certificate hides important details like the session replay. Currently, masked certificate IDs do not contain any metadata beyond the type property:

  • type: 'masked' — The type of these certificates will always be "masked"

Usage

This library requires that two seperate private decryption keys be set in environment variables. These variables are named the same as in the TrustedForm platform, for consistency.

  • CERT_IDS_SECRET_KEY — The private key used to decrypt web and mobile certificate IDs
  • TF_CONFIG_CERT_ID_SECRET — The private key used to decrypt all certificate IDs starting with 0.

To decrypt a certificate ID, call the decrypt() function:

const { decrypt } = require('@activeprospect/trustedform-cert-id');
const decrypted = decrypt('eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947');
console.log(decrypted);
// { 
//   type: 'web',
//   createdAt: 2022-03-08T20:20:16.000Z
// }

To build a ping ID for a given certificate ID, call the ping() function:

const { ping } = require('@activeprospect/trustedform-cert-id');
const certId = 'a1028cbb41b876744fa752eec276bec0e4c48b33';
const pingId = ping(certId);
console.log(pingId);
// 0.1JT7QUPI1sOFZxpr72ZK45K0ck75kEBO9H3jNJuX8NkqMTv4UF-zrapBUlsefTP3lkXWh6qM.fF0DNrov0zNUNVRCqDV5dw.E2eYOJ5-dnAgiX02-96FNQ