Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Life span certificate
- export DAYS=365
- # Issuer
- export WHO=COMPANY
- # CSR file name (Copy CSR from Keystore to $CSR)
- export CSR=sample.csr
- echo "Reading CSR"
- openssl req -in $CSR -noout -text
- echo "Generate a Base64-encoded public key to provide to Google"
- openssl req -in $CSR -noout -pubkey | openssl pkey -pubin -noout -text | grep "pub:" -A5 | sed 1d | xxd -r -p | base64 | paste -sd "\0" -
- echo "Generate temporaly CA"
- openssl genrsa -out ca.key 2048
- openssl req -new -x509 -key ca.key -out ca.crt -subj "//C=FR\ST=Haute-garonne\L=nLabège\O=$WHO\OU=nDevelopment\CN=googlepay"
- echo "Sign CSR and generate certificate for Keystore: userCertificate.crt"
- openssl x509 -days $DAYS -req -in $CSR -CA ca.crt -CAkey ca.key -CAcreateserial -out userCertificate.crt
- echo "Read Certificate"
- openssl x509 -in userCertificate.crt -noout -text
- echo "Copying to Clipboard (GIT bash only)"
- openssl x509 -in userCertificate.crt -noout -text | clip
Add Comment
Please, Sign In to add comment