Skip to content

Instantly share code, notes, and snippets.

@bluk
bluk / how-to-generate-and-use-private-keys-with-openssl-tool.md
Created November 5, 2019 15:46 — forked from briansmith/how-to-generate-and-use-private-keys-with-openssl-tool.md
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

Keybase proof

I hereby claim:

  • I am bluk on github.
  • I am bluk (https://keybase.io/bluk) on keybase.
  • I have a public key whose fingerprint is 916E DDD8 3F26 1884 C87D 39FB 640B B0CB 9E01 E8B7

To claim this, I am signing this object:

key "_rexec/" {
policy = "write"
}
service "" {
policy = "read"
}
event "" {
policy = "write"
@bluk
bluk / reinstall.sh
Last active August 29, 2015 14:15
Sample Magento 2 Development Environment Reinstall Script
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Bryant Luk
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/bin/bash
source /etc/environment
if etcdctl mk /consul.io/bootstrap_node ${COREOS_PRIVATE_IPV4}; then
flags=""
else
flags="::$( etcdctl get /consul.io/bootstrap_node )"
fi
@bluk
bluk / bootstrap-consul.sh
Last active August 24, 2016 13:34
Consul Bootstrap on CoreOS
#!/bin/bash
# From https://gist.github.com/philips/56fa3f5dae9060fbd100
source /etc/environment
name=$(cat /etc/machine-id)
if [ ! -f /opt/consul ]; then
mkdir /opt
mkdir /var/lib/consul