FreeRDP
libfreerdp/crypto/certificate.h
1 
22 #ifndef FREERDP_LIB_CORE_CERTIFICATE_H
23 #define FREERDP_LIB_CORE_CERTIFICATE_H
24 
25 #include <freerdp/crypto/crypto.h>
26 #include <freerdp/crypto/certificate.h>
27 
28 #include <openssl/x509.h>
29 
30 /* Certificate Version */
31 #define CERT_CHAIN_VERSION_1 0x00000001
32 #define CERT_CHAIN_VERSION_2 0x00000002
33 #define CERT_CHAIN_VERSION_MASK 0x7FFFFFFF
34 #define CERT_PERMANENTLY_ISSUED 0x00000000
35 #define CERT_TEMPORARILY_ISSUED 0x80000000
36 
37 #define SIGNATURE_ALG_RSA 0x00000001
38 #define KEY_EXCHANGE_ALG_RSA 0x00000001
39 
40 #define BB_RSA_KEY_BLOB 6
41 #define BB_RSA_SIGNATURE_BLOB 8
42 
43 WINPR_ATTR_MALLOC(freerdp_certificate_free, 1)
44 FREERDP_LOCAL rdpCertificate* freerdp_certificate_new_from_x509(const X509* xcert,
45  const STACK_OF(X509) * chain);
46 
47 FREERDP_LOCAL BOOL freerdp_certificate_read_server_cert(rdpCertificate* certificate,
48  const BYTE* server_cert, size_t length);
49 FREERDP_LOCAL SSIZE_T freerdp_certificate_write_server_cert(const rdpCertificate* certificate,
50  UINT32 dwVersion, wStream* s);
51 
52 WINPR_ATTR_MALLOC(freerdp_certificate_free, 1)
53 FREERDP_LOCAL rdpCertificate* freerdp_certificate_clone(const rdpCertificate* certificate);
54 
55 FREERDP_LOCAL const rdpCertInfo* freerdp_certificate_get_info(const rdpCertificate* certificate);
56 
60 FREERDP_LOCAL X509* freerdp_certificate_get_x509(rdpCertificate* certificate);
61 
62 FREERDP_LOCAL BOOL freerdp_certificate_publickey_encrypt(const rdpCertificate* cert,
63  const BYTE* input, size_t cbInput,
64  BYTE** poutput, size_t* pcbOutput);
65 
66 #endif /* FREERDP_LIB_CORE_CERTIFICATE_H */