Added a getter for the library alias
This commit is contained in:
@@ -186,8 +186,19 @@ struct private_pkcs11_library_t {
|
|||||||
* dlopen() handle
|
* dlopen() handle
|
||||||
*/
|
*/
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name as passed to the constructor
|
||||||
|
*/
|
||||||
|
char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
METHOD(pkcs11_library_t, get_name, char*,
|
||||||
|
private_pkcs11_library_t *this)
|
||||||
|
{
|
||||||
|
return this->name;
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(pkcs11_library_t, destroy, void,
|
METHOD(pkcs11_library_t, destroy, void,
|
||||||
private_pkcs11_library_t *this)
|
private_pkcs11_library_t *this)
|
||||||
{
|
{
|
||||||
@@ -334,8 +345,10 @@ pkcs11_library_t *pkcs11_library_create(char *name, char *file)
|
|||||||
|
|
||||||
INIT(this,
|
INIT(this,
|
||||||
.public = {
|
.public = {
|
||||||
|
.get_name = _get_name,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
|
.name = name,
|
||||||
.handle = dlopen(file, RTLD_LAZY),
|
.handle = dlopen(file, RTLD_LAZY),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ struct pkcs11_library_t {
|
|||||||
*/
|
*/
|
||||||
CK_FUNCTION_LIST_PTR f;
|
CK_FUNCTION_LIST_PTR f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name this instance was created with.
|
||||||
|
*
|
||||||
|
* @return name, as passed to constructor
|
||||||
|
*/
|
||||||
|
char* (*get_name)(pkcs11_library_t *this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy a pkcs11_library_t.
|
* Destroy a pkcs11_library_t.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user