Skip to content

Conversation

@kentakayama
Copy link

"PrivateKey" => "PublicKey" because this error can be returned from validate(KeyOpVerify) here:

go-cose/key.go

Lines 657 to 660 in 022cb54

func (k *Key) PublicKey() (crypto.PublicKey, error) {
if err := k.validate(KeyOpVerify); err != nil {
return nil, err
}

go-cose/key.go

Lines 433 to 441 in 022cb54

func (k Key) validate(op KeyOp) error {
switch k.Type {
case KeyTypeEC2:
crv, x, y, d := k.EC2()
switch op {
case KeyOpVerify:
if len(x) == 0 || len(y) == 0 {
return ErrEC2NoPub
}

Copy link
Contributor

@yogeshbdeshpande yogeshbdeshpande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks for the change!

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.33%. Comparing base (58542e2) to head (039380d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   91.23%   92.33%   +1.10%     
==========================================
  Files          13       13              
  Lines        2133     1723     -410     
==========================================
- Hits         1946     1591     -355     
+ Misses        128       73      -55     
  Partials       59       59              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants