GithubHelp home page GithubHelp logo

markkurossi / pkcs11-provider Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 443 KB

PKCS #11 provider library and software HSM implementation in Go.

License: MIT License

Makefile 0.70% C 54.62% Go 43.09% Java 1.59%
pkcs11 go golang cryptography softhsm pkcs hsm pkcs11interop-implement pkcs11engine cloudhsm java-crypto-api sunpkcs11

pkcs11-provider's Introduction

PKCS #11 Provider

This project implements the PKCS #11 Cryptographic Token Interface Base Specification Version 3.0 API and provides an RPC interface over Unix domain sockets to communicate with the token implementation. The implementation has the following components:

  • library implements the PKCS #11 interface as a shared library. The PKCS #11 functions are defined in .rpc files and they are translated into .c files with the RPC compiler.

  • RPC Compiler which is used to generated the PKCS #11 stub functions from the RPC definitions. The RPC Compiler is implemented in Go programming language.

  • Software Token implementing PKCS #11 operations. The token is implemented in Go and (will) support all modern PKCS #11 cryptographic operations.

  • Java PKCS #11 Test to test the PKCS #11 interface from Java.

Example Usage

Start token:

$ cd cmd/token
$ ./token

Run pkcs11-testing test program:

$ cd ~/work/pkcs11-testing
$ ./pkcs11-testing --module ~/go/src/github.com/markkurossi/pkcs11-provider/library/libvpkcs11.so --slot 0 --pin 1111 --test-all

Java's SunPKCS11 provider:

$ cd java
$ javac PKCS11Test
$ java PKCS11Test

AWS CloudHSM examples:

$ cd aws-cloudhsm-pkcs11-examples
$ make
$ make test

TODO

  • Framework:
    • Launch token from libvpkcs11.so
    • Non-volatile token storage
    • Token configuration file
    • Test compatibility with Firefox
  • Test compatibility with aws-cloudhsm-pkcs11-examples
    • tools/import_pub_key.c
    • tools/wrap_with_imported_rsa_key.c
    • derivation/ecdh.c
    • derivation/hmac_kdf.c
    • wrapping/unwrap_with_template.c
    • wrapping/aes_wrapping.c
    • wrapping/rsa_wrapping.c
    • wrapping/aes_gcm_wrapping.c
    • wrapping/wrap_with_template.c
    • wrapping/aes_no_padding_wrapping.c
    • wrapping/aes_zero_padding_wrapping.c
    • encrypt/des_ecb.c
  • Crypto provider with Go:
    • Ed25519 public key algorithm
    • Message sign and verify
    • Dual function
  • RPC compiler (ugly but it works):
    • Cleanup field input/output handling and types
    • Remove old unused input/output code

Documentation

pkcs11-provider's People

Contributors

markkurossi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vas777

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.