McheckEmail
Bun

method

crypto.X509Certificate.checkEmail

email: string,
options?: Pick<X509CheckOptions, 'subject'>
): undefined | string;

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.

@returns

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