Skip to content

Instantly share code, notes, and snippets.

View shasisingh's full-sized avatar

Shasi Singh shasisingh

View GitHub Profile
@shasisingh
shasisingh / generate-certificate-chain.sh
Last active February 16, 2024 21:05 — forked from yamen/generate-certificate-chain.sh
Generate a full self-signed certificate chain (Root -> Intermediate CA -> Server) using keytool, that can be used for 'localhost' development
#!/bin/bash
#exit on error
set -B
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
@shasisingh
shasisingh / ParseRSAKeys.java
Created March 17, 2023 14:37 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;