Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds fromPem method for identity-secp256k1 #816

Merged
merged 11 commits into from
Feb 21, 2024
Merged

Conversation

krpeacock
Copy link
Contributor

@krpeacock krpeacock commented Jan 3, 2024

Description

Adds a utility method to initialize a secp256k1 identity from a pem file.

Fixes SDK-1255
Fixes SDKTG-221

How Has This Been Tested?

Tested against a test identity exported from dfx and compatible with dfx and keysmith

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

Copy link
Contributor

github-actions bot commented Jan 3, 2024

size-limit report 📦

Path Size
@dfinity/agent 101.1 KB (0%)
@dfinity/candid 13.61 KB (0%)
@dfinity/principal 5.04 KB (0%)
@dfinity/auth-client 91.84 KB (0%)
@dfinity/assets 92.87 KB (0%)
@dfinity/identity 89.15 KB (0%)
@dfinity/identity-secp256k1 280.34 KB (+6.06% 🔺)

packages/identity-secp256k1/src/pem.ts Outdated Show resolved Hide resolved
packages/identity-secp256k1/src/pem.ts Show resolved Hide resolved
packages/identity-secp256k1/src/pem.ts Outdated Show resolved Hide resolved
packages/identity-secp256k1/src/pem.ts Outdated Show resolved Hide resolved
@krpeacock
Copy link
Contributor Author

@randombit got back to this today - should be more legible now. Thanks for your suggestions!

@krpeacock krpeacock marked this pull request as ready for review February 16, 2024 23:07
@krpeacock krpeacock requested a review from a team as a code owner February 16, 2024 23:07
docs/generated/changelog.html Outdated Show resolved Hide resolved
@krpeacock krpeacock enabled auto-merge (squash) February 21, 2024 18:51
@krpeacock krpeacock merged commit e04e3c6 into main Feb 21, 2024
15 checks passed
@krpeacock krpeacock deleted the kai/SDK-1255-from-pem branch February 21, 2024 18:57
@randombit
Copy link

LGTM

hpeebles pushed a commit to hpeebles/agent-js that referenced this pull request Mar 28, 2024
* feat: adds pemToSecretKey

* feat: adds `fromPem` method for `identity-secp256k1`

* wip

* feat: check for ASN.1 OID before returning private key

* rebuilding package-lock

* increasing size limit

* Update docs/generated/changelog.html

* Update docs/generated/changelog.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants