CryptoPkg/BaseCryptLib.h: Add new API to get organization name
authorBret Barkelew <>
Mon, 25 Mar 2019 04:01:08 +0000 (12:01 +0800)
committerJian J Wang <>
Thu, 18 Apr 2019 05:11:19 +0000 (13:11 +0800)

Add a prototype declaration of the new API X509GetOrganizationName
in the header file.

Signed-off-by: Zhichao Gao <>
Cc: Ting Ye <>
Cc: Gang Wei <>
Cc: Wang Jian J <>
Cc: Liming Gao <>
Cc: Sean Brogan <>
Cc: Michael Turner <>
Cc: Bret Barkelew <>
Reviewed-by: Jian J Wang <>

index 1350000..6183bb0 100644 (file)
@@ -2200,6 +2200,41 @@ X509GetCommonName (
   IN OUT  UINTN        *CommonNameSize\r
+  Retrieve the organization name (O) string from one X.509 certificate.\r
+  @param[in]      Cert             Pointer to the DER-encoded X509 certificate.\r
+  @param[in]      CertSize         Size of the X509 certificate in bytes.\r
+  @param[out]     NameBuffer       Buffer to contain the retrieved certificate organization\r
+                                   name string. At most NameBufferSize bytes will be\r
+                                   written and the string will be null terminated. May be\r
+                                   NULL in order to determine the size buffer needed.\r
+  @param[in,out]  NameBufferSize   The size in bytes of the Name buffer on input,\r
+                                   and the size of buffer returned Name on output.\r
+                                   If NameBuffer is NULL then the amount of space needed\r
+                                   in buffer (including the final null) is returned.\r
+  @retval RETURN_SUCCESS           The certificate Organization Name retrieved successfully.\r
+                                   If NameBufferSize is NULL.\r
+                                   If NameBuffer is not NULL and *CommonNameSize is 0.\r
+                                   If Certificate is invalid.\r
+  @retval RETURN_NOT_FOUND         If no Organization Name entry exists.\r
+  @retval RETURN_BUFFER_TOO_SMALL  If the NameBuffer is NULL. The required buffer size\r
+                                   (including the final null) is returned in the\r
+                                   CommonNameSize parameter.\r
+  @retval RETURN_UNSUPPORTED       The operation is not supported.\r
+X509GetOrganizationName (\r
+  IN      CONST UINT8   *Cert,\r
+  IN      UINTN         CertSize,\r
+  OUT     CHAR8         *NameBuffer,  OPTIONAL\r
+  IN OUT  UINTN         *NameBufferSize\r
+  );\r
   Verify one X509 certificate was issued by the trusted CA.\r