VirtualBox

source: vbox/trunk/src/VBox/Main/include/CertificateImpl.h@ 60328

Last change on this file since 60328 was 60328, checked in by vboxsync, 9 years ago

bugref:8249. Improvement ICertificate interface.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: CertificateImpl.h 60328 2016-04-05 10:44:40Z vboxsync $ */
2/** @file
3 * VirtualBox COM ICertificate implementation.
4 */
5
6/*
7 * Copyright (C) 2006-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_CERTIFICATEIMPL
19#define ____H_CERTIFICATEIMPL
20
21/* VBox includes */
22#include <VBox/settings.h>
23#include <iprt/crypto/x509.h>
24#include "CertificateWrap.h"
25
26#include <vector>
27
28using namespace std;
29
30class Appliance;
31
32class ATL_NO_VTABLE Certificate :
33 public CertificateWrap
34{
35
36public:
37
38 DECLARE_EMPTY_CTOR_DTOR(Certificate)
39
40 HRESULT init(Appliance* appliance);
41 HRESULT initCertificate(PCRTCRX509CERTIFICATE a_pCert, bool a_fTrusted);
42 void uninit();
43
44 HRESULT FinalConstruct();
45 void FinalRelease();
46
47private:
48 const Appliance* m_appliance;
49
50 // wrapped ICertificate properties
51 HRESULT getVersionNumber(CertificateVersion_T *aVersionNumber);
52 HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
53 HRESULT getSignatureAlgorithmOID(com::Utf8Str &aSignatureAlgorithmOID);
54 HRESULT getSignatureAlgorithmName(com::Utf8Str &aSignatureAlgorithmName);
55 HRESULT getPublicKeyAlgorithmOID(com::Utf8Str &aPublicKeyAlgorithmOID);
56 HRESULT getPublicKeyAlgorithm(com::Utf8Str &aPublicKeyAlgorithm);
57 HRESULT getIssuerName(std::vector<com::Utf8Str> &aIssuerName);
58 HRESULT getSubjectName(std::vector<com::Utf8Str> &aSubjectName);
59 HRESULT getValidityPeriodNotBefore(com::Utf8Str &aValidityPeriodNotBefore);
60 HRESULT getValidityPeriodNotAfter(com::Utf8Str &aValidityPeriodNotAfter);
61 HRESULT getSubjectPublicKey(std::vector<BYTE> &aSubjectPublicKey);
62 HRESULT getIssuerUniqueIdentifier(com::Utf8Str &aIssuerUniqueIdentifier);
63 HRESULT getSubjectUniqueIdentifier(com::Utf8Str &aSubjectUniqueIdentifier);
64 HRESULT getCertificateAuthority(BOOL *aCertificateAuthority);
65 HRESULT getKeyUsage(ULONG *aKeyUsage);
66 HRESULT getExtendedKeyUsage(std::vector<com::Utf8Str> &aExtendedKeyUsage);
67 HRESULT getRawCertData(std::vector<BYTE> &aRawCertData);
68 HRESULT getSelfSigned(BOOL *aSelfSigned);
69 HRESULT getTrusted(BOOL *aTrusted);
70 HRESULT getVerified(BOOL *aVerified);
71 HRESULT getPresence(BOOL *aPresence);
72 // wrapped ICertificate methods
73 HRESULT queryInfo(LONG aWhat, com::Utf8Str &aResult);
74
75 /** @name Methods extracting COM data from the certificate object
76 * @{ */
77 HRESULT i_getAlgorithmName(PCRTCRX509ALGORITHMIDENTIFIER a_pAlgId, com::Utf8Str &a_rReturn);
78 HRESULT i_getX509Name(PCRTCRX509NAME a_pName, std::vector<com::Utf8Str> &a_rReturn);
79 HRESULT i_getTime(PCRTASN1TIME a_pTime, com::Utf8Str &a_rReturn);
80 HRESULT i_getUniqueIdentifier(PCRTCRX509UNIQUEIDENTIFIER a_pUniqueId, com::Utf8Str &a_rReturn);
81 HRESULT i_getEncodedBytes(PRTASN1CORE a_pAsn1Obj, std::vector<BYTE> &a_rReturn);
82 /** @} */
83
84 //data
85 struct Data;
86 Data *mData;
87
88};
89
90#endif // !____H_CERTIFICATEIMPL
91
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette