Skip to content

Instantly share code, notes, and snippets.

@inti25
inti25 / self-signed-certificate-with-custom-ca.md
Created March 5, 2024 06:17 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
// convert to pem file
openssl x509 -in cert.der -inform der -outform pem -out cert.pem
openssl rsa -in cert.key -inform der -out certkey.pem -outform pem
//export to p12 format
openssl pkcs12 -export -in cert.pem -inkey certkey.pem -name alias -out cert.p12
openssl pkcs12 -export -out certificate.p12 -inkey privateKey.key -in certificate.crt -certfile CACert.crt
//delete old alias
keytool -delete -alias alias -keystore keystore
@inti25
inti25 / Code.gs
Created August 1, 2019 02:42 — forked from edwinlee/Code.gs
Sync a Google Sheets spreadsheet to a Firebase Realtime database
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@inti25
inti25 / AES_Encrypt_and_Decrypt_JS_JAVA.js
Created July 18, 2019 05:16
AES Encrypt and Decrypt Javascripts JAVA
// 1. Javascripts
var iv = '00000000000000000000000000000000';
var salt = '99990000000000000000000000000099';
var AesUtil = function() {
this.keySize = 128 / 32;
this.iterationCount = 1000;
};