common

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const STORE_KEYPAIR_PREFIX string = "/driver-info-spaces/keypair"

Variables

This section is empty.

Functions

func AddKey added in v0.5.1

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

ex)

	privateKey, publicKey, err := GenKeyPair()

	srcList[0] = credentialInfo.IdentityEndpoint
	srcList[1] = credentialInfo.AuthToken
	srcList[2] = credentialInfo.TenantId
	strHash, err := GenHash(srcList)

     AddKey("CLOUDIT", strHash, keyPairReqInfo.IId.NameId, privateKey)

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 SaveKey

func SaveKey(keyBytes []byte, targetFile string) error

save a key to a file

func ValidateWindowsPassword added in v0.6.15

func ValidateWindowsPassword(pw string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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