# Module: crypto/public_key/elliptic/curve

Wrapper of an instance of an Elliptic Curve

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 18

### Methods

#### (inner) getPreferredHashAlgo(oid) → {enums.hash}

Get preferred hash algo to use with the given curve

##### Parameters:

Name | Type | Description
--- | --- | ---
`oid` | module:type/oid | curve oid

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 212

##### Returns:

hash algorithm

Type
  enums.hash

#### (inner) jwkToRawPublic(jwk) → {Uint8Array}

##### Parameters:

Name | Type | Description
--- | --- | ---
`jwk` | JsonWebKey | key for conversion

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 321

##### Returns:

Raw public key.

Type
  Uint8Array

#### (inner) privateToJWK(payloadSize, name, publicKey, privateKey) → {JsonWebKey}

##### Parameters:

Name | Type | Description
--- | --- | ---
`payloadSize` | Integer | ec payload size
`name` | String | curve name
`publicKey` | Uint8Array | public key
`privateKey` | Uint8Array | private key

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 361

##### Returns:

Private key in jwk format.

Type
  JsonWebKey

#### (inner) rawPublicToJWK(payloadSize, name, publicKey) → {JsonWebKey}

##### Parameters:

Name | Type | Description
--- | --- | ---
`payloadSize` | Integer | ec payload size
`name` | String | curve name
`publicKey` | Uint8Array | public key

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 338

##### Returns:

Public key in jwk format.

Type
  JsonWebKey

#### (async, inner) validateStandardParams(algo, oid, Q, d) → {Promise.<Boolean>}

Validate ECDH and ECDSA parameters Not suitable for EdDSA (different secret key format)

##### Parameters:

Name | Type | Description
--- | --- | ---
`algo` | module:enums.publicKey | EC algorithm, to filter supported curves
`oid` | module:type/oid | EC object identifier
`Q` | Uint8Array | EC public point
`d` | Uint8Array | EC secret scalar

Source:
  - crypto/public_key/elliptic/oid_curves.js, line 226

##### Returns:

Whether params are valid.

Type
  Promise.<Boolean>