File: UWP.h

package info (click to toggle)
zeroc-ice 3.7.8-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 82,840 kB
  • sloc: cpp: 360,403; java: 226,078; cs: 102,261; javascript: 35,028; python: 28,875; objc: 27,050; php: 7,543; ruby: 7,190; yacc: 2,946; ansic: 2,490; xml: 1,599; lex: 1,241; makefile: 465; sh: 52
file content (62 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef ICESSL_UWP_H
#define ICESSL_UWP_H

#include <IceSSL/Plugin.h>

namespace IceSSL
{

namespace UWP
{

class Certificate;
ICE_DEFINE_PTR(CertificatePtr, Certificate);

/**
 * This convenience class is a wrapper around a native certificate.
 * \headerfile IceSSL/IceSSL.h
 */
class ICESSL_API Certificate : public virtual IceSSL::Certificate
{
public:

    /**
     * Constructs a certificate using a native certificate.
     * @param cert The native certificate.
     * @return The new certificate instance.
     */
    static CertificatePtr create(Windows::Security::Cryptography::Certificates::Certificate^ cert);

    /**
     * Loads the certificate from a file. The certificate must use the
     * PEM encoding format.
     * @param file The certificate file.
     * @return The new certificate instance.
     * @throws CertificateReadException if the file cannot be read.
     */
    static CertificatePtr load(const std::string& file);

    /**
     * Decodes a certificate from a string that uses the PEM encoding format.
     * @param str A string containing the encoded certificate.
     * @return The new certificate instance.
     * @throws CertificateEncodingException if an error occurs.
     */
    static CertificatePtr decode(const std::string& str);

    /**
     * Obtains the native X509 certificate value wrapped by this object.
     * @return The native certificate.
     */
    virtual Windows::Security::Cryptography::Certificates::Certificate^ getCert() const = 0;
};

} // UWP namespace end

} // IceSSL namespace end

#endif