All Projects → simionrobert → cloud-signature-consortium

simionrobert / cloud-signature-consortium

Licence: MIT license
Cloud Signature Consortium Remote Signature Service Provider in Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language
EJS
674 projects

Projects that are alternatives of or similar to cloud-signature-consortium

openssl ca
openssl_ca with QT GUI
Stars: ✭ 16 (-15.79%)
Mutual labels:  certificate, openssl
Mutual Tls Ssl
🔐 Tutorial of setting up Security for your API with one way authentication with TLS/SSL and mutual mutual authentication for a java based web server and a client with both Spring Boot. Different clients are provided such as Apache HttpClient, OkHttp, Spring RestTemplate, Spring WebFlux WebClient Jetty and Netty, the old and the new JDK HttpClient, the old and the new Jersey Client, Google HttpClient, Unirest, Retrofit, Feign, Methanol, vertx, Scala client Finagle, Featherbed, Dispatch Reboot, AsyncHttpClient, Sttp, Akka, Requests Scala, Http4s Blaze, Kotlin client Fuel, http4k, Kohttp and ktor. Also other server examples are available such as jersey with grizzly. Also gRPC examples are included
Stars: ✭ 163 (+757.89%)
Mutual labels:  certificate, openssl
Openssl Nodejs
is a package which gives you a possibility to run every OpenSSL command 🔒 in Node.js in a handy way. Moreover, parameters like -in, -keyin, -config and etc can be replaced by a raw data (Buffor).
Stars: ✭ 25 (+31.58%)
Mutual labels:  certificate, openssl
Ssl Checker
Python script that collects SSL/TLS information from hosts
Stars: ✭ 94 (+394.74%)
Mutual labels:  certificate, openssl
python-csr
Generate a CSR/Key via Python
Stars: ✭ 39 (+105.26%)
Mutual labels:  certificate, openssl
openssl-alpine
OpenSSL three tier certificate generator
Stars: ✭ 23 (+21.05%)
Mutual labels:  certificate, openssl
Easycert
EasyCert quickly generates web server TLS certificates that have been self-signed by a private certificate authority that it also creates.
Stars: ✭ 121 (+536.84%)
Mutual labels:  certificate, openssl
qsslcaudit
test SSL/TLS clients how secure they are
Stars: ✭ 22 (+15.79%)
Mutual labels:  certificate, openssl
WeIdentity
基于区块链的符合W3C DID和Verifiable Credential规范的分布式身份解决方案
Stars: ✭ 1,063 (+5494.74%)
Mutual labels:  certificate, digital-signature
Check ssl cert
check_ssl_cert is a shell script (that can be used as a Nagios plugin) to check the CA and validity of an X.509 certificate
Stars: ✭ 248 (+1205.26%)
Mutual labels:  certificate, openssl
Simple-TLS-Client-Server-with-Node.js
Simple TLS Client/Server with Node.js
Stars: ✭ 22 (+15.79%)
Mutual labels:  certificate, openssl
x509sak
X.509 Swiss Army Knife is a toolkit atop OpenSSL to ease generation of CAs and aid white-hat pentesting
Stars: ✭ 23 (+21.05%)
Mutual labels:  certificate, openssl
Lhttps
Create https for local development environment or localhost.
Stars: ✭ 172 (+805.26%)
Mutual labels:  certificate, openssl
pki-manager
IT Freelancers : Manage small PKI for multiple projects (or clients) with 2 bash scripts
Stars: ✭ 36 (+89.47%)
Mutual labels:  certificate, openssl
cryptocli
The ultimate tool for data transfer, manipulation and proxy.
Stars: ✭ 16 (-15.79%)
Mutual labels:  certificate, openssl
niftygate
Drop-in Access Control via NFT Ownership
Stars: ✭ 61 (+221.05%)
Mutual labels:  digital-signature
sslcontext-kickstart
🔐 A lightweight high level library for configuring a http client or server based on SSLContext or other properties such as TrustManager, KeyManager or Trusted Certificates to communicate over SSL TLS for one way authentication or two way authentication provided by the SSLFactory. Support for Java, Scala and Kotlin based clients with examples. Av…
Stars: ✭ 295 (+1452.63%)
Mutual labels:  certificate
pki
Certificate Authority management suite
Stars: ✭ 23 (+21.05%)
Mutual labels:  openssl
qdigidoc
DEPRECATED DigiDoc3 Client is a program that can be used to sign digitally with ID-card and Mobile-ID, check the validity of digital signatures and open and save documents inside the signature container.
Stars: ✭ 25 (+31.58%)
Mutual labels:  certificate
dockerizing-django
🐳 Dockerize your Django application.
Stars: ✭ 27 (+42.11%)
Mutual labels:  certificate

CSC - Cloud Signature Consortium

Build Status Dependency Status

A CSC RSSP - Cloud Signature Consortium Remote Signature Service Provider -, written in Node.js using SoftHSMv2 as HSM. This application follows the CSC API V1.0.4.0 specification. It also includes an OAuth 2.0 server for your particular needs.

An ASP.NET Core variant is available at cloud-signature-consortium-asp-net-core

Installing globally via npm:

npm install -g csc-server

