Skip to content

Instantly share code, notes, and snippets.

View paoneJP's full-sized avatar

Takashi Yahata paoneJP

View GitHub Profile
@paoneJP
paoneJP / http-config.json
Created June 6, 2016 13:25
HTTP Connection Handler configuration sample for OpenDJ. It enables to use SCIM 2.0 Schema.
{
"authenticationFilter": {
"supportHTTPBasicAuthentication": true,
"supportAltAuthentication": true,
"altAuthenticationUsernameHeader": "X-SCIM-Username",
"altAuthenticationPasswordHeader": "X-SCIM-Password",
"searchBaseDN": "dc=openam,dc=forgerock,dc=org",
"searchScope": "one",
"searchFilterTemplate": "(&(uid=%s)(objectClass=inetOrgPerson))"
},
@paoneJP
paoneJP / parse_jwe_sample_using_python-rsa_and_pyaes.py
Created May 1, 2016 08:18
Parsing a JWE Example which is described in draft-ietf-jose-json-web-encryption Appendix A.2 (RSA1_5 and A128CBC-HS256). This version uses python-rsa and pyaes.
from base64 import urlsafe_b64decode
import hmac
from hashlib import sha256
import rsa
from rsa.transform import bytes2int, int2bytes
import pyaes
# RSA Key described in A.2.3
@paoneJP
paoneJP / distro_support.mk
Created April 16, 2015 13:35
auxiliary makefile for building apache module on various linux distro.
module_name=$(patsubst mod_%,%,$(shared:%.la=%))
ifneq ($(wildcard /etc/debian_version),)
# Debian/Ubuntu
top_srcdir=/usr/share/apache2
top_builddir=/usr/share/apache2
include /usr/share/apache2/build/special.mk
loader_file=/etc/apache2/mods-available/$(module_name).load
loader_lines=LoadModule $(module_name)_module $(libexecdir)/mod_$(module_name).so
else ifneq ($(wildcard /etc/redhat-release),)
@paoneJP
paoneJP / parse_jwe_sample.py
Created December 21, 2014 11:14
Parsing a JWE Example which is described in draft-ietf-jose-json-web-encryption Appendix A.2 (RSA1_5 and A128CBC-HS256)
from base64 import urlsafe_b64decode
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
from Crypto.Cipher import AES
from Crypto.Hash import HMAC
from Crypto.Hash import SHA256
from Crypto.Util.number import long_to_bytes, bytes_to_long