Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
carterharrison authored Feb 2, 2019
1 parent 222508f commit a307ce1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,14 @@ val data = byteArrayOf(0x13, 0x37)
val keyPair = EcKeyGenerator.newInstance(Secp256k1)
val signature = EcSign.signData(keyPair, data, EcSha256)
```

## Verifying
After creating a signature, you can verify that the public key signed the data.

```kotlin
// verifies that the public key signed the data
val publicKey = EcPoint(...)
val signature = EcSignature(...)
val data = byteArrayOf(0x13, 0x37)
val isValid = EcSign.verifySignature(publicKey, data, EcSha256, signature)
```

0 comments on commit a307ce1

Please sign in to comment.