Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@happy-gastro/csr-generator

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@happy-gastro/csr-generator

Generate CSR with HTTP request on every platform withouut OpenSSL or other dependecies

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

CSR and Key Generator

This package provides a simple and straightforward way to generate Certificate Signing Requests (CSRs) and keys using HTTP SSL service so you don't need OpenSSL installed. It utilizes the csrgenerator.com service to facilitate the generation process.

Installation

npm install @happy-gastro/csr-key-generator

Usage

To use this package, import the generateCSRAndKey function and call it with optional parameters:

import { generateCSRAndKey } from '@happy-gastro/csr-key-generator';

// Example usage:
generateCSRAndKey('HU', 'happygastro.hu', '', 'Software development', 'Happy Gastro Kft.', 'Pest megye', 'Hungary', '')
    .then((result) => {
        console.log('Generated CSR:', result.certificateRequest);
        console.log('Generated Key:', result.privateKey);
    })
    .catch((error) => {
        console.error('Error generating CSR and key:', error);
    });

API Documentation

generateCSRAndKey(C: string, CN: string, subject: string, OU: string, O: string, L: string, ST: string, SC: string): Promise<object>


Here are the fields you can fill with your own parameters:


C: The Country field of CSR.
CN: The Common name field of CSR.
subject: (Optional) Subject Alt names.
OU: Organizational Unit field of CSR.
O: Organization field of CSR.
L: Locality field of CSR.
ST: State field of CSR.
SC: SC field of CSR.

Returns a Promise that resolves with an object containing the generated CSR (certificateRequest), key (privateKey), and the full string response (string) from the generation service.

Example

import { generateCSRAndKey } from '@happy-gastro/csr-key-generator';

// Example usage:
generateCSRAndKey('HU', 'happygastro.hu', '', 'Software development', 'Happy Gastro Kft.', 'Pest megye', 'Hungary', '')
    .then((result) => {
        console.log('Generated CSR:', result.certificateRequest);
        console.log('Generated Key:', result.privateKey);
    })
    .catch((error) => {
        console.error('Error generating CSR and key:', error);
    });

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author

This project is developed and maintained by Farkas Ferenc.

  • Name: Farkas Ferenc
  • Email: ferenc.farkas@happygastro.hu
  • Website: www.happygastro.hu

Company

Happy Gastro Ltd.

License

MIT

Keywords

FAQs

Package last updated on 16 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc