tls.h
// Copyright (c) 2016 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_TLS_H
#define RUDIMENTS_TLS_H
#include <rudiments/private/tlsincludes.h>
class RUDIMENTS_DLLSPEC tls {
public:
static bool supportsTLS();
#include <rudiments/private/tls.h>
};
class RUDIMENTS_DLLSPEC tlscontext : public securitycontext {
public:
tlscontext();
virtual ~tlscontext();
void setProtocolVersion(const char *version);
const char *getProtocolVersion();
void setCertificateChainFile(const char *filename);
const char *getCertificateChainFile();
void setPrivateKeyPassword(const char *password);
const char *getPrivateKeyPassword();
void setCiphers(const char *ciphers);
const char *getCiphers();
void setValidatePeer(bool validatepeer);
bool getValidatePeer();
void setValidationDepth(uint16_t depth);
uint16_t getValidationDepth();
void setCertificateAuthority(const char *ca);
const char *getCertificateAuthority();
void setFileDescriptor(filedescriptor *fd);
filedescriptor *getFileDescriptor();
bool connect();
bool accept();
tlscertificate *getPeerCertificate();
ssize_t read(void *buf, ssize_t count);
ssize_t write(const void *buf, ssize_t count);
ssize_t pending();
bool close();
ssize_t getSizeMax();
int32_t getError();
const char *getErrorString();
#include <rudiments/private/tlscontext.h>
};
class RUDIMENTS_DLLSPEC tlscertificate {
public:
tlscertificate();
~tlscertificate();
uint32_t getVersion();
uint64_t getSerialNumber();
const char *getSignatureAlgorithm();
const char *getIssuer();
datetime *getValidFrom();
datetime *getValidTo();
const char *getSubject();
const char *getCommonName();
const char *getPublicKeyAlgorithm();
const unsigned char *getPublicKey();
uint64_t getPublicKeyByteLength();
uint64_t getPublicKeyBitLength();
linkedlist< char * > *getSubjectAlternateNames();
#include <rudiments/private/tlscertificate.h>
};
#endif
linkedlist
Definition: linkedlist.h:60
datetime
Definition: datetime.h:14
filedescriptor
Definition: filedescriptor.h:14
securitycontext
Definition: security.h:16
tls
Definition: tls.h:9
tlscontext
Definition: tls.h:18
tlscertificate
Definition: tls.h:238