UNPKG

@lark-project/cli

Version:

飞书项目插件开发工具

16 lines (15 loc) 549 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidCert = exports.readCertFromCertStr = void 0; const crypto_1 = require("crypto"); function readCertFromCertStr(cert) { return new crypto_1.X509Certificate(cert); } exports.readCertFromCertStr = readCertFromCertStr; const isValidCert = (cert) => { const now = new Date(); const notBefore = new Date(cert.validFrom); const notAfter = new Date(cert.validTo); return now >= notBefore && now <= notAfter; }; exports.isValidCert = isValidCert;