This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this is the gist content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git tag -d TagName && git push origin :refs/tags/TagName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (a revise version basing on Kosta's ) | |
| Assuming the username of the Ubuntu user is "theusername". | |
| Preparation | |
| ----------- | |
| Make sure xenial-updates repository in your apt-get source list: | |
| ``` | |
| deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restircted universe multiverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Create self signed key pair and add to new key store: | |
| keytool -genkey -alias mykey -keyalg RSA -keystore keystore.jks -keysize 2048 | |
| Export public key and import into new trust store: | |
| keytool -keystore keystore.jks -export -alias mykey -file my.cer | |
| keytool -import -alias mypub -file my.cer -keystore truststore.jks | |
| (Alternate way) Manually import certificate from HTTPS server to trust store: | |
| Firefox: Add Exception -> Get Certificat -> View -> Details -> Export as "a.der" | |
| keytool -importcert -keystore truststore.jks -file a.der |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.crypto.Cipher; | |
| import java.io.InputStream; | |
| import java.security.*; | |
| import java.util.Base64; | |
| import static java.nio.charset.StandardCharsets.UTF_8; | |
| public class RsaExample { | |
| public static KeyPair generateKeyPair() throws Exception { | |
| KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); |