]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibNull/Pk/CryptX509Null.c
2 X.509 Certificate Handler Wrapper Implementation which does not provide
5 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "InternalCryptLib.h"
13 Construct a X509 object from DER-encoded certificate data.
15 Return FALSE to indicate this interface is not supported.
17 @param[in] Cert Pointer to the DER-encoded certificate data.
18 @param[in] CertSize The size of certificate data in bytes.
19 @param[out] SingleX509Cert The generated X509 object.
21 @retval FALSE This interface is not supported.
26 X509ConstructCertificate (
29 OUT UINT8
**SingleX509Cert
37 Construct a X509 stack object from a list of DER-encoded certificate data.
39 Return FALSE to indicate this interface is not supported.
41 @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
42 On output, pointer to the X509 stack object with new
43 inserted X509 certificate.
44 @param ... A list of DER-encoded single certificate data followed
45 by certificate size. A NULL terminates the list. The
46 pairs are the arguments to X509ConstructCertificate().
48 @retval FALSE This interface is not supported.
53 X509ConstructCertificateStack (
54 IN OUT UINT8
**X509Stack
,
63 Release the specified X509 object.
65 If the interface is not supported, then ASSERT().
67 @param[in] X509Cert Pointer to the X509 object to be released.
80 Release the specified X509 stack object.
82 If the interface is not supported, then ASSERT().
84 @param[in] X509Stack Pointer to the X509 stack object to be released.
97 Retrieve the subject bytes from one X.509 certificate.
99 Return FALSE to indicate this interface is not supported.
101 @param[in] Cert Pointer to the DER-encoded X509 certificate.
102 @param[in] CertSize Size of the X509 certificate in bytes.
103 @param[out] CertSubject Pointer to the retrieved certificate subject bytes.
104 @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,
105 and the size of buffer returned CertSubject on output.
108 @retval FALSE This interface is not supported.
114 IN CONST UINT8
*Cert
,
116 OUT UINT8
*CertSubject
,
117 IN OUT UINTN
*SubjectSize
125 Retrieve the common name (CN) string from one X.509 certificate.
127 Return RETURN_UNSUPPORTED to indicate this interface is not supported.
129 @param[in] Cert Pointer to the DER-encoded X509 certificate.
130 @param[in] CertSize Size of the X509 certificate in bytes.
131 @param[out] CommonName Buffer to contain the retrieved certificate common
132 name string (UTF8). At most CommonNameSize bytes will be
133 written and the string will be null terminated. May be
134 NULL in order to determine the size buffer needed.
135 @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,
136 and the size of buffer returned CommonName on output.
137 If CommonName is NULL then the amount of space needed
138 in buffer (including the final null) is returned.
140 @retval RETURN_UNSUPPORTED The operation is not supported.
146 IN CONST UINT8
*Cert
,
148 OUT CHAR8
*CommonName
, OPTIONAL
149 IN OUT UINTN
*CommonNameSize
153 return RETURN_UNSUPPORTED
;
157 Retrieve the organization name (ON) string from one X.509 certificate.
159 Return RETURN_UNSUPPORTED to indicate this interface is not supported.
161 @param[in] Cert Pointer to the DER-encoded X509 certificate.
162 @param[in] CertSize Size of the X509 certificate in bytes.
163 @param[out] NameBuffer Buffer to contain the retrieved certificate organization
164 name string. At most NameBufferSize bytes will be
165 written and the string will be null terminated. May be
166 NULL in order to determine the size buffer needed.
167 @param[in,out] NameBufferSize The size in bytes of the Name buffer on input,
168 and the size of buffer returned Name on output.
169 If NameBuffer is NULL then the amount of space needed
170 in buffer (including the final null) is returned.
172 @retval RETURN_UNSUPPORTED The operation is not supported.
177 X509GetOrganizationName (
178 IN CONST UINT8
*Cert
,
180 OUT CHAR8
*NameBuffer
, OPTIONAL
181 IN OUT UINTN
*NameBufferSize
185 return RETURN_UNSUPPORTED
;
189 Retrieve the RSA Public Key from one DER-encoded X509 certificate.
191 Return FALSE to indicate this interface is not supported.
193 @param[in] Cert Pointer to the DER-encoded X509 certificate.
194 @param[in] CertSize Size of the X509 certificate in bytes.
195 @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
196 RSA public key component. Use RsaFree() function to free the
199 @retval FALSE This interface is not supported.
204 RsaGetPublicKeyFromX509 (
205 IN CONST UINT8
*Cert
,
207 OUT VOID
**RsaContext
215 Verify one X509 certificate was issued by the trusted CA.
217 Return FALSE to indicate this interface is not supported.
219 @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.
220 @param[in] CertSize Size of the X509 certificate in bytes.
221 @param[in] CACert Pointer to the DER-encoded trusted CA certificate.
222 @param[in] CACertSize Size of the CA Certificate in bytes.
224 @retval FALSE This interface is not supported.
230 IN CONST UINT8
*Cert
,
232 IN CONST UINT8
*CACert
,
241 Retrieve the TBSCertificate from one given X.509 certificate.
243 Return FALSE to indicate this interface is not supported.
245 @param[in] Cert Pointer to the given DER-encoded X509 certificate.
246 @param[in] CertSize Size of the X509 certificate in bytes.
247 @param[out] TBSCert DER-Encoded To-Be-Signed certificate.
248 @param[out] TBSCertSize Size of the TBS certificate in bytes.
250 @retval FALSE This interface is not supported.
256 IN CONST UINT8
*Cert
,
259 OUT UINTN
*TBSCertSize