Documentation
¶
Index ¶
Constants ¶
View Source
const ( StorageTypeLocal = "local" StorageTypeMysql = "mysql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func GetProvider ¶
GetProvider of security module, if not exists create with specified type (using storage type "mysql" as default).
try get keypair from Storage it will auto create if not exist both. *notice* make sure every node has the same keypair or maybe cannot decode the encrypted data properly cause of keypair mismatch.
func NewProvider ¶
func (*Provider) GetPublicKeyPem ¶
GetPublicKeyPem get public key pem
type Storage ¶
type Storage interface {
StorePublicKey(ctx context.Context, name string, data []byte) error
StorePrivateKey(ctx context.Context, name string, data []byte) error
LoadPublicKey(ctx context.Context, name string) (publicKey *rsa.PublicKey, err error)
LoadPrivateKey(ctx context.Context, name string) (privateKey *rsa.PrivateKey, err error)
}
func NewLocalStorage ¶
func NewLocalStorage() Storage
func NewMysqlStorage ¶
Click to show internal directories.
Click to hide internal directories.