Documentation ¶
Index ¶
- func NewHttpError(msg string, code int) error
- type AzureKey
- type AzureKeyDetail
- type AzureVault
- func (s *AzureVault) Contains(keyID string) bool
- func (s *AzureVault) GetPublicKey(ctx context.Context, keyID string) (signatory.StoredKey, error)
- func (s *AzureVault) Import(jwk *signatory.JWK) (string, error)
- func (s *AzureVault) ListPublicKeys(ctx context.Context) ([]signatory.StoredKey, error)
- func (s *AzureVault) Name() string
- func (s *AzureVault) Ready() bool
- func (s *AzureVault) Sign(ctx context.Context, digest []byte, storedKey signatory.StoredKey) ([]byte, error)
- func (s *AzureVault) VaultName() string
- type HTTPClient
- type YubiHSM
- func (s *YubiHSM) GetPublicKey(ctx context.Context, keyID string) (signatory.StoredKey, error)
- func (s *YubiHSM) ListPublicKeys(ctx context.Context) ([]signatory.StoredKey, error)
- func (s *YubiHSM) Name() string
- func (s *YubiHSM) Ready() bool
- func (s *YubiHSM) Sign(ctx context.Context, digest []byte, storedKey signatory.StoredKey) ([]byte, error)
- type YubiKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpError ¶
Types ¶
type AzureKey ¶
type AzureKey struct {
Key AzureKeyDetail `json:"key"`
}
AzureKey struct that contains data about azure key and honor the StoredKey interface
type AzureKeyDetail ¶
type AzureKeyDetail struct { ID string `json:"kid"` Curve string `json:"crv"` X string `json:"x"` Y string `json:"y"` KTY string `json:"kty"` }
AzureKeyDetail data about azure key
type AzureVault ¶
type AzureVault struct {
// contains filtered or unexported fields
}
AzureVault contains the necessary information to interact with azure key vault api
func NewAzureVault ¶
func NewAzureVault(config config.AzureConfig, client HTTPClient) *AzureVault
NewAzureVault create a new AzureVault struct according to the config if client is nil it will use the default http client
func (*AzureVault) Contains ¶
func (s *AzureVault) Contains(keyID string) bool
Contains return true if the keyHash was found in Azure Key Vault
func (*AzureVault) GetPublicKey ¶
GetPublicKey retrieve the public key matching keyID from the azure key vault rest api
func (*AzureVault) Import ¶
func (s *AzureVault) Import(jwk *signatory.JWK) (string, error)
Import use the azure key vault rest api to import a JWK
func (*AzureVault) ListPublicKeys ¶
ListPublicKeys retrieve all the public keys matching keyHash from the azure key vault rest api
func (*AzureVault) Ready ¶
func (s *AzureVault) Ready() bool
Ready return true if the vault is ready
func (*AzureVault) Sign ¶
func (s *AzureVault) Sign(ctx context.Context, digest []byte, storedKey signatory.StoredKey) ([]byte, error)
Sign submit a sign request to the azure keyvault api returns the decoded signature
func (*AzureVault) VaultName ¶
func (s *AzureVault) VaultName() string
VaultName returns Azure vault name
type HTTPClient ¶
HTTPClient interface representing a subset of http client method
type YubiHSM ¶
type YubiHSM struct {
// contains filtered or unexported fields
}
YubiHSM struct containing information required to interrogate a Yubi HSM
func NewYubi ¶
func NewYubi(config config.YubiConfig) (*YubiHSM, error)
NewYubi create a NewYubi vault according to config
func (*YubiHSM) GetPublicKey ¶
GetPublicKey retrieve a public key from Yubi HSM
func (*YubiHSM) ListPublicKeys ¶
ListPublicKeys list all public key from connected Yubi HSM