Skip to content

Instantly share code, notes, and snippets.

Avatar

Halyson Lima Gonçalves halysongoncalves

View GitHub Profile
View maven.gradle
apply plugin: 'maven'
apply plugin: 'signing'
def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}
def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
View Retrofit 2.0 Callback
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import retrofit.Callback;
import retrofit.Response;
import retrofit.Retrofit;
View gist:8acf304408393ae17ed3
import android.util.Log;
import java.io.IOException;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
@halysongoncalves
halysongoncalves / ECDH_BC.java
Created Jul 13, 2016 — forked from wuyongzheng/ECDH_BC.java
Elliptic curve Diffie–Hellman using Bouncy Castle v1.50 example code
View ECDH_BC.java
import java.math.BigInteger;
import java.security.PublicKey;
import java.security.PrivateKey;
import java.security.KeyFactory;
import java.security.Security;
import java.security.KeyPairGenerator;
import java.security.KeyPair;
import java.security.SecureRandom;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.ECGenParameterSpec;
View ECDH + Bouncy Castle
public class SessionController {
private static final String BOB = "bob";
private static final String ALICE = "alice";
private static final String KEY_PUBLIC = "KEY_PUBLIC";
private static final String KEY_PRIVATE = "KEY_PRIVATE";
private static final String PROVIDER = "SC";
private static final String CURVE = "secp256K1";
private static final String ALGORITHM = "ECDH";
private final ECParameterSpec ecNamedCurveParameterSpec = ECNamedCurveTable.getParameterSpec(CURVE);