summaryrefslogtreecommitdiffstats
path: root/php
diff options
context:
space:
mode:
authorChristophe Nowicki <cnowicki@easter-eggs.com>2005-01-18 14:40:42 +0000
committerChristophe Nowicki <cnowicki@easter-eggs.com>2005-01-18 14:40:42 +0000
commitdd1a48be767f5fc87d58d3ee1216675c033cc94b (patch)
treec9a5c22830e3c519b0b1004d325200b4fd0dc940 /php
parent02464ae3147f8df3c8d57665669b52008eb25821 (diff)
downloadlasso-dd1a48be767f5fc87d58d3ee1216675c033cc94b.tar.gz
lasso-dd1a48be767f5fc87d58d3ee1216675c033cc94b.tar.xz
lasso-dd1a48be767f5fc87d58d3ee1216675c033cc94b.zip
add a gen_keys.sh script for generating automatically ssl keys
Diffstat (limited to 'php')
-rw-r--r--php/Attic/examples/README6
-rwxr-xr-xphp/Attic/examples/gen_keys.sh25
-rw-r--r--php/Attic/examples/sample-idp/idp_openssl.cnf19
-rw-r--r--php/Attic/examples/sample-sp/sp_openssl.cnf19
4 files changed, 67 insertions, 2 deletions
diff --git a/php/Attic/examples/README b/php/Attic/examples/README
index c75b3cf9..c134048e 100644
--- a/php/Attic/examples/README
+++ b/php/Attic/examples/README
@@ -84,8 +84,10 @@ CONFIGURATION
OpenSSL
To generate SSL certificat for the Identity Provider and the Service
- Provider you need the openssl command line utility. You need to create
- a certificate, a public and private key :
+ Provider you need the openssl command line utility.
+ You need to create a certificate, a public and private key for the idp
+ and the sp. In order to proceed, you can run the gen_keys.sh script or use
+ the openssl command line utility :
# cd /var/www/sp
# openssl req -out certificate_sp1.pem -keyout private-key-raw_sp1.pem -x509 -nodes -newkey rsa:2048
diff --git a/php/Attic/examples/gen_keys.sh b/php/Attic/examples/gen_keys.sh
new file mode 100755
index 00000000..cb674a30
--- /dev/null
+++ b/php/Attic/examples/gen_keys.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Generate OpenSSL certificats for PHP IdP and SP Lasso samples
+#
+
+SP=sample-sp
+SP_CFG=$SP/sp_openssl.cnf
+SP_PRV=$SP/private-key-raw_sp1.pem
+SP_CRT=$SP/certificate_sp1.pem
+SP_PUB=$SP/public-key_sp1.pem
+
+IDP=sample-idp
+IDP_CFG=$IDP/idp_openssl.cnf
+IDP_PRV=$IDP/private-key-raw_idp1.pem
+IDP_CRT=$IDP/certificate_idp1.pem
+IDP_PUB=$IDP/public-key_idp1.pem
+
+openssl req -config $SP_CFG -out $SP_CRT -keyout $SP_PRV -x509 -nodes -newkey -batch
+openssl x509 -in $SP_CRT -noout -pubkey > $SP_PUB
+
+openssl req -config $IDP_CFG -out $IDP_CRT -keyout $IDP_PRV -x509 -nodes -newkey -batch
+openssl x509 -in $IDP_CRT -noout -pubkey > $IDP_PUB
+
+cp -p $IDP_CRT $IDP_PUB $SP
+cp -p $SP_CRT $SP_PUB $IDP
diff --git a/php/Attic/examples/sample-idp/idp_openssl.cnf b/php/Attic/examples/sample-idp/idp_openssl.cnf
new file mode 100644
index 00000000..7336057c
--- /dev/null
+++ b/php/Attic/examples/sample-idp/idp_openssl.cnf
@@ -0,0 +1,19 @@
+[ req ]
+default_bits = 2048
+encrypt_key = yes
+distinguished_name = req_dn
+x509_extensions = cert_type
+prompt = no
+
+[ req_dn ]
+C=FR
+ST=Ile de France
+L=Paris
+O=Entrouvert
+OU=Automatically-generated SSL key
+CN=idp1
+emailAddress=webmaster@domain.com
+
+[ cert_type ]
+nsCertType = server
+
diff --git a/php/Attic/examples/sample-sp/sp_openssl.cnf b/php/Attic/examples/sample-sp/sp_openssl.cnf
new file mode 100644
index 00000000..f0b622d7
--- /dev/null
+++ b/php/Attic/examples/sample-sp/sp_openssl.cnf
@@ -0,0 +1,19 @@
+[ req ]
+default_bits = 2048
+encrypt_key = yes
+distinguished_name = req_dn
+x509_extensions = cert_type
+prompt = no
+
+[ req_dn ]
+C=FR
+ST=Ile de France
+L=Paris
+O=Entrouvert
+OU=Automatically-generated SSL key
+CN=sp1
+emailAddress=webmaster@domain.com
+
+[ cert_type ]
+nsCertType = server
+