Rudiments
tls.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_TLS_H
5#define RUDIMENTS_TLS_H
6
7#include <rudiments/private/tlsincludes.h>
8
9
12class RUDIMENTS_DLLSPEC tls {
13 public:
16 static bool isSupported();
17
18 #include <rudiments/private/tls.h>
19};
20
21
24class RUDIMENTS_DLLSPEC tlscontext : public securitycontext {
25 public:
28
30 virtual ~tlscontext();
31
39 void setProtocolVersion(const char *version);
40
43 const char *getProtocolVersion();
44
113
118
135 void setPrivateKeyFile(const char *filename);
136
140 const char *getPrivateKeyFile();
141
149
157
171 void setCiphers(const char *ciphers);
172
175 const char *getCiphers();
176
181
186
211
216
271 void setCertificateAuthority(const char *ca);
272
277
282
287
288
299 bool connect();
300
301
312 bool accept();
313
321
326 ssize_t read(void *buf, size_t size);
327
332 ssize_t write(const void *buf, size_t size);
333
337
340 bool close();
341
342
345 size_t getSizeMax();
346
347
350
353 const char *getErrorString();
354
355 #include <rudiments/private/tlscontext.h>
356};
357
358
361class RUDIMENTS_DLLSPEC tlscertificate : public object {
362 public:
365
368
371
374
377
379 const char *getIssuer();
380
383
386
388 const char *getSubject();
389
391 const char *getCommonName();
392
395
398
402
406
409
410 #include <rudiments/private/tlscertificate.h>
411};
412
413#endif
Definition avltree.h:11
Definition datetime.h:12
Definition filedescriptor.h:13
Definition object.h:10
Definition securitycontext.h:11
Definition tls.h:12
static bool isSupported()
Definition tls.h:361
const char * getPublicKeyAlgorithm()
linkedlist< char * > * getSubjectAlternateNames()
uint64_t getPublicKeyBitSize()
const char * getSignatureAlgorithm()
const char * getIssuer()
uint64_t getSerialNumber()
uint64_t getPublicKeyByteSize()
datetime * getValidTo()
datetime * getValidFrom()
uint32_t getVersion()
const byte_t * getPublicKey()
const char * getCommonName()
const char * getSubject()
Definition tls.h:24
void setProtocolVersion(const char *version)
void setPrivateKeyPassword(const char *password)
void setCertificateAuthority(const char *ca)
const char * getCertificateAuthority()
const char * getProtocolVersion()
tlscertificate * getPeerCertificate()
filedescriptor * getFileDescriptor()
const char * getPrivateKeyFile()
int32_t getError()
const char * getCertificateChainFile()
void setValidationDepth(uint16_t depth)
ssize_t write(const void *buf, size_t size)
bool close()
void setCertificateChainFile(const char *filename)
const char * getErrorString()
ssize_t read(void *buf, size_t size)
void setValidatePeer(bool validatepeer)
bool connect()
bool getValidatePeer()
void setFileDescriptor(filedescriptor *fd)
bool accept()
size_t getSizeMax()
uint16_t getValidationDepth()
const char * getPrivateKeyPassword()
const char * getCiphers()
void setPrivateKeyFile(const char *filename)
virtual ~tlscontext()
size_t getPendingSize()
void setCiphers(const char *ciphers)