[#190] crypto: Provide fmt.Stringer of the Scheme type

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-04-19 10:27:27 +03:00 committed by LeL
parent 2f9cc50fec
commit bcbffd516a

View file

@ -2,6 +2,8 @@ package neofscrypto
import ( import (
"fmt" "fmt"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
) )
// Scheme represents digital signature algorithm with fixed cryptographic hash function. // Scheme represents digital signature algorithm with fixed cryptographic hash function.
@ -17,6 +19,11 @@ const (
ECDSA_DETERMINISTIC_SHA256 // Deterministic ECDSA with SHA-256 hashing (RFC 6979) ECDSA_DETERMINISTIC_SHA256 // Deterministic ECDSA with SHA-256 hashing (RFC 6979)
) )
// String implements fmt.Stringer.
func (x Scheme) String() string {
return refs.SignatureScheme(x).String()
}
// maps Scheme to blank PublicKey constructor. // maps Scheme to blank PublicKey constructor.
var publicKeys = make(map[Scheme]func() PublicKey) var publicKeys = make(map[Scheme]func() PublicKey)