x509.checkEmail(email[, options])


  • email <string>
  • options <Object>
    • subject <string> 'default''always''never'默认值: 'always'
    • wildcards <boolean> 默认值: true
    • partialWildcards <boolean> 默认值: true
    • multiLabelWildcards <boolean> 默认值: false
    • singleLabelSubdomains <boolean> 默认值: false
  • 返回: <string> | <undefined> 如果证书匹配,则返回 email,如果不匹配,则返回 undefined

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

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

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

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

Checks whether the certificate matches the given email address.

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 '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 'never', the certificate subject is never considered, even if the certificate contains no subject alternative names.