OpenSSL interface

## Files

file | pkcs11h-openssl.h
| pkcs11-helper OpenSSL interface.

## Typedefs

typedef void(* | pkcs11h_hook_openssl_cleanup_t) (IN const pkcs11h_certificate_t certificate)
| OpenSSL RSA cleanup hook.
typedef struct pkcs11h_openssl_session_s * | pkcs11h_openssl_session_t
| OpenSSL session reference.

## Functions

X509 * | pkcs11h_openssl_getX509 (IN const pkcs11h_certificate_t certificate)
| Returns an X509 object out of the openssl_session object.
pkcs11h_openssl_session_t | pkcs11h_openssl_createSession (IN const pkcs11h_certificate_t certificate)
| Create OpenSSL session based on a certificate object.
pkcs11h_hook_openssl_cleanup_t | pkcs11h_openssl_getCleanupHook (IN const pkcs11h_openssl_session_t openssl_session)
| Sets cleanup hook.
void | pkcs11h_openssl_setCleanupHook (IN const pkcs11h_openssl_session_t openssl_session, IN const pkcs11h_hook_openssl_cleanup_t cleanup)
| Sets cleanup hook.
void | pkcs11h_openssl_freeSession (IN const pkcs11h_openssl_session_t openssl_session)
| Free OpenSSL session.
RSA * | pkcs11h_openssl_session_getRSA (IN const pkcs11h_openssl_session_t openssl_session)
| Returns an RSA object out of the openssl_session object.
EVP_PKEY * | pkcs11h_openssl_session_getEVP (IN const pkcs11h_openssl_session_t openssl_session)
| Returns an EVP_PKEY out of the openssl_session object.
X509 * | pkcs11h_openssl_session_getX509 (IN const pkcs11h_openssl_session_t openssl_session)
| Returns an X509 object out of the openssl_session object.

## Detailed Description

OpenSSL engine to be used by OpenSSL enabled applications.

## Typedef Documentation

## pkcs11h_hook_openssl_cleanup_t

typedef void(* pkcs11h_hook_openssl_cleanup_t) (IN const pkcs11h_certificate_t certificate)

OpenSSL RSA cleanup hook.

Parameters

  certificate | Certificate attached to the RSA object.

## Function Documentation

## pkcs11h_openssl_createSession()

pkcs11h_openssl_session_t pkcs11h_openssl_createSession | ( | IN const pkcs11h_certificate_t | certificate | ) |

Create OpenSSL session based on a certificate object.

Parameters

  certificate | Certificate object.

Returns
  OpenSSL session reference.

Note
  The certificate object will be freed by the OpenSSL interface on session end.

See also
  pkcs11h_openssl_freeSession().

## pkcs11h_openssl_freeSession()

void pkcs11h_openssl_freeSession | ( | IN const pkcs11h_openssl_session_t | openssl_session | ) |

Free OpenSSL session.

Parameters

  openssl_session | OpenSSL session reference.

Note
  The openssl_session object has a reference count just like other OpenSSL objects.

## pkcs11h_openssl_getCleanupHook()

pkcs11h_hook_openssl_cleanup_t pkcs11h_openssl_getCleanupHook | ( | IN const pkcs11h_openssl_session_t | openssl_session | ) |

Sets cleanup hook.

Parameters

  openssl_session | OpenSSL session reference.

Returns
  Current hook.

## pkcs11h_openssl_getX509()

X509 * pkcs11h_openssl_getX509 | ( | IN const pkcs11h_certificate_t | certificate | ) |

Returns an X509 object out of the openssl_session object.

Parameters

  certificate | Certificate object.

Returns
  X509.

## pkcs11h_openssl_session_getEVP()

EVP_PKEY * pkcs11h_openssl_session_getEVP | ( | IN const pkcs11h_openssl_session_t | openssl_session | ) |

Returns an EVP_PKEY out of the openssl_session object.

Parameters

  openssl_session | OpenSSL session reference.

Returns
  EVP_PKEY.

## pkcs11h_openssl_session_getRSA()

RSA * pkcs11h_openssl_session_getRSA | ( | IN const pkcs11h_openssl_session_t | openssl_session | ) |

Returns an RSA object out of the openssl_session object.

Parameters

  openssl_session | OpenSSL session reference.

Returns
  RSA.

## pkcs11h_openssl_session_getX509()

X509 * pkcs11h_openssl_session_getX509 | ( | IN const pkcs11h_openssl_session_t | openssl_session | ) |

Returns an X509 object out of the openssl_session object.

Parameters

  openssl_session | OpenSSL session reference.

Returns
  X509.

## pkcs11h_openssl_setCleanupHook()

void pkcs11h_openssl_setCleanupHook | ( | IN const pkcs11h_openssl_session_t | openssl_session,
|  | IN const pkcs11h_hook_openssl_cleanup_t | cleanup )

Sets cleanup hook.

Parameters

  openssl_session | OpenSSL session reference.
  cleanup | hook.

pkcs11-helper, Copyright (C) Alon Bar-Lev <alon.barlev@gmail.com> |