types

package
v0.0.0-...-b7ec496 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const Plugin_Type_CosmosG_Id = "urn:network.regen.keystone.plugins:cosmosg"
View Source
const Plugin_Type_File_Id = "urn:network.regen.keystone.plugins:file"
View Source
const Plugin_Type_Pkcs11_Id = "urn:network.regen.keystone.plugins:pkcs11"

Variables

This section is empty.

Functions

func IsSNormalized

func IsSNormalized(sigS *big.Int, order *big.Int) bool

isSNormalized returns true for the integer sigS if sigS falls in lower half of the curve order It is expected that the caller passes the curve order as a big Int along with the s portion of the signature.

func NormalizeS

func NormalizeS(sigS *big.Int, curve elliptic.Curve) *big.Int

NormalizeS will invert the s value if not already in the lower half of curve order value by subtracting it from the curve order (N)

func SignatureRaw

func SignatureRaw(r *big.Int, s *big.Int) []byte

signatureRaw takes two big integers and returns a byte value that is the result of concatenating the byte values of each of the given integers. The byte values are left-padded with zeroes

Types

type DsaSignature

type DsaSignature struct {
	R, S *big.Int
}

dsaSignature contains the two integers needed for an ECDSA signature value. They must be put in a struct to allow the asn1 unmarshalling which uses an interface{} type to return the values, instead of just returning the two integers.

func UnmarshalDER

func UnmarshalDER(sigDER []byte) (*DsaSignature, error)

unmarshalDER takes a DER-encoded byte array, and dumps it into a (hopefully-appropriate) struct. If the struct given, is not appropriate for the data, then unmarshalling will fail.

type Options

type Options struct {
	ConfigPath string
}

Options struct contains anything that is needed for configuring a plugin with one element initially, a path to a configuration, which can be interpreted differently by an individual plugin

type Plugin

type Plugin interface {
	NewKey(in *pb.KeySpec) (*pb.KeyRef, error)
	PubKey(in *pb.KeySpec) (*pb.PublicKey, error)
	Sign(in *pb.Msg) (*pb.Signed, error)
}

Plugin interface specifies the methods required for implementation by a plugin

Directories

Path Synopsis
cosmosg module
file module
pkcs11 module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL