mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-22 01:26:20 +08:00
OpenSSL scripts to create certs for client and server samples.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# Create a UA Sample Client cert for OPC UA client
|
||||
#
|
||||
openssl req -newkey rsa:1024 -out cert.crt -keyout cert.key -subj "/DC=$HOSTNAME/CN=UA Sample Client" -nodes
|
||||
openssl x509 -days 365 -req -in cert.crt -signkey cert.key -out cert.pem -sha1 -extfile sampleclient.ext
|
||||
openssl pkcs12 -export -in cert.pem -inkey cert.key -out $HOSTNAME.pfx -nodes
|
||||
openssl x509 -in cert.pem -out $HOSTNAME.der -outform DER
|
||||
openssl x509 -in $HOSTNAME.der -inform DER -text
|
||||
rm cert.*
|
||||
mkdir -p "./OPC Foundation/CertificateStores/MachineDefault/certs"
|
||||
mkdir -p "./OPC Foundation/CertificateStores/MachineDefault/private"
|
||||
mv $HOSTNAME.der "./OPC Foundation/CertificateStores/MachineDefault/certs"
|
||||
mv $HOSTNAME.pfx "./OPC Foundation/CertificateStores/MachineDefault/private"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Extensions to add to a certificate request
|
||||
|
||||
subjectKeyIdentifier=hash
|
||||
subjectAltName=URI:urn:localhost:OPCFoundation:SampleClient
|
||||
authorityKeyIdentifier=critical,keyid,issuer:always
|
||||
basicConstraints = critical, CA:FALSE
|
||||
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment, keyCertSign
|
||||
extendedKeyUsage = critical, serverAuth, clientAuth
|
||||
Reference in New Issue
Block a user