selfsigned

  • Version 3.0.1
  • Published
  • 26.1 kB
  • 1 dependency
  • MIT license

Install

npm i selfsigned
yarn add selfsigned
pnpm add selfsigned

Overview

Generate self signed certificates private and public keys

Index

Functions

function generate

generate: {
(attrs?: CertificateField[], opts?: SelfsignedOptions): GenerateResult;
(
attrs?: CertificateField[],
opts?: SelfsignedOptions,
done?: (err: Error, result: GenerateResult) => any
): void;
};

    Interfaces

    interface CertificateField

    interface CertificateField extends CertificateFieldOptions {}

      property extensions

      extensions?: any[] | undefined;

        property value

        value?: any[] | string | undefined;

          property valueConstructed

          valueConstructed?: boolean | undefined;

            property valueTagClass

            valueTagClass?: ASN1Class | undefined;

              interface CertificateFieldOptions

              interface CertificateFieldOptions {}

                property name

                name?: string | undefined;

                  property shortName

                  shortName?: string | undefined;

                    property type

                    type?: string | undefined;

                      interface GenerateResult

                      interface GenerateResult {}

                        property cert

                        cert: string;

                          property fingerprint

                          fingerprint: string;

                            property private

                            private: string;

                              property public

                              public: string;

                                interface SelfsignedOptions

                                interface SelfsignedOptions {}

                                  property algorithm

                                  algorithm?: string;
                                  • The signature algorithm sha256 or sha1 "sha1"

                                  property clientCertificate

                                  clientCertificate?: boolean;
                                  • generate client cert signed by the original key false

                                  property clientCertificateCN

                                  clientCertificateCN?: string;
                                  • client certificate's common name "John Doe jdoe123"

                                  property clientCertificateKeySize

                                  clientCertificateKeySize?: number;
                                  • the size for the client private key in bits 1024

                                  property days

                                  days?: number;
                                  • The number of days before expiration

                                    365

                                  property extensions

                                  extensions?: any[];
                                  • additional extensions for the certificate

                                  property keySize

                                  keySize?: number;
                                  • the size for the private key in bits 1024

                                  property notBeforeDate

                                  notBeforeDate?: Date;
                                  • The date before which the certificate should not be valid

                                    now

                                  property pkcs7

                                  pkcs7?: boolean;
                                  • include PKCS#7 as part of the output false

                                  Enums

                                  enum ASN1Class

                                  enum ASN1Class {
                                  UNIVERSAL = 0x00,
                                  APPLICATION = 0x40,
                                  CONTEXT_SPECIFIC = 0x80,
                                  PRIVATE = 0xc0,
                                  }

                                    member APPLICATION

                                    APPLICATION = 0x40

                                      member CONTEXT_SPECIFIC

                                      CONTEXT_SPECIFIC = 0x80

                                        member PRIVATE

                                        PRIVATE = 0xc0

                                          member UNIVERSAL

                                          UNIVERSAL = 0x00

                                            Package Files (1)

                                            Dependencies (1)

                                            Dev Dependencies (3)

                                            Peer Dependencies (0)

                                            No peer dependencies.

                                            Badge

                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/selfsigned.

                                            • Markdown
                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/selfsigned)
                                            • HTML
                                              <a href="https://www.jsdocs.io/package/selfsigned"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>