pje_info_certificado
Retrieve and display configured certificate details for accessing judicial data in the Brazilian PJE system via the PJE MCP Server.
Instructions
Mostra informações sobre o certificado configurado
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:671-732 (handler)Main handler function for 'pje_info_certificado' tool. Retrieves certificate info from PJEClient and formats a detailed text response including subject, issuer, technical details, and validity status.private async infoCertificado() { try { if (!this.pjeClient || !(this.pjeClient as any).certificateManager) { return { content: [ { type: "text", text: `❌ **Nenhum Certificado Configurado**\n\nExecute 'pje_configurar_certificado' primeiro para carregar um certificado digital.`, }, ], }; } const info = this.pjeClient.getCertificateInfo(); let texto = `🎯 **Informações do Certificado Digital Atual**\n\n`; texto += `**Subject:**\n`; info.subject.forEach((attr: any) => { texto += `- ${attr.name}: ${attr.value}\n`; }); texto += `\n**Emissor:**\n`; info.issuer.forEach((attr: any) => { texto += `- ${attr.name}: ${attr.value}\n`; }); texto += `\n**Detalhes Técnicos:**\n`; texto += `- Serial Number: ${info.serialNumber}\n`; texto += `- Thumbprint: ${info.thumbprint}\n`; texto += `- Válido de: ${new Date(info.notBefore).toLocaleString('pt-BR')}\n`; texto += `- Válido até: ${new Date(info.notAfter).toLocaleString('pt-BR')}\n`; const agora = new Date(); const validade = new Date(info.notAfter); if (agora > validade) { texto += `\n⚠️ **AVISO: Certificado EXPIRADO!**\n`; } else { const diasRestantes = Math.floor((validade.getTime() - agora.getTime()) / (1000 * 60 * 60 * 24)); texto += `\n✅ **Certificado válido por mais ${diasRestantes} dias**\n`; } return { content: [ { type: "text", text: texto, }, ], }; } catch (error) { return { content: [ { type: "text", text: `❌ **Erro ao Obter Informações do Certificado**\n\n${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
- src/index.ts:314-321 (schema)Schema definition for the 'pje_info_certificado' tool, specifying empty input properties as no arguments are required.{ name: "pje_info_certificado", description: "Mostra informações sobre o certificado configurado", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:352-353 (registration)Registration of the tool handler in the switch statement within CallToolRequestSchema handler.case "pje_info_certificado": return await this.infoCertificado();
- src/index.ts:125-130 (helper)Helper method in PJEClient class that delegates to CertificateManager's getCertificateInfo() to retrieve certificate information.getCertificateInfo(): any { if (!this.certificateManager) { throw new Error("Nenhum certificado configurado"); } return this.certificateManager.getCertificateInfo(); }
- src/certificate-manager.ts:118-125 (helper)Low-level helper in CertificateManager that provides basic certificate configuration details like thumbprint and provider.getCertificateInfo(): any { return { thumbprint: this.config.certificateThumbprint, path: this.config.certificatePath, hasPassword: !!this.config.certificatePassword, provider: 'SafeSign IC Standard Windows Cryptographic Service Provider' }; }