x509.checkEmail(email[, options])


  • email <string>

  • options <Object>

    • subject <string> 'default''always''never'。默认值:'always'

      ¥subject <string> 'default', 'always', or 'never'. Default: 'always'.

    • wildcards <boolean> 默认值:true

      ¥wildcards <boolean> Default: true.

    • partialWildcards <boolean> 默认值:true

      ¥partialWildcards <boolean> Default: true.

    • multiLabelWildcards <boolean> 默认值:false

      ¥multiLabelWildcards <boolean> Default: false.

    • singleLabelSubdomains <boolean> 默认值:false

      ¥singleLabelSubdomains <boolean> Default: false.

  • 返回:<string> | <undefined> 如果证书匹配,则返回 email,如果不匹配,则返回 undefined

    ¥Returns: <string> | <undefined> Returns email if the certificate matches, undefined if it does not.

检查证书是否与给定的电子邮件地址匹配。

¥Checks whether the certificate matches the given email address.

如果 'subject' 选项设置为 'always',并且如果主题备用名称扩展不存在或不包含匹配的电子邮件地址,则考虑证书主题。

¥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.

如果 'subject' 选项设置为 'default',则仅当主题备用名称扩展不存在或不包含任何电子邮件地址时才考虑证书主题。

¥If the 'subject' option is 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.

如果 'subject' 选项设置为 'never',则从不考虑证书主题,即使证书不包含主题替代名称。

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