keys

package
v0.20231124.1163225 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MPL-2.0 Imports: 8 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/keys Documentation

The keys SDK allows for interaction with the Azure Resource Manager Service keyvault (API Version 2023-07-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/keys"

Client Initialization

client := keys.NewKeysClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: KeysClient.CreateIfNotExist

ctx := context.TODO()
id := keys.NewKeyVaultKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "keyValue")

payload := keys.KeyCreateParameters{
	// ...
}


read, err := client.CreateIfNotExist(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: KeysClient.Get

ctx := context.TODO()
id := keys.NewKeyVaultKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "keyValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: KeysClient.GetVersion

ctx := context.TODO()
id := keys.NewKeyVaultKeyVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "keyValue", "versionValue")

read, err := client.GetVersion(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: KeysClient.List

ctx := context.TODO()
id := keys.NewKeyVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: KeysClient.ListVersions

ctx := context.TODO()
id := keys.NewKeyVaultKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "keyValue")

// alternatively `client.ListVersions(ctx, id)` can be used to do batched pagination
items, err := client.ListVersionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForDeletionRecoveryLevel

func PossibleValuesForDeletionRecoveryLevel() []string

func PossibleValuesForJsonWebKeyCurveName

func PossibleValuesForJsonWebKeyCurveName() []string

func PossibleValuesForJsonWebKeyOperation

func PossibleValuesForJsonWebKeyOperation() []string

func PossibleValuesForJsonWebKeyType

func PossibleValuesForJsonWebKeyType() []string

func PossibleValuesForKeyRotationPolicyActionType

func PossibleValuesForKeyRotationPolicyActionType() []string

Types

type Action

type Action struct {
	Type *KeyRotationPolicyActionType `json:"type,omitempty"`
}

type CreateIfNotExistOperationResponse

type CreateIfNotExistOperationResponse struct {
	HttpResponse *http.Response
	Model        *Key
}

type DeletionRecoveryLevel

type DeletionRecoveryLevel string
const (
	DeletionRecoveryLevelPurgeable                                DeletionRecoveryLevel = "Purgeable"
	DeletionRecoveryLevelRecoverable                              DeletionRecoveryLevel = "Recoverable"
	DeletionRecoveryLevelRecoverablePositiveProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription"
	DeletionRecoveryLevelRecoverablePositivePurgeable             DeletionRecoveryLevel = "Recoverable+Purgeable"
)

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *Key
}

type GetVersionOperationResponse

type GetVersionOperationResponse struct {
	HttpResponse *http.Response
	Model        *Key
}

type JsonWebKeyCurveName

type JsonWebKeyCurveName string
const (
	JsonWebKeyCurveNamePNegativeFiveTwoOne     JsonWebKeyCurveName = "P-521"
	JsonWebKeyCurveNamePNegativeThreeEightFour JsonWebKeyCurveName = "P-384"
	JsonWebKeyCurveNamePNegativeTwoFiveSix     JsonWebKeyCurveName = "P-256"
	JsonWebKeyCurveNamePNegativeTwoFiveSixK    JsonWebKeyCurveName = "P-256K"
)

type JsonWebKeyOperation

type JsonWebKeyOperation string
const (
	JsonWebKeyOperationDecrypt   JsonWebKeyOperation = "decrypt"
	JsonWebKeyOperationEncrypt   JsonWebKeyOperation = "encrypt"
	JsonWebKeyOperationImport    JsonWebKeyOperation = "import"
	JsonWebKeyOperationRelease   JsonWebKeyOperation = "release"
	JsonWebKeyOperationSign      JsonWebKeyOperation = "sign"
	JsonWebKeyOperationUnwrapKey JsonWebKeyOperation = "unwrapKey"
	JsonWebKeyOperationVerify    JsonWebKeyOperation = "verify"
	JsonWebKeyOperationWrapKey   JsonWebKeyOperation = "wrapKey"
)

type JsonWebKeyType

type JsonWebKeyType string
const (
	JsonWebKeyTypeEC             JsonWebKeyType = "EC"
	JsonWebKeyTypeECNegativeHSM  JsonWebKeyType = "EC-HSM"
	JsonWebKeyTypeRSA            JsonWebKeyType = "RSA"
	JsonWebKeyTypeRSANegativeHSM JsonWebKeyType = "RSA-HSM"
)

type Key

