Documentation
¶
Index ¶
- type AwsSmKeyService
- func (s *AwsSmKeyService) DeleteKey(ctx context.Context, id string) error
- func (s *AwsSmKeyService) ListKeys(ctx context.Context) ([]string, error)
- func (s *AwsSmKeyService) RetrievePrivKey(ctx context.Context, id string) (*jwk.Jwk, error)
- func (s *AwsSmKeyService) RetrievePubKey(ctx context.Context, id string) (*jwk.Jwk, error)
- func (s *AwsSmKeyService) SaveKey(ctx context.Context, id string, priv *jwk.Jwk) error
- type AwsSmStorageConfig
- type FileStorageConfig
- type KeyService
- type LocalFileKeyService
- func (s *LocalFileKeyService) DeleteKey(ctx context.Context, id string) error
- func (s *LocalFileKeyService) ListKeys(ctx context.Context) ([]string, error)
- func (s *LocalFileKeyService) RetrievePrivKey(ctx context.Context, id string) (*jwktype.Jwk, error)
- func (s *LocalFileKeyService) RetrievePubKey(ctx context.Context, id string) (*jwktype.Jwk, error)
- func (s *LocalFileKeyService) SaveKey(ctx context.Context, id string, jwk *jwktype.Jwk) error
- type StorageType
- type VaultKeyService
- func (s *VaultKeyService) DeleteKey(ctx context.Context, id string) error
- func (s *VaultKeyService) ListKeys(ctx context.Context) ([]string, error)
- func (s *VaultKeyService) RetrievePrivKey(ctx context.Context, id string) (*jwk.Jwk, error)
- func (s *VaultKeyService) RetrievePubKey(ctx context.Context, id string) (*jwk.Jwk, error)
- func (s *VaultKeyService) SaveKey(ctx context.Context, id string, priv *jwk.Jwk) error
- type VaultStorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsSmKeyService ¶ added in v0.0.13
type AwsSmKeyService struct {
// contains filtered or unexported fields
}
func (*AwsSmKeyService) DeleteKey ¶ added in v0.0.13
func (s *AwsSmKeyService) DeleteKey(ctx context.Context, id string) error
func (*AwsSmKeyService) ListKeys ¶ added in v0.0.13
func (s *AwsSmKeyService) ListKeys(ctx context.Context) ([]string, error)
func (*AwsSmKeyService) RetrievePrivKey ¶ added in v0.0.13
func (*AwsSmKeyService) RetrievePubKey ¶ added in v0.0.13
type AwsSmStorageConfig ¶ added in v0.0.13
type FileStorageConfig ¶
type FileStorageConfig struct {
FilePath string
}
type KeyService ¶
type KeyService interface {
// SaveKey saves a JWK to the key storage. it supports local file, and hashicorp vault
SaveKey(ctx context.Context, id string, jwk *jwk.Jwk) error
// RetrieveKey retrieves a public JWK by its ID.
RetrievePubKey(ctx context.Context, id string) (*jwk.Jwk, error)
// RetrieveKey retrieves a private JWK by its ID.
RetrievePrivKey(ctx context.Context, id string) (*jwk.Jwk, error)
// DeleteKey deletes a JWK by its ID.
DeleteKey(ctx context.Context, id string) error
// ListKeys returns all available key IDs.
ListKeys(ctx context.Context) ([]string, error)
}
KeyService defines methods for generating, saving, and retrieving JWKs.
func NewAwsSmKeyService ¶ added in v0.0.13
func NewAwsSmKeyService(cfg *AwsSmStorageConfig) (KeyService, error)
func NewKeyService ¶
func NewKeyService(storageType StorageType, config interface{}) (KeyService, error)
type LocalFileKeyService ¶
type LocalFileKeyService struct {
FilePath string
// contains filtered or unexported fields
}
func (*LocalFileKeyService) DeleteKey ¶
func (s *LocalFileKeyService) DeleteKey(ctx context.Context, id string) error
func (*LocalFileKeyService) ListKeys ¶
func (s *LocalFileKeyService) ListKeys(ctx context.Context) ([]string, error)
func (*LocalFileKeyService) RetrievePrivKey ¶
RetrievePrivKey returns the private JWK for the given id.
func (*LocalFileKeyService) RetrievePubKey ¶
RetrievePubKey returns the public JWK for the given id.
type StorageType ¶
type StorageType int
const ( FileStorage StorageType = iota VaultStorage AwsSmStorage )
func (StorageType) String ¶
func (s StorageType) String() string
type VaultKeyService ¶
type VaultKeyService struct {
// contains filtered or unexported fields
}
func (*VaultKeyService) DeleteKey ¶
func (s *VaultKeyService) DeleteKey(ctx context.Context, id string) error
func (*VaultKeyService) ListKeys ¶
func (s *VaultKeyService) ListKeys(ctx context.Context) ([]string, error)
func (*VaultKeyService) RetrievePrivKey ¶
func (*VaultKeyService) RetrievePubKey ¶
Click to show internal directories.
Click to hide internal directories.