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

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/fyrchik/split-info-format
Leonard Lyubich 2022-04-19 10:27:27 +03:00 committed by LeL
parent 2f9cc50fec
commit bcbffd516a
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package neofscrypto
import (
"fmt"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
// 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)
)
// String implements fmt.Stringer.
func (x Scheme) String() string {
return refs.SignatureScheme(x).String()
}
// maps Scheme to blank PublicKey constructor.
var publicKeys = make(map[Scheme]func() PublicKey)