# Class: GenericS2K

## type/s2k~GenericS2K(configopt)

#### new GenericS2K(configopt)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - type/s2k/generic.js, line 40

### Members

#### algorithm :module:enums.hash|0

Hash function identifier, or 0 for gnu-dummy keys

##### Type:

- module:enums.hash | 0

Source:
  - type/s2k/generic.js, line 45

#### c :Integer

##### Type:

- Integer

Source:
  - type/s2k/generic.js, line 52

#### salt :Uint8Array

Eight bytes of salt in a binary string.

##### Type:

- Uint8Array

Source:
  - type/s2k/generic.js, line 56

#### type :String

enums.s2k identifier or 'gnu-dummy'

##### Type:

- String

Source:
  - type/s2k/generic.js, line 50

### Methods

#### (async) produceKey(passphrase) → {Promise.<Uint8Array>}

Produces a key using the specified passphrase and the defined hashAlgorithm

##### Parameters:

Name | Type | Description
--- | --- | ---
`passphrase` | String | Passphrase containing user input

Source:
  - type/s2k/generic.js, line 159

##### Returns:

Produced key with a length corresponding to. hashAlgorithm hash length

Type
  Promise.<Uint8Array>

#### read(bytes) → {Integer}

Parsing function for a string-to-key specifier (RFC 4880 3.7).

##### Parameters:

Name | Type | Description
--- | --- | ---
`bytes` | Uint8Array | Payload of string-to-key specifier

Source:
  - type/s2k/generic.js, line 79

##### Returns:

Actual length of the object.

Type
  Integer

#### write() → {Uint8Array}

Serializes s2k information

Source:
  - type/s2k/generic.js, line 126

##### Returns:

Binary representation of s2k.

Type
  Uint8Array