Skip to main content
Glama

Payware MCP Server

Official
by payware
rsa-keys.jsโ€ข2.11 kB
import forge from 'node-forge'; /** * Generate RSA key pair for payware API authentication * @param {number} keySize - RSA key size in bits (default: 2048) * @returns {Object} Object containing publicKey and privateKey in PEM format */ export function generateRSAKeyPair(keySize = 2048) { const keyPair = forge.pki.rsa.generateKeyPair({ bits: keySize }); const privateKeyPem = forge.pki.privateKeyToPem(keyPair.privateKey); const publicKeyPem = forge.pki.publicKeyToPem(keyPair.publicKey); return { privateKey: privateKeyPem, publicKey: publicKeyPem, keySize, generated: new Date().toISOString() }; } /** * Generate RSA keys tool implementation */ export const generateRSAKeysTool = { name: "payware_authentication_generate_rsa_keys", description: "Generate RSA key pair for payware API authentication", inputSchema: { type: "object", properties: { keySize: { type: "number", description: "RSA key size in bits", minimum: 2048, maximum: 8192 } }, additionalProperties: false }, async handler(args) { const keySize = args.keySize || 2048; if (keySize < 2048) { throw new Error("Key size must be at least 2048 bits for security"); } const keyPair = generateRSAKeyPair(keySize); return { content: [{ type: "text", text: `๐Ÿ” **RSA Key Pair Generated Successfully** **โš ๏ธ SECURITY WARNING โš ๏ธ** - Store private key securely and never share it - Use different keys for production environment - Sandbox keys should not be used in production **Private Key:** \`\`\` ${keyPair.privateKey} \`\`\` **Public Key:** \`\`\` ${keyPair.publicKey} \`\`\` **Key Details:** - Size: ${keyPair.keySize} bits - Generated: ${keyPair.generated} - Purpose: payware API authentication (sandbox only) **Next Steps:** 1. Save private key to secure location 2. Register public key with payware sandbox 3. Use private key to create JWT tokens` }] }; } };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/payware/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server