common

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKey added in v0.5.1

func AddKey(providerName string, hashString string, keyPairNameId string, privateKey string) error

func DelKey added in v0.5.1

func DelKey(providerName string, hashString string, keyPairNameId string) error

func GenHash added in v0.5.1

func GenHash(sourceList []string) (string, error)

func GenKeyPair

func GenKeyPair() ([]byte, []byte, error)

generate a KeyPair with 4KB length returns: privateKeyBytes, publicKeyBytes, error

func GetKey added in v0.5.1

func GetKey(providerName string, hashString string, keyPairNameId string) (*irs.KeyValue, error)

return: KeyValue{Key:KeyPairNameId, Value:PrivateKey}

func ListKey added in v0.5.1

func ListKey(providerName string, hashString string) ([]*irs.KeyValue, error)

return: []KeyValue{Key:KeyPairNameId, Value:PrivateKey}

func MakePublicKeyFromPrivateKey

func MakePublicKeyFromPrivateKey(pem string) (string, error)

ParseKey reads the given RSA private key and create a public one for it.

func ValidateWindowsPassword added in v0.6.15

func ValidateWindowsPassword(pw string) error

Types

type LocalKeyInfo added in v0.7.6

type LocalKeyInfo struct {
	ProviderName string `gorm:"primaryKey"`
	HashString   string `gorm:"primaryKey"`
	NameId       string `gorm:"primaryKey"`
	PrivateKey   string
}

func (LocalKeyInfo) TableName added in v0.7.6

func (LocalKeyInfo) TableName() string

Jump to

Keyboard shortcuts

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