azkeyvault

package
v0.0.0-...-a70b9b0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package azkeyvault is a generated GoMock package.

Index

Constants

View Source
const AzureKeyVaultTimeout = 10 * time.Second

Variables

This section is empty.

Functions

func GetTLSCertificate

func GetTLSCertificate(ctx context.Context, certClient CertificatesClient, keysClient KeysClient, certificateName string) (*tls.Certificate, error)

func NewCertificatesClient

func NewCertificatesClient(keyVaultURL string, credentialType string, insecure bool) (*azcertificates.Client, error)

func NewKeysClient

func NewKeysClient(keyVaultURL string, credentialType string, insecure bool) (*azkeys.Client, error)

Types

type CertificatesClient

type CertificatesClient interface {
	GetCertificate(ctx context.Context, certificateName string, certificateVersion string, options *azcertificates.GetCertificateOptions) (azcertificates.GetCertificateResponse, error)
}

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}
var AzureHttpRequestDoer HttpRequestDoer = http.DefaultClient

type KeysClient

type KeysClient interface {
	Decrypt(ctx context.Context, keyName string, keyVersion string, parameters azkeys.KeyOperationParameters, options *azkeys.DecryptOptions) (azkeys.DecryptResponse, error)
	GetKey(ctx context.Context, name string, version string, options *azkeys.GetKeyOptions) (azkeys.GetKeyResponse, error)
	Sign(ctx context.Context, name string, version string, parameters azkeys.SignParameters, options *azkeys.SignOptions) (azkeys.SignResponse, error)
}

type MockCertificatesClient

type MockCertificatesClient struct {
	// contains filtered or unexported fields
}

MockCertificatesClient is a mock of CertificatesClient interface.

func NewMockCertificatesClient

func NewMockCertificatesClient(ctrl *gomock.Controller) *MockCertificatesClient

NewMockCertificatesClient creates a new mock instance.

func (*MockCertificatesClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCertificatesClient) GetCertificate

func (m *MockCertificatesClient) GetCertificate(ctx context.Context, certificateName, certificateVersion string, options *azcertificates.GetCertificateOptions) (azcertificates.GetCertificateResponse, error)

GetCertificate mocks base method.

type MockCertificatesClientMockRecorder

type MockCertificatesClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockCertificatesClientMockRecorder is the mock recorder for MockCertificatesClient.

func (*MockCertificatesClientMockRecorder) GetCertificate

func (mr *MockCertificatesClientMockRecorder) GetCertificate(ctx, certificateName, certificateVersion, options any) *gomock.Call

GetCertificate indicates an expected call of GetCertificate.

type MockKeysClient

type MockKeysClient struct {
	// contains filtered or unexported fields
}

MockKeysClient is a mock of KeysClient interface.

func NewMockKeysClient

func NewMockKeysClient(ctrl *gomock.Controller) *MockKeysClient

NewMockKeysClient creates a new mock instance.

func (*MockKeysClient) Decrypt

func (m *MockKeysClient) Decrypt(ctx context.Context, keyName, keyVersion string, parameters azkeys.KeyOperationParameters, options *azkeys.DecryptOptions) (azkeys.DecryptResponse, error)

Decrypt mocks base method.

func (*MockKeysClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockKeysClient) GetKey

func (m *MockKeysClient) GetKey(ctx context.Context, name, version string, options *azkeys.GetKeyOptions) (azkeys.GetKeyResponse, error)

GetKey mocks base method.

func (*MockKeysClient) Sign

func (m *MockKeysClient) Sign(ctx context.Context, name, version string, parameters azkeys.SignParameters, options *azkeys.SignOptions) (azkeys.SignResponse, error)

Sign mocks base method.

type MockKeysClientMockRecorder

type MockKeysClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockKeysClientMockRecorder is the mock recorder for MockKeysClient.

func (*MockKeysClientMockRecorder) Decrypt

func (mr *MockKeysClientMockRecorder) Decrypt(ctx, keyName, keyVersion, parameters, options any) *gomock.Call

Decrypt indicates an expected call of Decrypt.

func (*MockKeysClientMockRecorder) GetKey

func (mr *MockKeysClientMockRecorder) GetKey(ctx, name, version, options any) *gomock.Call

GetKey indicates an expected call of GetKey.

func (*MockKeysClientMockRecorder) Sign

func (mr *MockKeysClientMockRecorder) Sign(ctx, name, version, parameters, options any) *gomock.Call

Sign indicates an expected call of Sign.

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

func GetCertificate

func GetCertificate(ctx context.Context, certClient CertificatesClient, keysClient KeysClient, certificateName string) (*x509.Certificate, *Suite, error)

func GetCertificateChain

func GetCertificateChain(ctx context.Context, certClient CertificatesClient, keysClient KeysClient, certificateName string) ([][]byte, *Suite, error)

GetCertificateChain retrieves the full chain from Azure Key Vault

func GetKey

func GetKey(client KeysClient, keyName string) (*Suite, error)

func GetSignatureCertificate

func GetSignatureCertificate(ctx context.Context, certClient CertificatesClient, keysClient KeysClient, certificateName string) (*tls.Certificate, *Suite, error)

func (Suite) DecryptRsaOaep

func (s Suite) DecryptRsaOaep(cipherText []byte, dm libCrypto.DigestMethod) ([]byte, error)

func (Suite) KeyID

func (a Suite) KeyID() string

func (Suite) Public

func (a Suite) Public() crypto.PublicKey

func (Suite) Sign

func (a Suite) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

func (Suite) SigningAlgorithm

func (a Suite) SigningAlgorithm() string

func (Suite) SigningKey

func (s Suite) SigningKey() crypto.Signer

type TestAzureKeyVault

type TestAzureKeyVault struct {
	TestHttpServer *httptest.Server
	// contains filtered or unexported fields
}

func NewTestServer

func NewTestServer() *TestAzureKeyVault

func (TestAzureKeyVault) AddCertificate

func (t TestAzureKeyVault) AddCertificate(name string, cert *tls.Certificate)

func (TestAzureKeyVault) AddKey

func (t TestAzureKeyVault) AddKey(name string, key *rsa.PrivateKey)

Jump to

Keyboard shortcuts

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