]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/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 RSA Public Key from one DER-encoded X509 certificate.
159 Return FALSE 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] RsaContext Pointer to new-generated RSA context which contain the retrieved
164 RSA public key component. Use RsaFree() function to free the
167 @retval FALSE This interface is not supported.
172 RsaGetPublicKeyFromX509 (
173 IN CONST UINT8
*Cert
,
175 OUT VOID
**RsaContext
183 Verify one X509 certificate was issued by the trusted CA.
185 Return FALSE to indicate this interface is not supported.
187 @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.
188 @param[in] CertSize Size of the X509 certificate in bytes.
189 @param[in] CACert Pointer to the DER-encoded trusted CA certificate.
190 @param[in] CACertSize Size of the CA Certificate in bytes.
192 @retval FALSE This interface is not supported.
198 IN CONST UINT8
*Cert
,
200 IN CONST UINT8
*CACert
,
209 Retrieve the TBSCertificate from one given X.509 certificate.
211 Return FALSE to indicate this interface is not supported.
213 @param[in] Cert Pointer to the given DER-encoded X509 certificate.
214 @param[in] CertSize Size of the X509 certificate in bytes.
215 @param[out] TBSCert DER-Encoded To-Be-Signed certificate.
216 @param[out] TBSCertSize Size of the TBS certificate in bytes.
218 @retval FALSE This interface is not supported.
224 IN CONST UINT8
*Cert
,
227 OUT UINTN
*TBSCertSize