This file contains 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 org.bouncycastle.bcpg.ArmoredInputStream; | |
import org.bouncycastle.bcpg.ArmoredOutputStream; | |
import org.bouncycastle.bcpg.BCPGOutputStream; | |
import org.bouncycastle.bcpg.HashAlgorithmTags; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.openpgp.PGPException; | |
import org.bouncycastle.openpgp.PGPKeyPair; | |
import org.bouncycastle.openpgp.PGPObjectFactory; | |
import org.bouncycastle.openpgp.PGPPrivateKey; | |
import org.bouncycastle.openpgp.PGPPublicKey; |
This file contains 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
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" | |
"log" | |
"math/big" |
This file contains 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
openssl ecparam -name prime256v1 -genkey -noout -out private.pem | |
openssl ec -in private.pem -pubout -out public.pem |
This file contains 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
public class App { | |
public static void main(String[] args) { | |
Type type = new Type("hg", "Mercurial"); | |
Repository repository = new Repository("42", "scm", type, "SCM-Manager", "SCM-Manager Repository Hosting"); | |
System.out.println(JSON.asString(repository)); | |
System.out.println(JSON.asString(repository, "id", "desc")); | |
System.out.println(JSON.asString(repository, "id", "name", "type", "type.name", "displayName")); | |
} |
This file contains 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
/* | |
* Genarate rsa keys. | |
*/ | |
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" |
This file contains 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
package main | |
import ( | |
"io" | |
"strconv" | |
"time" | |
"github.com/gin-gonic/gin" | |
) |
OlderNewer