Documentation ¶
Index ¶
- Variables
- func MarshalPKCS8PrivateKey(key interface{}) ([]byte, error)
- func NamedCurve(name string) elliptic.Curve
- func ParsePKIXPublicKey(derBytes []byte) (pub any, err error)
- func PublicKeySuitableForTezos(pub crypto.PublicKey) bool
- func S256() elliptic.Curve
- func Verify(pub crypto.PublicKey, hash []byte, sig Signature) error
- type ECDSASignature
- type ED25519Signature
- type PrivateKey
- type Signature
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSignature error returned by Verify if signature is invalid ErrSignature = errors.New("invalid signature") )
Functions ¶
func MarshalPKCS8PrivateKey ¶
MarshalPKCS8PrivateKey converts a private key to PKCS#8, ASN.1 DER form.
func NamedCurve ¶
NamedCurve returns curve by its standard name or nil
func ParsePKIXPublicKey ¶
func PublicKeySuitableForTezos ¶
PublicKeySuitable returns true if the key is Tezos compatible
Types ¶
type ECDSASignature ¶
ECDSASignature is a type representing an ecdsa signature.
func CanonizeECDSASignature ¶
func CanonizeECDSASignature(sig *ECDSASignature) *ECDSASignature
CanonizeECDSASignature returns the canonical versions of the signature the canonical version enforce low S values if S is above order / 2 it negating the S (modulo the order (N))
func (*ECDSASignature) String ¶
func (e *ECDSASignature) String() string
type ED25519Signature ¶
type ED25519Signature []byte
ED25519Signature is a type representing an Ed25519 signature
func (ED25519Signature) String ¶
func (e ED25519Signature) String() string
type PrivateKey ¶
PrivateKey is implemented by private key types
type Signature ¶
type Signature interface {
String() string
}
Signature is a type representing a digital signature.
func CanonizeSignature ¶
CanonizeSignature returns the canonical versions of the ECDSA signature if one is given