Skip to content

Commit

Permalink
Remove thumbprints if not present in original for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahParks committed Jan 4, 2024
1 parent b7c3a1f commit d588160
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ func (j JWK) Validate() error {
return fmt.Errorf("failed to marshal JSON Web Key: %w", errors.Join(ErrJWKValidation, err))
}

if j.marshal.X5T == "" {
marshalled.X5T = ""
}
if j.marshal.X5TS256 == "" {
marshalled.X5TS256 = ""
}

ok := reflect.DeepEqual(j.marshal, marshalled)
if !ok {
return fmt.Errorf("%w: marshaled JWK does not match original JWK", ErrJWKValidation)
Expand Down

0 comments on commit d588160

Please sign in to comment.