# Module: crypto/public_key/elliptic/ecdsa

Implementation of ECDSA following RFC6637 for Openpgpjs

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

### Methods

#### (async, static) sign(oid, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{r: Uint8Array, s: Uint8Array}>}

Sign a message using the provided key

##### Parameters:

Name | Type | Description
--- | --- | ---
`oid` | module:type/oid | Elliptic curve object identifier
`hashAlgo` | module:enums.hash | Hash algorithm used to sign
`message` | Uint8Array | Message to sign
`publicKey` | Uint8Array | Public key
`privateKey` | Uint8Array | Private key used to sign the message
`hashed` | Uint8Array | The hashed message

Source:
  - crypto/public_key/elliptic/ecdsa.js, line 46

##### Returns:

Signature of the message

Type
  Promise.<{r: Uint8Array, s: Uint8Array}>

#### (async, static) validateParams(oid, Q, d) → {Promise.<Boolean>}

Validate ECDSA parameters

##### Parameters:

Name | Type | Description
--- | --- | ---
`oid` | module:type/oid | Elliptic curve object identifier
`Q` | Uint8Array | ECDSA public point
`d` | Uint8Array | ECDSA secret scalar

Source:
  - crypto/public_key/elliptic/ecdsa.js, line 142

##### Returns:

Whether params are valid.

Type
  Promise.<Boolean>

#### (async, static) verify(oid, hashAlgo, signature, message, publicKey, hashed) → {Boolean}

Verifies if a signature is valid for a message

##### Parameters:

Name | Type | Description
--- | --- | ---
`oid` | module:type/oid | Elliptic curve object identifier
`hashAlgo` | module:enums.hash | Hash algorithm used in the signature
`signature` | Object | Signature to verify
`message` | Uint8Array | Message to verify
`publicKey` | Uint8Array | Public key used to verify the message
`hashed` | Uint8Array | The hashed message

Source:
  - crypto/public_key/elliptic/ecdsa.js, line 92

##### Returns:

Type
  Boolean

#### (async, inner) jsVerify()

Fallback javascript implementation of ECDSA verification. To be used if no native implementation is available for the given curve/operation.

Source:
  - crypto/public_key/elliptic/ecdsa.js, line 180