module PKCS11

Ruby connector to PKCS#11 libraries.

This library allowes to use PKCS#11 librarys in Ruby MRI.

@example

pkcs11 = PKCS11.open("/path/to/pkcs11.so")
slot = pkcs11.active_slots.first
p slot.info
session = slot.open(PKCS11::CKF_SERIAL_SESSION|PKCS11::CKF_RW_SESSION)
session.login(:USER, "1234")
# ... crypto operations
session.logout
session.close

See unit tests in the test directory for further examples of the usage.

Constants

VERSION

Library version

Public Class Methods

new(*args)

Open a PKCS#11 library file.

Alias for: open
open(*args) click to toggle source
static VALUE
pkcs11_library_new(int argc, VALUE *argv, VALUE self)
{
  return rb_funcall2(cPKCS11, sNEW, argc, argv);
}
Also aliased as: new