@@ -3372,6 +3372,103 @@ int wc_GetSubjectPubKeyInfoDerFromCert(const byte* certDer,
33723372 byte * pubKeyDer ,
33733373 word32 * pubKeyDerSz );
33743374
3375+ /*!
3376+ \ingroup ASN
3377+
3378+ \brief Retrieves the subject name from a decoded certificate.
3379+
3380+ This function copies the subject name string from a DecodedCert
3381+ structure into the provided buffer. The string uses a one-line
3382+ distinguished name format with "/" delimiters
3383+ (e.g. "/C=US/O=Org/CN=example.com"). The output is NOT
3384+ NUL-terminated; the caller should append a NUL byte if needed.
3385+ If buf is NULL, the required buffer size is returned
3386+ in bufSz and LENGTH_ONLY_E is returned.
3387+
3388+ \param cert Pointer to the DecodedCert (must have been parsed).
3389+ \param buf Output buffer to receive the subject name string,
3390+ or NULL to query the required size.
3391+ \param bufSz Pointer to the buffer size. On input, the available
3392+ buffer size. On output, the number of bytes written
3393+ (excluding any NUL terminator) or the required size
3394+ if buf is NULL.
3395+
3396+ \return 0 on success.
3397+ \return LENGTH_ONLY_E when buf is NULL (bufSz contains required size).
3398+ \return BAD_FUNC_ARG if cert or bufSz is NULL.
3399+ \return BUFFER_E if the provided buffer is too small.
3400+
3401+ \sa wc_GetDecodedCertIssuer
3402+ \sa wc_GetDecodedCertSerial
3403+ \sa wc_InitDecodedCert
3404+ \sa wc_ParseCert
3405+ */
3406+ int wc_GetDecodedCertSubject (const struct DecodedCert * cert ,
3407+ char * buf , word32 * bufSz );
3408+
3409+ /*!
3410+ \ingroup ASN
3411+
3412+ \brief Retrieves the issuer name from a decoded certificate.
3413+
3414+ This function copies the issuer name string from a DecodedCert
3415+ structure into the provided buffer. The string uses a one-line
3416+ distinguished name format with "/" delimiters
3417+ (e.g. "/C=US/O=Org/CN=example.com"). The output is NOT
3418+ NUL-terminated; the caller should append a NUL byte if needed.
3419+ If buf is NULL, the required buffer size is returned
3420+ in bufSz and LENGTH_ONLY_E is returned.
3421+
3422+ \param cert Pointer to the DecodedCert (must have been parsed).
3423+ \param buf Output buffer to receive the issuer name string,
3424+ or NULL to query the required size.
3425+ \param bufSz Pointer to the buffer size. On input, the available
3426+ buffer size. On output, the number of bytes written
3427+ (excluding any NUL terminator) or the required size
3428+ if buf is NULL.
3429+
3430+ \return 0 on success.
3431+ \return LENGTH_ONLY_E when buf is NULL (bufSz contains required size).
3432+ \return BAD_FUNC_ARG if cert or bufSz is NULL.
3433+ \return BUFFER_E if the provided buffer is too small.
3434+
3435+ \sa wc_GetDecodedCertSubject
3436+ \sa wc_GetDecodedCertSerial
3437+ \sa wc_InitDecodedCert
3438+ \sa wc_ParseCert
3439+ */
3440+ int wc_GetDecodedCertIssuer (const struct DecodedCert * cert ,
3441+ char * buf , word32 * bufSz );
3442+
3443+ /*!
3444+ \ingroup ASN
3445+
3446+ \brief Retrieves the serial number from a decoded certificate.
3447+
3448+ This function copies the serial number bytes from a DecodedCert
3449+ structure into the provided buffer. If buf is NULL, the required
3450+ buffer size is returned in bufSz and LENGTH_ONLY_E is returned.
3451+
3452+ \param cert Pointer to the DecodedCert (must have been parsed).
3453+ \param buf Output buffer to receive the serial number bytes,
3454+ or NULL to query the required size.
3455+ \param bufSz Pointer to the buffer size. On input, the available
3456+ buffer size. On output, the number of bytes written
3457+ or the required size if buf is NULL.
3458+
3459+ \return 0 on success.
3460+ \return LENGTH_ONLY_E when buf is NULL (bufSz contains required size).
3461+ \return BAD_FUNC_ARG if cert or bufSz is NULL.
3462+ \return BUFFER_E if the provided buffer is too small.
3463+
3464+ \sa wc_GetDecodedCertSubject
3465+ \sa wc_GetDecodedCertIssuer
3466+ \sa wc_InitDecodedCert
3467+ \sa wc_ParseCert
3468+ */
3469+ int wc_GetDecodedCertSerial (const struct DecodedCert * cert ,
3470+ byte * buf , word32 * bufSz );
3471+
33753472/*!
33763473 \ingroup ASN
33773474 \brief Extracts UUID from certificate.
0 commit comments