]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c
d00f38daa83f8dc0fd2b31eb5acfaf62748af5fa
2 X.509 Certificate Handler Wrapper Implementation which does not provide
5 Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "InternalCryptLib.h"
19 Construct a X509 object from DER-encoded certificate data.
21 Return FALSE to indicate this interface is not supported.
23 @param[in] Cert Pointer to the DER-encoded certificate data.
24 @param[in] CertSize The size of certificate data in bytes.
25 @param[out] SingleX509Cert The generated X509 object.
27 @retval FALSE This interface is not supported.
32 X509ConstructCertificate (
35 OUT UINT8
**SingleX509Cert
43 Construct a X509 stack object from a list of DER-encoded certificate data.
45 Return FALSE to indicate this interface is not supported.
47 @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
48 On output, pointer to the X509 stack object with new
49 inserted X509 certificate.
50 @param ... A list of DER-encoded single certificate data followed
51 by certificate size. A NULL terminates the list. The
52 pairs are the arguments to X509ConstructCertificate().
54 @retval FALSE This interface is not supported.
59 X509ConstructCertificateStack (
60 IN OUT UINT8
**X509Stack
,
69 Release the specified X509 object.
71 If the interface is not supported, then ASSERT().
73 @param[in] X509Cert Pointer to the X509 object to be released.
86 Release the specified X509 stack object.
88 If the interface is not supported, then ASSERT().
90 @param[in] X509Stack Pointer to the X509 stack object to be released.
103 Retrieve the subject bytes from one X.509 certificate.
105 Return FALSE to indicate this interface is not supported.
107 @param[in] Cert Pointer to the DER-encoded X509 certificate.
108 @param[in] CertSize Size of the X509 certificate in bytes.
109 @param[out] CertSubject Pointer to the retrieved certificate subject bytes.
110 @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,
111 and the size of buffer returned CertSubject on output.
114 @retval FALSE This interface is not supported.
120 IN CONST UINT8
*Cert
,
122 OUT UINT8
*CertSubject
,
123 IN OUT UINTN
*SubjectSize
131 Retrieve the common name (CN) string from one X.509 certificate.
133 Return RETURN_UNSUPPORTED to indicate this interface is not supported.
135 @param[in] Cert Pointer to the DER-encoded X509 certificate.
136 @param[in] CertSize Size of the X509 certificate in bytes.
137 @param[out] CommonName Buffer to contain the retrieved certificate common
138 name string. At most CommonNameSize bytes will be
139 written and the string will be null terminated. May be
140 NULL in order to determine the size buffer needed.
141 @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,
142 and the size of buffer returned CommonName on output.
143 If CommonName is NULL then the amount of space needed
144 in buffer (including the final null) is returned.
146 @retval RETURN_UNSUPPORTED The operation is not supported.
152 IN CONST UINT8
*Cert
,
154 OUT CHAR8
*CommonName
, OPTIONAL
155 IN OUT UINTN
*CommonNameSize
159 return RETURN_UNSUPPORTED
;
163 Retrieve the RSA Public Key from one DER-encoded X509 certificate.
165 Return FALSE to indicate this interface is not supported.
167 @param[in] Cert Pointer to the DER-encoded X509 certificate.
168 @param[in] CertSize Size of the X509 certificate in bytes.
169 @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
170 RSA public key component. Use RsaFree() function to free the
173 @retval FALSE This interface is not supported.
178 RsaGetPublicKeyFromX509 (
179 IN CONST UINT8
*Cert
,
181 OUT VOID
**RsaContext
189 Verify one X509 certificate was issued by the trusted CA.
191 Return FALSE to indicate this interface is not supported.
193 @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.
194 @param[in] CertSize Size of the X509 certificate in bytes.
195 @param[in] CACert Pointer to the DER-encoded trusted CA certificate.
196 @param[in] CACertSize Size of the CA Certificate in bytes.
198 @retval FALSE This interface is not supported.
204 IN CONST UINT8
*Cert
,
206 IN CONST UINT8
*CACert
,
215 Retrieve the TBSCertificate from one given X.509 certificate.
217 Return FALSE to indicate this interface is not supported.
219 @param[in] Cert Pointer to the given DER-encoded X509 certificate.
220 @param[in] CertSize Size of the X509 certificate in bytes.
221 @param[out] TBSCert DER-Encoded To-Be-Signed certificate.
222 @param[out] TBSCertSize Size of the TBS certificate in bytes.
224 @retval FALSE This interface is not supported.
230 IN CONST UINT8
*Cert
,
233 OUT UINTN
*TBSCertSize