Fix bugs, add features to work with SoftHSM v2. (#32)
Fix bugs, add features to work with SoftHSM v2. (#32)

* Fix incorrect usage of CKO_KEY_TYPE, add CKO_CLASS

Fix some small bugs that cause unit tests to fail with SoftHSM v2:
* Correct value for CKO_KEY_TYPE to CKK_RSA. Values for CKO_KEY_TYPE should
  be CKK_(RSA|DSA|ECDSA|AES) etc.
* Add CKO_CLASS attribute to correctly set the key type as public or private.

* Fix token persistence issues, work with SoftHSM v2

A lot of changes this go-around. I suspect the unit tests worked
previously due to bugs in SoftHSM v1.

* Add token_persistent to generateRSAKeyPair to set the value of
  CKA_TOKEN, which determines whether or not a token will be
  persistent (stored in the DB) or session based. This is to allow
  for persistent token unit tests to be added down the line.

* Add token_label to generateRSAKeyPair, to set the label string
  for the token. Useful for debugging which functions are leaving
  tokens lying around.

* Add generateRSAKeyPair to TestGetAttributeValue and
  TestFindObject. These tests were failing because there simply
  weren't any tokens around for them to find. Other tests didn't
  leave anything lying around, because they only created session
  based tokens.

* split testDestroyObject into TestDestroyObject and
  destroyObject. This allows for destroyObject to be re-used by
  other functions that want to play with persistent tokens, as
  well as enabling tests for creating and destroying persistent
  tokens.

* Enable TestDestroyObject to create and destroy persistent tokens in
  the HSM

* Add 'CKF_RW_SESSION' to getSession, to allow for persistent
  token management.

* camelcase variables

camelcase token_persistence and search_token

miekg/pkcs11,miekg/pkcs11