2
* FreeRDP: A Remote Desktop Protocol Client
5
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
11
* http://www.apache.org/licenses/LICENSE-2.0
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
20
#ifndef __CERTIFICATE_H
21
#define __CERTIFICATE_H
27
#include <freerdp/settings.h>
28
#include <freerdp/utils/blob.h>
29
#include <freerdp/utils/stream.h>
30
#include <freerdp/utils/hexdump.h>
32
/* Certificate Version */
33
#define CERT_CHAIN_VERSION_1 0x00000001
34
#define CERT_CHAIN_VERSION_2 0x00000002
35
#define CERT_CHAIN_VERSION_MASK 0x7FFFFFFF
36
#define CERT_PERMANENTLY_ISSUED 0x00000000
37
#define CERT_TEMPORARILY_ISSUED 0x80000000
39
#define BB_RSA_KEY_BLOB 6
40
#define BB_RSA_SIGNATURE_BLOB 8
42
void certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* info);
44
rdpX509CertChain* certificate_new_x509_certificate_chain(uint32 count);
45
void certificate_free_x509_certificate_chain(rdpX509CertChain* x509_cert_chain);
47
boolean certificate_read_server_proprietary_certificate(rdpCertificate* certificate, STREAM* s);
48
boolean certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, STREAM* s);
49
boolean certificate_read_server_certificate(rdpCertificate* certificate, uint8* server_cert, int length);
51
rdpCertificate* certificate_new(void);
52
void certificate_free(rdpCertificate* certificate);
54
#ifdef WITH_DEBUG_CERTIFICATE
55
#define DEBUG_CERTIFICATE(fmt, ...) DEBUG_CLASS(CERTIFICATE, fmt, ## __VA_ARGS__)
57
#define DEBUG_CERTIFICATE(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
60
#endif /* __CERTIFICATE_H */