Module: PKCS11

Defined in:
lib/pkcs11/extensions.rb,
lib/pkcs11/slot.rb,
lib/pkcs11/helper.rb,
lib/pkcs11/object.rb,
lib/pkcs11/library.rb,
lib/pkcs11/session.rb,
ext/pk11.c

Overview

Ruby connector to PKCS#11 libraries.

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

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

Examples:

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.(:USER, "1234")
# ... crypto operations
session.logout
session.close

Defined Under Namespace

Classes: CK_AES_CBC_ENCRYPT_DATA_PARAMS, CK_AES_CTR_PARAMS, CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, CK_ATTRIBUTE, CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, CK_CCM_PARAMS, CK_CMS_SIG_PARAMS, CK_C_INITIALIZE_ARGS, CK_DATE, CK_DES_CBC_ENCRYPT_DATA_PARAMS, CK_DSA_PARAMETER_GEN_PARAM, CK_ECDH1_DERIVE_PARAMS, CK_ECDH_AES_KEY_WRAP_PARAMS, CK_ECMQV_DERIVE_PARAMS, CK_GCM_PARAMS, CK_GOSTR3410_DERIVE_PARAMS, CK_GOSTR3410_KEY_WRAP_PARAMS, CK_INFO, CK_KEA_DERIVE_PARAMS, CK_KEY_DERIVATION_STRING_DATA, CK_KEY_WRAP_SET_OAEP_PARAMS, CK_KIP_PARAMS, CK_MECHANISM, CK_MECHANISM_INFO, CK_OTP_PARAM, CK_OTP_PARAMS, CK_OTP_SIGNATURE_INFO, CK_PBE_PARAMS, CK_PKCS5_PBKD2_PARAMS, CK_RC2_CBC_PARAMS, CK_RC2_MAC_GENERAL_PARAMS, CK_RC5_CBC_PARAMS, CK_RC5_MAC_GENERAL_PARAMS, CK_RC5_PARAMS, CK_RSA_AES_KEY_WRAP_PARAMS, CK_RSA_PKCS_OAEP_PARAMS, CK_RSA_PKCS_PSS_PARAMS, CK_SESSION_INFO, CK_SKIPJACK_PRIVATE_WRAP_PARAMS, CK_SKIPJACK_RELAYX_PARAMS, CK_SLOT_INFO, CK_SSL3_KEY_MAT_OUT, CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_SSL3_RANDOM_DATA, CK_TLS12_KEY_MAT_PARAMS, CK_TLS12_MASTER_KEY_DERIVE_PARAMS, CK_TLS_KDF_PARAMS, CK_TLS_MAC_PARAMS, CK_TOKEN_INFO, CK_VERSION, CK_WTLS_KEY_MAT_OUT, CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_MASTER_KEY_DERIVE_PARAMS, CK_WTLS_PRF_PARAMS, CK_WTLS_RANDOM_DATA, CK_X9_42_DH1_DERIVE_PARAMS, CK_X9_42_DH2_DERIVE_PARAMS, CK_X9_42_MQV_DERIVE_PARAMS, CStruct, Error, Library, Object, Session, Slot

Constant Summary collapse

VERSION =

Library version

rb_str_new2(VERSION)

Class Method Summary collapse

Class Method Details

.open(*args) ⇒ Object Also known as: new

Alias function for PKCS11::Library#initialize



149
150
151
152
153
# File 'ext/pk11.c', line 149

static VALUE
pkcs11_library_new(int argc, VALUE *argv, VALUE self)
{
  return rb_funcall2(cPKCS11, sNEW, argc, argv);
}