type Key struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties KeyProperties      `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type KeyAttributes

type KeyAttributes struct {
	Created       *int64                 `json:"created,omitempty"`
	Enabled       *bool                  `json:"enabled,omitempty"`
	Exp           *int64                 `json:"exp,omitempty"`
	Exportable    *bool                  `json:"exportable,omitempty"`
	Nbf           *int64                 `json:"nbf,omitempty"`
	RecoveryLevel *DeletionRecoveryLevel `json:"recoveryLevel,omitempty"`
	Updated       *int64                 `json:"updated,omitempty"`
}

type KeyCreateParameters

type KeyCreateParameters struct {
	Properties KeyProperties      `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
}

type KeyOperationPredicate

type KeyOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (KeyOperationPredicate) Matches

func (p KeyOperationPredicate) Matches(input Key) bool

type KeyProperties

type KeyProperties struct {
	Attributes        *KeyAttributes         `json:"attributes,omitempty"`
	CurveName         *JsonWebKeyCurveName   `json:"curveName,omitempty"`
	KeyOps            *[]JsonWebKeyOperation `json:"keyOps,omitempty"`
	KeySize           *int64                 `json:"keySize,omitempty"`
	KeyUri            *string                `json:"keyUri,omitempty"`
	KeyUriWithVersion *string                `json:"keyUriWithVersion,omitempty"`
	Kty               *JsonWebKeyType        `json:"kty,omitempty"`
	ReleasePolicy     *KeyReleasePolicy      `json:"release_policy,omitempty"`
	RotationPolicy    *RotationPolicy        `json:"rotationPolicy,omitempty"`
}

type KeyReleasePolicy

type KeyReleasePolicy struct {
	ContentType *string `json:"contentType,omitempty"`
	Data        *string `json:"data,omitempty"`
}

type KeyRotationPolicyActionType

type KeyRotationPolicyActionType string
const (
	KeyRotationPolicyActionTypeNotify KeyRotationPolicyActionType = "notify"
	KeyRotationPolicyActionTypeRotate KeyRotationPolicyActionType = "rotate"
)

type KeyRotationPolicyAttributes

type KeyRotationPolicyAttributes struct {
	Created    *int64  `json:"created,omitempty"`
	ExpiryTime *string `json:"expiryTime,omitempty"`
	Updated    *int64  `json:"updated,omitempty"`
}

type KeysClient

type KeysClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewKeysClientWithBaseURI

func NewKeysClientWithBaseURI(endpoint string) KeysClient

func (KeysClient) CreateIfNotExist

CreateIfNotExist ...

func (KeysClient) Get

Get ...

func (KeysClient) GetVersion

GetVersion ...

func (KeysClient) List

List ...

func (KeysClient) ListComplete

ListComplete retrieves all of the results into a single object

func (KeysClient) ListCompleteMatchingPredicate

func (c KeysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.KeyVaultId, predicate KeyOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (KeysClient) ListVersions

ListVersions ...

func (KeysClient) ListVersionsComplete

ListVersionsComplete retrieves all of the results into a single object

func (KeysClient) ListVersionsCompleteMatchingPredicate

func (c KeysClient) ListVersionsCompleteMatchingPredicate(ctx context.Context, id commonids.KeyVaultKeyId, predicate KeyOperationPredicate) (resp ListVersionsCompleteResult, err error)

ListVersionsCompleteMatchingPredicate retrieves all of the results and then applied the predicate

type LifetimeAction

type LifetimeAction struct {
	Action  *Action  `json:"action,omitempty"`
	Trigger *Trigger `json:"trigger,omitempty"`
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Key
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Key
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type ListVersionsCompleteResult

type ListVersionsCompleteResult struct {
	Items []Key
}

type ListVersionsOperationResponse

type ListVersionsOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Key
	// contains filtered or unexported fields
}

func (ListVersionsOperationResponse) HasMore

func (r ListVersionsOperationResponse) HasMore() bool

func (ListVersionsOperationResponse) LoadMore

type RotationPolicy

type RotationPolicy struct {
	Attributes      *KeyRotationPolicyAttributes `json:"attributes,omitempty"`
	LifetimeActions *[]LifetimeAction            `json:"lifetimeActions,omitempty"`
}

type Trigger

type Trigger struct {
	TimeAfterCreate  *string `json:"timeAfterCreate,omitempty"`
	TimeBeforeExpiry *string `json:"timeBeforeExpiry,omitempty"`
}

Jump to

Keyboard shortcuts

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