keys

package
v0.20230227.1195936 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2022-11-01/keys Documentation

The keys SDK allows for interaction with the Azure Resource Manager Service keyvault (API Version 2022-11-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/2022-11-01/keys"

Client Initialization

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

Example Usage: KeysClient.CreateIfNotExist

ctx := context.TODO()
id := keys.NewKeyID("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.NewKeyID("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.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMValue", "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.NewVaultID("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.NewKeyID("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

func ValidateKeyID

func ValidateKeyID(input interface{}, key string) (warnings []string, errors []error)

ValidateKeyID checks that 'input' can be parsed as a Key ID

func ValidateVaultID

func ValidateVaultID(input interface{}, key string) (warnings []string, errors []error)

ValidateVaultID checks that 'input' can be parsed as a Vault ID

func ValidateVersionID

func ValidateVersionID(input interface{}, key string) (warnings []string, errors []error)

ValidateVersionID checks that 'input' can be parsed as a Version ID

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 KeyId

type KeyId struct {
	SubscriptionId    string
	ResourceGroupName string
	VaultName         string
	KeyName           string
}

KeyId is a struct representing the Resource ID for a Key

func NewKeyID

func NewKeyID(subscriptionId string, resourceGroupName string, vaultName string, keyName string) KeyId

NewKeyID returns a new KeyId struct

func ParseKeyID

func ParseKeyID(input string) (*KeyId, error)

ParseKeyID parses 'input' into a KeyId

func ParseKeyIDInsensitively

func ParseKeyIDInsensitively(input string) (*KeyId, error)

ParseKeyIDInsensitively parses 'input' case-insensitively into a KeyId note: this method should only be used for API response data and not user input

func (KeyId) ID

func (id KeyId) ID() string

ID returns the formatted Key ID

func (KeyId) Segments

func (id KeyId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Key ID

func (KeyId) String

func (id KeyId) String() string

String returns a human-readable description of this Key ID

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

func (c KeysClient) CreateIfNotExist(ctx context.Context, id KeyId, input KeyCreateParameters) (result CreateIfNotExistOperationResponse, err error)

CreateIfNotExist ...

func (KeysClient) Get

func (c KeysClient) Get(ctx context.Context, id KeyId) (result GetOperationResponse, err error)

Get ...

func (KeysClient) GetVersion

func (c KeysClient) GetVersion(ctx context.Context, id VersionId) (result GetVersionOperationResponse, err error)

GetVersion ...

func (KeysClient) List

func (c KeysClient) List(ctx context.Context, id VaultId) (resp ListOperationResponse, err error)

List ...

func (KeysClient) ListComplete

func (c KeysClient) ListComplete(ctx context.Context, id VaultId) (ListCompleteResult, error)

ListComplete retrieves all of the results into a single object

func (KeysClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (KeysClient) ListVersions

func (c KeysClient) ListVersions(ctx context.Context, id KeyId) (resp ListVersionsOperationResponse, err error)

ListVersions ...

func (KeysClient) ListVersionsComplete

func (c KeysClient) ListVersionsComplete(ctx context.Context, id KeyId) (ListVersionsCompleteResult, error)

ListVersionsComplete retrieves all of the results into a single object

func (KeysClient) ListVersionsCompleteMatchingPredicate

func (c KeysClient) ListVersionsCompleteMatchingPredicate(ctx context.Context, id KeyId, 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"`
}

type VaultId

type VaultId struct {
	SubscriptionId    string
	ResourceGroupName string
	VaultName         string
}

VaultId is a struct representing the Resource ID for a Vault

func NewVaultID

func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId

NewVaultID returns a new VaultId struct

func ParseVaultID

func ParseVaultID(input string) (*VaultId, error)

ParseVaultID parses 'input' into a VaultId

func ParseVaultIDInsensitively

func ParseVaultIDInsensitively(input string) (*VaultId, error)

ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId note: this method should only be used for API response data and not user input

func (VaultId) ID

func (id VaultId) ID() string

ID returns the formatted Vault ID

func (VaultId) Segments

func (id VaultId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Vault ID

func (VaultId) String

func (id VaultId) String() string

String returns a human-readable description of this Vault ID

type VersionId

type VersionId struct {
	SubscriptionId    string
	ResourceGroupName string
	ManagedHSMName    string
	KeyName           string
	VersionName       string
}

VersionId is a struct representing the Resource ID for a Version

func NewVersionID

func NewVersionID(subscriptionId string, resourceGroupName string, managedHSMName string, keyName string, versionName string) VersionId

NewVersionID returns a new VersionId struct

func ParseVersionID

func ParseVersionID(input string) (*VersionId, error)

ParseVersionID parses 'input' into a VersionId

func ParseVersionIDInsensitively

func ParseVersionIDInsensitively(input string) (*VersionId, error)

ParseVersionIDInsensitively parses 'input' case-insensitively into a VersionId note: this method should only be used for API response data and not user input

func (VersionId) ID

func (id VersionId) ID() string

ID returns the formatted Version ID

func (VersionId) Segments

func (id VersionId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Version ID

func (VersionId) String

func (id VersionId) String() string

String returns a human-readable description of this Version ID

Jump to

Keyboard shortcuts

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