Skip to content

Instantly share code, notes, and snippets.

@space88man
space88man / uri2pem.py
Created March 22, 2024 00:17
Create PKCS#11 provider PEM file from URI
"""
Copyright (C) 2024 S-P Chan <shihping.chan@gmail.com>
SPDX-License-Identifier: Apache-2.0
"""
"""
CLI tool to create pkcs11-provider pem files from a key uri
Requirements: asn1crypto
Installation:
@space88man
space88man / pkcs12_kdf.py
Last active October 18, 2022 07:41
Implementation of legacy PKCS12 KDF (RFC7292) in Python
# match the API of oscrypto.kdf.pkcs12_kdf
from typing import Callable, Tuple
import hashlib
from math import ceil
import os
import random
def hash_factory(hash_algo: Callable) -> Tuple[Callable[[bytes], bytes], int]:
"""Returns a one-shot hasher based on hash_algo and block_size
@space88man
space88man / bundle-iconify.js
Created February 18, 2022 04:38
Iconify + Vue3 offline
/* install all the icons sets e.g.
* npm i @iconify-icons/mdi
* npm i @iconify-icons/mdi-light
* npm i @iconify-icons/ic
*
*/
/*
* In main.js
* import IconifyBundle from '@/assets/bundle-iconify.js';
@space88man
space88man / buildah-freeswitch.sh
Last active February 19, 2020 14:38
Buildah script for FreeSWITCH 1.10.2/Debian 10
#! /bin/bash
CON=$(buildah from debian:10)
echo "Building in $CON"
# yikes - there is so much work to do
# it's easier to put it in a script than to have
# a massive number of buildah run lines
cat > install-5000.sh <<EOF
#!/bin/bash