-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcertdump.h
28 lines (24 loc) · 1.09 KB
/
certdump.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//****************************************************************************
//
// Copyright (c) ALTAP, spol. s r.o. All rights reserved.
//
// This is a part of the Altap Salamander SDK library.
//
// The SDK is provided "AS IS" and without warranty of any kind and
// ALTAP EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE and NON-INFRINGEMENT.
//
//****************************************************************************
#pragma once
#include <stdio.h>
#include <functional>
// functor prototype for password callback handler,
// params:
// - char *buffer - callback stores the password into the buffer
// - int size - length of the buffer
// return: password length in bytes, or -1 on error
using PasswordCallback = std::function<int(char*, int)>;
// dumps the provided certificate file into output FILE, calls password callback only
// when the file is password protected, returns TRUE on success
bool DumpCertificate(const char *certFile, FILE *out, PasswordCallback callback);