Skip to main content

checkEmail

method X509Certificate.prototype.checkEmail
Jump to headingX509Certificate.prototype.checkEmail(
email: string,
options?: Pick<X509CheckOptions, "subject">,
): string | undefined

Checks whether the certificate matches the given email address.

If the 'subject' option is undefined or set to 'default', the certificate subject is only considered if the subject alternative name extension either does not exist or does not contain any email addresses.

If the 'subject' option is set to 'always' and if the subject alternative name extension either does not exist or does not contain a matching email address, the certificate subject is considered.

If the 'subject' option is set to 'never', the certificate subject is never considered, even if the certificate contains no subject alternative names.

Parameters Jump to heading

Jump to headingemail: string
optional
Jump to headingoptions: Pick<X509CheckOptions, "subject">

Return Type Jump to heading

string | undefined

Returns email if the certificate matches, undefined if it does not.

Back to top