This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Merged
Conversation
a2761a0 to
1f7b023
Compare
Add tests
1f7b023 to
72f984a
Compare
|
|
||
| public getType(): KeyType { | ||
| return this.key.type; | ||
| } |
Contributor
There was a problem hiding this comment.
This is also an API change; I'd run this past Todd, but this is a change that 1) is an addition and 2) is not implementation specific. So I think I'm fine with it
Contributor
Author
There was a problem hiding this comment.
I've updated the initial PR description to note the API changes.
tbfleming
approved these changes
Dec 30, 2019
| /** Instantiate private key from an `elliptic`-format private key */ | ||
| public static fromElliptic(privKey: ec.KeyPair, keyType = KeyType.k1): PrivateKey { | ||
| const privArray = privKey.getPrivate().toArray(); | ||
| public static fromElliptic(privKey: ec.KeyPair, keyType: KeyType): PrivateKey { |
Contributor
There was a problem hiding this comment.
Note that removing the default from this argument makes this PR a breaking change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Adjusting the existing PrivateKey, PublicKey, Signature, and JsSignatureProvider to use p256 r1 format keys if optional arguments are provided, such as the r1 KeyType from numeric and elliptic constructed with p256. K1 format and secp256k1 are default if no ecurve/keyType are provided.
API Changes
PrivateKey.getType() => returns private variable this.key.type
PublicKey.getType() => returns private variable this.key.type
Signature.getType() => returns private variable this.signature.type
Documentation Additions