For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
/* Estructura y Datos de las Regiones, Provincias */ | |
/* y Comunas de Chile. */ | |
/* */ | |
/* Fecha: Julio 2010 */ | |
/* Autor: Juan Pablo Aqueveque - juque.cl */ | |
-- | |
-- Comunas | |
-- | |
DROP TABLE IF EXISTS `comunas`; |
<?php | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4122 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
require "openssl" | |
require "digest" | |
def aes128_cbc_encrypt(key, data, iv) | |
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize) | |
aes = OpenSSL::Cipher.new('AES-128-CBC') | |
aes.encrypt | |
aes.key = key | |
aes.iv = iv |
import pika | |
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) | |
channel = connection.channel() | |
channel.queue_declare(queue='hello') | |
def callback(ch, method, properties, body): | |
print "[x] Received: %r" % (body,) | |
channel.basic_consume(callback, queue='hello', no_ack=True) |
#!/usr/bin/env python | |
# http://www.rabbitmq.com/tutorials/tutorial-two-python.html | |
import pika | |
import sys | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
host='localhost')) | |
channel = connection.channel() | |
message = ' '.join(sys.argv[1:]) or "Hello World!" |
from suds.client import Client | |
url="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL" | |
client = Client(url) | |
print client ## shows the details of this service | |
result = client.service.GetWeatherInformation() | |
print result ## see: restult.txt below |
# Clean the exited containers | |
docker rm $(sudo docker ps -a | grep Exit | cut -d ' ' -f 1) | |
# Clean the untagged images (or old images) | |
docker rmi $(docker images | tail -n +2 | awk '$1 == "<none>" {print $'3'}') | |
# On Docker 1.9+ you can remove the orphan volumes with the next command | |
docker volume rm $(docker volume ls -qf dangling=true) |
package com.retel.security; | |
import org.springframework.security.web.PortResolver; | |
import org.springframework.security.web.PortResolverImpl; | |
import org.springframework.security.web.WebAttributes; | |
import org.springframework.security.web.savedrequest.DefaultSavedRequest; | |
import org.springframework.security.web.util.UrlUtils; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
// Example 1: Signing a byte[] using PKCS#1 v1.5 padding and a SHA-256 hash | |
// 4.5: | |
public static byte[] SignDataPkcs1Sha256(X509Certificate2 cert, byte[] data) | |
{ | |
// X509Certificate2.PrivateKey returns the same object across multiple calls, | |
// so it shouldn't be Disposed independent of the X509Certificate2 object. | |
// | |
// The RSA base class doesn't expose any signature-based methods. | |
// The PrivateKey property returns AsymmetricAlgorithm, so really this call should be |