Move pkcs11 public key lookup function declaration to header file
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "pkcs11_library.h"
|
#include "pkcs11_library.h"
|
||||||
#include "pkcs11_manager.h"
|
#include "pkcs11_manager.h"
|
||||||
|
#include "pkcs11_public_key.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
@@ -81,12 +82,6 @@ struct private_pkcs11_private_key_t {
|
|||||||
key_type_t type;
|
key_type_t type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Implemented in pkcs11_public_key.c
|
|
||||||
*/
|
|
||||||
public_key_t *pkcs11_public_key_connect(pkcs11_library_t *p11,
|
|
||||||
int slot, key_type_t type, chunk_t keyid);
|
|
||||||
|
|
||||||
|
|
||||||
METHOD(private_key_t, get_type, key_type_t,
|
METHOD(private_key_t, get_type, key_type_t,
|
||||||
private_pkcs11_private_key_t *this)
|
private_pkcs11_private_key_t *this)
|
||||||
|
|||||||
@@ -882,20 +882,10 @@ static private_pkcs11_public_key_t *find_key_by_keyid(pkcs11_library_t *p11,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a public key on the given token with a specific keyid.
|
* See header.
|
||||||
*
|
|
||||||
* Used by pkcs11_private_key_t.
|
|
||||||
*
|
|
||||||
* TODO: if no public key is found, we should perhaps search for a certificate
|
|
||||||
* with the given keyid and extract the key from there
|
|
||||||
*
|
|
||||||
* @param p11 PKCS#11 module
|
|
||||||
* @param slot slot id
|
|
||||||
* @param type type of the key
|
|
||||||
* @param keyid key id
|
|
||||||
*/
|
*/
|
||||||
pkcs11_public_key_t *pkcs11_public_key_connect(pkcs11_library_t *p11,
|
public_key_t *pkcs11_public_key_connect(pkcs11_library_t *p11, int slot,
|
||||||
int slot, key_type_t type, chunk_t keyid)
|
key_type_t type, chunk_t keyid)
|
||||||
{
|
{
|
||||||
private_pkcs11_public_key_t *this;
|
private_pkcs11_public_key_t *this;
|
||||||
|
|
||||||
@@ -904,5 +894,5 @@ pkcs11_public_key_t *pkcs11_public_key_connect(pkcs11_library_t *p11,
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return &this->public;
|
return &this->public.key;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ typedef struct pkcs11_public_key_t pkcs11_public_key_t;
|
|||||||
#include <credentials/builder.h>
|
#include <credentials/builder.h>
|
||||||
#include <credentials/keys/private_key.h>
|
#include <credentials/keys/private_key.h>
|
||||||
|
|
||||||
|
#include "pkcs11_library.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PKCS#11 based public key implementation.
|
* PKCS#11 based public key implementation.
|
||||||
*/
|
*/
|
||||||
@@ -46,4 +48,15 @@ struct pkcs11_public_key_t {
|
|||||||
*/
|
*/
|
||||||
pkcs11_public_key_t *pkcs11_public_key_load(key_type_t type, va_list args);
|
pkcs11_public_key_t *pkcs11_public_key_load(key_type_t type, va_list args);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a public key on the given token with a specific keyid.
|
||||||
|
*
|
||||||
|
* @param p11 PKCS#11 module
|
||||||
|
* @param slot slot id
|
||||||
|
* @param type type of the key
|
||||||
|
* @param keyid key id
|
||||||
|
*/
|
||||||
|
public_key_t *pkcs11_public_key_connect(pkcs11_library_t *p11, int slot,
|
||||||
|
key_type_t type, chunk_t keyid);
|
||||||
|
|
||||||
#endif /** PKCS11_PUBLIC_KEY_H_ @}*/
|
#endif /** PKCS11_PUBLIC_KEY_H_ @}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user