openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out cert.pem
openssl x509 -in cert.pem -text
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class CRMClientTest { | |
private CRMClient crmClient; | |
private StubbedClientHandler clientHandler; |
public class PkiUtils { | |
public static final int MinPassPhraseLength = 4; | |
public static List<?> readPemObjects(InputStream is, final String pphrase) | |
throws IOException { | |
List<Object> list = new LinkedList<Object>(); | |
PEMParser pr2 = new PEMParser(new InputStreamReader(is)); | |
JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC"); | |
JcaX509CertificateConverter certconv = new JcaX509CertificateConverter().setProvider("BC"); |
package com.google.firebase.zerotoapp; | |
public class ChatMessage { | |
public String name; | |
public String message; | |
public ChatMessage() { | |
} | |
public ChatMessage(String name, String message) { |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
public class EmptyRecyclerView extends RecyclerView { | |
@Nullable View emptyView; |
# gcc -Wall -o match match.c && ./match | |
# | |
#include <stdio.h> | |
#include <string.h> | |
#include <regex.h> | |
#Reference | |
#https://devnotcorp.wordpress.com/2012/08/21/usage-examples-of-rubys-openssl-lib/ | |
#!/usr/bin/ruby | |
require 'openssl' | |
require 'date' | |
require 'time' | |
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 . | |
import java.math.BigInteger; | |
import java.security.*; | |
import java.security.spec.*; | |
import javax.crypto.KeyAgreement; | |
public class ECCKeyAgreement { | |
public static void main(String[] args) throws Exception { | |
KeyPairGenerator kpg; | |
kpg = KeyPairGenerator.getInstance("EC","SunEC"); |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
type Message struct { |
There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.
Protocol Buffers v3.0.0. release notes:
The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.
Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.