Prerequistes

  1. Install Mongodb from mongodb.com

  2. Install OpenSC that is needed for interacting with the SoftHSMv2 dll module. We will use pkcs11-tool exe.

  3. Install SoftHSMv2 or just copy it from the project's release binaries to the resources folder.

  • Set environment variabile SOFTHSM2_CONF=%path_to_softhsm2\lib\softhsm2.conf%
  • In the file path\to\softhsm2.conf, set directories.tokendir=%path_to_softhsm2\tokens_folder%
  • Initialize a new softhsm2 token with %path_to_softhsm2\bin\softhsm2-util.exe%
softhsm2-util --init-token --slot 0 --label "mytoken"
  1. Install OpenSSL or just copy it from the project's release binaries to the resources folder.
  • Generate a new certificate and private key for your https/SSL/TLS service and put them in the resources folder of the application (the one provided in config.json. See point 5):
openssl req -x509 -newkey rsa:4096 -keyout keySSL.pem -out certSSL.pem -days 365

In the release version you will find the following binaries:

  • OpenSSL 1.1.1.d x86 (used by the app)
  • SoftHSMv2 (used by the app)
  • PKCS11Admin - 0.5.0 (Optional GUI to help you see the token objects)
  1. Configure the service settings. See Configuration.

After you successfully installed and configured all the prerequistes, you can proceed to Usage.

Usage

Create your own user:

csc-server --createUser --user="username" --pass="password" --pin="pin"

If you plan to use OAuth 2.0, create your own client:

csc-server --createClient --name=name --id=id --secret=secret --redirectUri=redirectUri

Start CSC Server:

csc-server -l

Now you have a fully functional CSC server.

Example Usage

Usage:
   csc-server [options]

Options:
  --createUser    Create a user using the arguments below.
       --user           Username of the user.
       --pass           Password of the user.
       --pin            PIN associated with the generated private key.

  --createClient  Create an OAuth 2.0 client using the arguments below.
       --name          Name of the client application.
       --id            Client id.',
       --secret        Client_secret.
       --redirectUri   Redirect_uri.

  --listen, -l     Start the server
       --silent, -s     Suppress log messages from output.

  --version, -v    Print the version and exit.
  --help, -h       Print this list and exit.
Examples
   csc-server -l
   csc-server --createUser --user=username --pass=password --pin=pin
   csc-server --createClient --name=name --id=id --secret=secret --redirectUri=redirectUri

Configuration

The configuration file is located at %userprofile%/AppData/Roaming/npm/node_modules/csc-server/config/config.json. Feel free to customize and provide the correct paths of the software you installed in the Prerequistes.

{
    "csc": {
        "access_token_expiring_time": 3600,
        "refresh_token_expiring_time": 7200,
        "sad_expiring_time": 1800,
        "code_expiring_time": 600,
        "otp_expiring_time": 1800,
        "max_results": 10
    },
    "https": {
        "host": "0.0.0.0",
        "port": "8080",
        "certificate": "D:/Scoala/Dizertatie/CSC Framework/resources/certSSL.pem",
        "private_key": "D:/Scoala/Dizertatie/CSC Framework/resources/keySSL.pem",
        "private_key_password": "0000"
    },
    "database_url": "mongodb://localhost:27017/csc",
    "resources_path": "D:/Scoala/Dizertatie/CSC Framework/resources",
    "softhsm2_driver_path": "D:/Scoala/Dizertatie/CSC Framework/utils/SoftHSMv2/lib/softhsm2.dll",
    "openSSL_path": "D:/Scoala/Dizertatie/CSC Framework/utils/openssl-1.1.1-x86/openssl.exe",
    "openSC_path": "C:/Program Files (x86)/OpenSC Project/OpenSC/tools/pkcs11-tool.exe",
    "token": {
        "slot": "189467408",
        "pin": "0000"
    }
}

You can also configure the endpoint /csc/v1/info results in the %userprofile%/AppData/Roaming/npm/node_modules/csc-server/config/info.json configuration file.

{
    "specs": "1.0.3.0",
    "name": "CSC Provider",
    "logo": "https://service.domain.org/images/logo.png",
    "region": "RO",
    "lang": "en-US",
    "description": "An efficient remote signature service",
    "authType": [
            "basic",
            "oauth2code"
    ],
    "oauth2": "https://www.domain.org/",
    "methods": [
            "auth/login",
            "auth/revoke",
            "credentials/list",
            "credentials/info",
            "credentials/authorize",
            "credentials/sendOTP",
            "signatures/signHash",
            "oauth2/authorize",
            "oauth2/token"
    ]
}

Supported PKCS#1 Signing Types

Currently, only CKM_RSA_PKCS is supported with SHA1, SHA256, SHA512. Only no-padded base64 hashes needs to be provided at the service endpoints.

Testing

A Postman request collection is provided in docs folder. There is also a json collection containing the environment variabiles used in the requests based on the server responses through Tests. They can be imported in Postman using File > Import.

Keep in mind that you must open a browser an enter the links provided in the collection for the oauth2/authorize service and oauth2/authorize credentials to actually test them (We simulate an application client throught our browser). After login and user acceptance, the application client's redirect_uri will be called with an authorization code provided in the link as a query parameter. You should copy that code and paste it in the Postman request body of /oauth2/token.

Also you should set SSL certificate verification to off from File > Settings > General, because the service's certificate is not trusted by our computer.

Feel free to test the application.

Authors

See also the list of contributors who participated in this project.

I really appreciate all kinds of feedback and contributions.

Aditional notes: If you have some issues referring parts of code in the master branch add them in the issues section.

License

This project is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].