Skip to content

Instantly share code, notes, and snippets.

@bakoushin
bakoushin / verify.apple.attestation.js
Created February 21, 2022 19:34 — forked from yackermann/verify.apple.attestation.js
Snippet code to verify apple anonymous attestation
const crypto = require('crypto');
const base64url = require('base64url');
const cbor = require('cbor');
const asn1 = require('@lapo/asn1js');
const jsrsasign = require('jsrsasign');
/* Apple Webauthn Root
* Original is here https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
*/
let appleWebAuthnRoot = 'MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8wHQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMxNTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEGA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11kxu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cAMGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5
@bakoushin
bakoushin / README-Template.md
Created July 16, 2019 05:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@bakoushin
bakoushin / @ SimpleDB.md
Created November 13, 2018 14:30
Simple DB

SimpleDB - Like Indexed DB, but Simple

A simple asynchronous data store.

STATUS: This is a thought experiment, not a serious proposal. Would basic async storage like this be useful? With this plus some locking primitive, could you build Indexed DB?

Like Indexed DB:

  • rich value types - store anything you can structured clone
  • rich key types - Number, String, Date, Array (of other key types)
@bakoushin
bakoushin / task.md
Created April 7, 2018 16:52 — forked from dima117/task.md

Упражнения

  1. Сортировка пузырьком
  2. Сортировка выбором
  3. Сортировка вставками
  4. Развернуть односвязный список
  5. Обход дерева в глубину
  6. Обход дерева в ширину
  7. Найти все простые числа от 1 до N
  8. Бинарный поиск в отсортированном массиве
const hasOwnProperty = Object.prototype.hasOwnProperty;
const toString = Object.prototype.toString;
/**
* Проверяет, что переданный объект является "плоским" (т.е. созданным с помощью "{}"
* или "new Object").
*
* @param {Object} obj
* @returns {Boolean}
*/