Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Binary

Binary: TypedArray | DataView

BinaryLike

BinaryLike: string | Binary

CipherCCMTypes

CipherCCMTypes: "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm"

CipherGCMTypes

CipherGCMTypes: "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"

CipherKey

CipherKey: BinaryLike | KeyObject

ECDHKeyFormat

ECDHKeyFormat: "compressed" | "uncompressed" | "hybrid"

HexBase64BinaryEncoding

HexBase64BinaryEncoding: "binary" | "base64" | "hex"

HexBase64Latin1Encoding

HexBase64Latin1Encoding: "latin1" | "hex" | "base64"

KeyFormat

KeyFormat: "pem" | "der"

KeyLike

KeyLike: string | Buffer | KeyObject

KeyObjectType

KeyObjectType: "secret" | "public" | "private"

KeyType

KeyType: "rsa" | "dsa" | "ec"

Utf8AsciiBinaryEncoding

Utf8AsciiBinaryEncoding: "utf8" | "ascii" | "binary"

Utf8AsciiLatin1Encoding

Utf8AsciiLatin1Encoding: "utf8" | "ascii" | "latin1"

Variables

Const Certificate

Certificate: object

Type declaration

Const DEFAULT_ENCODING

DEFAULT_ENCODING: string
deprecated

since v10.0.0

Const fips

fips: boolean
deprecated

since v10.0.0

Functions

createCipher

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    Returns CipherCCM

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    Returns CipherGCM

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    • algorithm: string
    • password: BinaryLike
    • Optional options: stream.TransformOptions

    Returns Cipher

createCipheriv

createDecipher

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    Returns DecipherCCM

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    Returns DecipherGCM

  • deprecated

    since v10.0.0 use createCipheriv()

    Parameters

    • algorithm: string
    • password: BinaryLike
    • Optional options: stream.TransformOptions

    Returns Decipher

createDecipheriv

createDiffieHellman

createECDH

  • createECDH(curve_name: string): ECDH
  • Parameters

    • curve_name: string

    Returns ECDH

createHash

  • createHash(algorithm: string, options?: stream.TransformOptions): Hash
  • Parameters

    • algorithm: string
    • Optional options: stream.TransformOptions

    Returns Hash

createHmac

  • createHmac(algorithm: string, key: BinaryLike, options?: stream.TransformOptions): Hmac
  • Parameters

    • algorithm: string
    • key: BinaryLike
    • Optional options: stream.TransformOptions

    Returns Hmac

createPrivateKey

  • Parameters

    Returns KeyObject

createPublicKey

createSecretKey

  • Parameters

    • key: Buffer

    Returns KeyObject

createSign

  • createSign(algorithm: string, options?: stream.WritableOptions): Signer
  • Parameters

    • algorithm: string
    • Optional options: stream.WritableOptions

    Returns Signer

createVerify

  • createVerify(algorithm: string, options?: stream.WritableOptions): Verify
  • Parameters

    • algorithm: string
    • Optional options: stream.WritableOptions

    Returns Verify

generateKeyPairSync

getCiphers

  • getCiphers(): string[]
  • Returns string[]

getCurves

  • getCurves(): string[]
  • Returns string[]

getDiffieHellman

  • Parameters

    • group_name: string

    Returns DiffieHellman

getHashes

  • getHashes(): string[]
  • Returns string[]

pbkdf2

  • pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: function): void
  • Parameters

    • password: BinaryLike
    • salt: BinaryLike
    • iterations: number
    • keylen: number
    • digest: string
    • callback: function
        • (err: Error | null, derivedKey: Buffer): any
        • Parameters

          • err: Error | null
          • derivedKey: Buffer

          Returns any

    Returns void

pbkdf2Sync

  • pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer
  • Parameters

    Returns Buffer

privateDecrypt

  • Parameters

    Returns Buffer

privateEncrypt

  • Parameters

    Returns Buffer

pseudoRandomBytes

  • pseudoRandomBytes(size: number): Buffer
  • pseudoRandomBytes(size: number, callback: function): void
  • Parameters

    • size: number

    Returns Buffer

  • Parameters

    • size: number
    • callback: function
        • (err: Error | null, buf: Buffer): void
        • Parameters

          • err: Error | null
          • buf: Buffer

          Returns void

    Returns void

publicDecrypt

  • Parameters

    Returns Buffer

publicEncrypt

  • Parameters

    Returns Buffer

randomBytes

  • randomBytes(size: number): Buffer
  • randomBytes(size: number, callback: function): void
  • Parameters

    • size: number

    Returns Buffer

  • Parameters

    • size: number
    • callback: function
        • (err: Error | null, buf: Buffer): void
        • Parameters

          • err: Error | null
          • buf: Buffer

          Returns void

    Returns void

randomFill

  • randomFill<T>(buffer: T, callback: function): void
  • randomFill<T>(buffer: T, offset: number, callback: function): void
  • randomFill<T>(buffer: T, offset: number, size: number, callback: function): void
  • Type parameters

    Parameters

    • buffer: T
    • callback: function
        • (err: Error | null, buf: T): void
        • Parameters

          • err: Error | null
          • buf: T

          Returns void

    Returns void

  • Type parameters

    Parameters

    • buffer: T
    • offset: number
    • callback: function
        • (err: Error | null, buf: T): void
        • Parameters

          • err: Error | null
          • buf: T

          Returns void

    Returns void

  • Type parameters

    Parameters

    • buffer: T
    • offset: number
    • size: number
    • callback: function
        • (err: Error | null, buf: T): void
        • Parameters

          • err: Error | null
          • buf: T

          Returns void

    Returns void

randomFillSync

  • randomFillSync<T>(buffer: T, offset?: undefined | number, size?: undefined | number): T
  • Type parameters

    Parameters

    • buffer: T
    • Optional offset: undefined | number
    • Optional size: undefined | number

    Returns T

scrypt

  • Parameters

    • password: BinaryLike
    • salt: BinaryLike
    • keylen: number
    • callback: function
        • (err: Error | null, derivedKey: Buffer): void
        • Parameters

          • err: Error | null
          • derivedKey: Buffer

          Returns void

    Returns void

  • Parameters

    • password: BinaryLike
    • salt: BinaryLike
    • keylen: number
    • options: ScryptOptions
    • callback: function
        • (err: Error | null, derivedKey: Buffer): void
        • Parameters

          • err: Error | null
          • derivedKey: Buffer

          Returns void

    Returns void

scryptSync

sign

  • Calculates and returns the signature for data using the given private key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type (especially Ed25519 and Ed448).

    If key is not a [KeyObject][], this function behaves as if key had been passed to [crypto.createPrivateKey()][].

    Parameters

    Returns Buffer

timingSafeEqual

  • Parameters

    Returns boolean

verify

  • Calculates and returns the signature for data using the given private key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type (especially Ed25519 and Ed448).

    If key is not a [KeyObject][], this function behaves as if key had been passed to [crypto.createPublicKey()][].

    Parameters

    Returns Buffer

Generated using TypeDoc