tls.h
// Copyright (c) 1999-2018 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 supported();
#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 setPrivateKeyFile(const char *filename);
const char *getPrivateKeyFile();
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 size);
ssize_t write(const void *buf, ssize_t size);
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 getPublicKeyByteSize();
uint64_t getPublicKeyBitSize();
linkedlist< char * > *getSubjectAlternateNames();
#include <rudiments/private/tlscertificate.h>
};
#endif
datetime
Definition: datetime.h:12
filedescriptor
Definition: filedescriptor.h:13
linkedlist
Definition: linkedlist.h:60
securitycontext
Definition: security.h:16
tls
Definition: tls.h:9
tls::supported
static bool supported()
tlscertificate
Definition: tls.h:352
tlscertificate::getValidFrom
datetime * getValidFrom()
tlscertificate::getIssuer
const char * getIssuer()
tlscertificate::getPublicKeyBitSize
uint64_t getPublicKeyBitSize()
tlscertificate::getValidTo
datetime * getValidTo()
tlscertificate::~tlscertificate
~tlscertificate()
tlscertificate::getSignatureAlgorithm
const char * getSignatureAlgorithm()
tlscertificate::getSerialNumber
uint64_t getSerialNumber()
tlscertificate::getCommonName
const char * getCommonName()
tlscertificate::getSubject
const char * getSubject()
tlscertificate::getPublicKeyByteSize
uint64_t getPublicKeyByteSize()
tlscertificate::getPublicKeyAlgorithm
const char * getPublicKeyAlgorithm()
tlscertificate::getVersion
uint32_t getVersion()
tlscertificate::getSubjectAlternateNames
linkedlist< char * > * getSubjectAlternateNames()
tlscertificate::getPublicKey
const unsigned char * getPublicKey()
tlscertificate::tlscertificate
tlscertificate()
tlscontext
Definition: tls.h:18
tlscontext::getCertificateAuthority
const char * getCertificateAuthority()
tlscontext::getPeerCertificate
tlscertificate * getPeerCertificate()
tlscontext::tlscontext
tlscontext()
tlscontext::setProtocolVersion
void setProtocolVersion(const char *version)
tlscontext::getProtocolVersion
const char * getProtocolVersion()
tlscontext::setPrivateKeyPassword
void setPrivateKeyPassword(const char *password)
tlscontext::setCertificateAuthority
void setCertificateAuthority(const char *ca)
tlscontext::getErrorString
const char * getErrorString()
tlscontext::getPrivateKeyPassword
const char * getPrivateKeyPassword()
tlscontext::pending
ssize_t pending()
tlscontext::getFileDescriptor
filedescriptor * getFileDescriptor()
tlscontext::getCiphers
const char * getCiphers()
tlscontext::getError
int32_t getError()
tlscontext::setValidationDepth
void setValidationDepth(uint16_t depth)
tlscontext::close
bool close()
tlscontext::read
ssize_t read(void *buf, ssize_t size)
tlscontext::setCertificateChainFile
void setCertificateChainFile(const char *filename)
tlscontext::getSizeMax
ssize_t getSizeMax()
tlscontext::write
ssize_t write(const void *buf, ssize_t size)
tlscontext::getPrivateKeyFile
const char * getPrivateKeyFile()
tlscontext::setValidatePeer
void setValidatePeer(bool validatepeer)
tlscontext::connect
bool connect()
tlscontext::getValidatePeer
bool getValidatePeer()
tlscontext::setFileDescriptor
void setFileDescriptor(filedescriptor *fd)
tlscontext::getCertificateChainFile
const char * getCertificateChainFile()
tlscontext::accept
bool accept()
tlscontext::getValidationDepth
uint16_t getValidationDepth()
tlscontext::setPrivateKeyFile
void setPrivateKeyFile(const char *filename)
tlscontext::~tlscontext
virtual ~tlscontext()
tlscontext::setCiphers
void setCiphers(const char *ciphers)