Skip to content

Commit

Permalink
Register ECDSA parser and serializer for ECDSA keys
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 681398867
Change-Id: I34897dd65bbe91a13bc1d1c45a26ebd36adbcccf
  • Loading branch information
morambro authored and copybara-github committed Oct 2, 2024
1 parent fd77cbc commit 09b081f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions signature/ecdsa/ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"

"github.com/tink-crypto/tink-go/v2/core/registry"
"github.com/tink-crypto/tink-go/v2/internal/protoserialization"
)

func init() {
Expand All @@ -29,4 +30,16 @@ func init() {
if err := registry.RegisterKeyManager(new(verifierKeyManager)); err != nil {
panic(fmt.Sprintf("ecdsa.init() failed: %v", err))
}
if err := protoserialization.RegisterKeySerializer[*PublicKey](&publicKeySerializer{}); err != nil {
panic(fmt.Sprintf("ecdsa.init() failed: %v", err))
}
if err := protoserialization.RegisterKeyParser(verifierTypeURL, &publicKeyParser{}); err != nil {
panic(fmt.Sprintf("ecdsa.init() failed: %v", err))
}
if err := protoserialization.RegisterKeySerializer[*PrivateKey](&privateKeySerializer{}); err != nil {
panic(fmt.Sprintf("ecdsa.init() failed: %v", err))
}
if err := protoserialization.RegisterKeyParser(signerTypeURL, &privateKeyParser{}); err != nil {
panic(fmt.Sprintf("ecdsa.init() failed: %v", err))
}
}

0 comments on commit 09b081f

Please sign in to comment.