Skip to content

Instantly share code, notes, and snippets.

View mgiaccone's full-sized avatar

Matteo Giaccone mgiaccone

View GitHub Profile
@mgiaccone
mgiaccone / vault-init.py
Created January 28, 2017 13:46
Hashicorp Vault auto initialize/unseal script - DO NOT USE IN PRODUCTION!!!
#!/usr/bin/env python
import json
import os
import requests
homeDir = os.path.expanduser("~")
configFile = os.path.join(homeDir, ".vault-config.json")
vaultAddr = os.environ['VAULT_ADDR']
@mgiaccone
mgiaccone / EncryptionKeyStore.java
Last active July 29, 2019 14:40
Securely generate and store Realm (or any other) encryption key with Android Keystore (API 18+)
package com.ubiqueworks.android.security;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;

Keybase proof

I hereby claim:

  • I am mgiaccone on github.
  • I am mgiaccone (https://keybase.io/mgiaccone) on keybase.
  • I have a public key whose fingerprint is 3EA8 1D07 5416 138A 0D70 986B 45DA 6B87 688B D619

To claim this, I am signing this object: