]> WPIA git - cassiopeia.git/blob - src/opensslBIO.cpp
add: simple, signer-side record handling
[cassiopeia.git] / src / opensslBIO.cpp
1 #include "opensslBIO.h"
2
3 OpensslBIOWrapper::OpensslBIOWrapper( BIO* b ) {
4     this->b = b;
5 }
6
7 OpensslBIOWrapper::~OpensslBIOWrapper() {
8     BIO_free( b );
9 }
10
11 int OpensslBIOWrapper::write( const char* buf, int num ) {
12     return BIO_write( b, buf, num );
13 }
14
15 int OpensslBIOWrapper::read( char* buf, int size ) {
16     return BIO_read( b, buf, size );
17 }
18
19 long OpensslBIOWrapper::ctrl( int cmod, long arg1, void* arg2 ) {
20     return BIO_ctrl( b, cmod, arg1, arg2 );
21 }
22
23 int OpensslBIOWrapper::puts( const char* str ) {
24     return BIO_puts( b, str );
25 }
26
27 int OpensslBIOWrapper::gets( char* str, int size ) {
28     return BIO_gets( b, str, size );
29 }
30
31 const char* OpensslBIOWrapper::getName() {
32     return "OpenSSLWrapper";
33 }