Generation key command openssl genrsa -out %1.pem 1024 openssl req -new -key %1.pem -x509 -days 365 -config config.dat -out %1.crt openssl x509 -in %1.crt -noout -pubkey > %1.pub Creating signature openssl dgst -sha1 -sign %1.pem datafile > signature.bin openssl base64 -e -in signature.bin -out signature Cheking signature openssl base64 -d -in signature -out signature.bin openssl dgst -sha1 -verify test-server.pub -signature signature.bin from_gateway The data in the config.dat file should be replaced with your own.