From bcbffd516a424b5b9af23f1727c343e873b46c74 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 19 Apr 2022 10:27:27 +0300 Subject: [PATCH] [#190] crypto: Provide `fmt.Stringer` of the `Scheme` type Signed-off-by: Leonard Lyubich --- crypto/signer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/signer.go b/crypto/signer.go index 1972274..994ad86 100644 --- a/crypto/signer.go +++ b/crypto/signer.go @@ -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)