Documentation ¶
Overview ¶
Package signing defines the various signing Algorithms supported by the gormcrypto package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAlgo ¶
RegisterAlgo adds an Algorithm to the internal algos map so it can be used in YAML configs
func SupportedAlgos ¶
func SupportedAlgos() []string
SupportedAlgos returns a list of registered Algorithms that can be used in YAML configs
Types ¶
type Algorithm ¶
type Algorithm interface { // Name identifies the Algorithm as a string for exporting configurations Name() string // Config converts an Algorthim's internal configuration into a map for export Config() map[string]interface{} // Sign generates a signature for the provided data that can be used to verify whether that data has been altered. Sign([]byte) ([]byte, error) // Verify checks whether a given piece of data has been altered since it was signed. Verify([]byte, []byte) (bool, error) }
Algorithm defines an interface that signing types must implement to be usable with gormcrypto. A type implementing signing.Algorithm will supplement a value's' serialized representation with a cryptographic signature, or verify the same. The types implemented here wrap the Go standard (and extended) library's various (non-deprecated) crypto packages.
type ECDSA ¶
type ECDSA struct { Algorithm // contains filtered or unexported fields }
ECDSA supports ECDSA
func NewECDSA ¶
func NewECDSA(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) *ECDSA
NewECDSA creates a new ECDSA value
type ED25519 ¶
type ED25519 struct { Algorithm // contains filtered or unexported fields }
ED25519 supports ED25519
func NewED25519 ¶
func NewED25519(privateKey *ed25519.PrivateKey, publicKey *ed25519.PublicKey) *ED25519
NewED25519 creates a new ED25519 value
func NewED25519FromSeed ¶
NewED25519FromSeed creates a new ED25519FromSeed value