azcertificates

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 14 Imported by: 8

README

Azure Key Vault Certificates client module for Go

  • Certificate management (this module) - create, manage, and deploy public and private SSL/TLS certificates
  • Managed HSM administration (azadmin) - role-based access control (RBAC), settings, and vault-level backup and restore options
  • Cryptographic key management (azkeys) - create, store, and control access to the keys used to encrypt your data
  • Secrets management (azsecrets) - securely store and control access to tokens, passwords, certificates, API keys, and other secrets

Source code | Package (pkg.go.dev) | Product documentation | Samples

Getting started

Install the package

Install azcertificates and azidentity with go get:

go get github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates
go get github.com/Azure/azure-sdk-for-go/sdk/azidentity

azidentity is used for Azure Active Directory authentication as demonstrated below.

Prerequisites
  • An Azure subscription
  • A supported Go version (the Azure SDK supports the two most recent Go releases)
  • A key vault. If you need to create one, see the Key Vault documentation for instructions on doing so in the Azure Portal or with the Azure CLI.
Authentication

This document demonstrates using azidentity.NewDefaultAzureCredential to authenticate. This credential type works in both local development and production environments. We recommend using a managed identity in production.

Client accepts any azidentity credential. See the azidentity documentation for more information about other credential types.

Create a client

Constructing the client also requires your vault's URL, which you can get from the Azure CLI or the Azure Portal.

import (
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

func main() {
	credential, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		// TODO: handle error
	}

	client, err := azcertificates.NewClient("https://<TODO: your vault name>.vault.azure.net", credential, nil)
	if err != nil {
		// TODO: handle error
	}
}

Key concepts

Client

With a Client, you can get certificates from the vault, create new certificates and new versions of existing certificates, update certificate metadata, and delete certificates. You can also manage certificate issuers, contacts, and management policies of certificates. This is illustrated in the examples below.

Examples

Get started with our examples.

Troubleshooting

Error Handling

All methods which send HTTP requests return *azcore.ResponseError when these requests fail. ResponseError has error details and the raw response from Key Vault.

import "github.com/Azure/azure-sdk-for-go/sdk/azcore"

resp, err := client.GetCertificate(context.Background(), "certificateName", nil)
if err != nil {
    var httpErr *azcore.ResponseError
    if errors.As(err, &httpErr) {
        // TODO: investigate httpErr
    } else {
        // TODO: not an HTTP error
    }
}
Logging

This module uses the logging implementation in azcore. To turn on logging for all Azure SDK modules, set AZURE_SDK_GO_LOGGING to all. By default the logger writes to stderr. Use the azcore/log package to control log output. For example, logging only HTTP request and response events, and printing them to stdout:

import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"

// Print log events to stdout
azlog.SetListener(func(cls azlog.Event, msg string) {
	fmt.Println(msg)
})

// Includes only requests and responses in logs
azlog.SetEvents(azlog.EventRequest, azlog.EventResponse)
Accessing http.Response

You can access the raw *http.Response returned by Key Vault using the runtime.WithCaptureResponse method and a context passed to any client method.

import "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"

var response *http.Response
ctx := runtime.WithCaptureResponse(context.TODO(), &response)
_, err = client.GetCertificate(ctx, "certificateName", nil)
if err != nil {
    // TODO: handle error
}
// TODO: do something with response
Additional Documentation

For more extensive documentation on Azure Key Vault, see the API reference documentation.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Impressions

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdministratorContact added in v0.11.0

type AdministratorContact struct {
	// Email address.
	Email *string

	// First name.
	FirstName *string

	// Last name.
	LastName *string

	// Phone number.
	Phone *string
}

AdministratorContact - Details of the organization administrator of the certificate issuer.

func (AdministratorContact) MarshalJSON added in v0.11.0

func (a AdministratorContact) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AdministratorContact.

func (*AdministratorContact) UnmarshalJSON added in v0.11.0

func (a *AdministratorContact) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorContact.

type BackupCertificateOptions

type BackupCertificateOptions struct {
}

BackupCertificateOptions contains the optional parameters for the Client.BackupCertificate method.

type BackupCertificateResponse

type BackupCertificateResponse struct {
	// The backup certificate result, containing the backup blob.
	BackupCertificateResult
}

BackupCertificateResponse contains the response from method Client.BackupCertificate.

type BackupCertificateResult

type BackupCertificateResult struct {
	// READ-ONLY; The backup blob containing the backed up certificate.
	Value []byte
}

BackupCertificateResult - The backup certificate result, containing the backup blob.

func (BackupCertificateResult) MarshalJSON

func (b BackupCertificateResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BackupCertificateResult.

func (*BackupCertificateResult) UnmarshalJSON

func (b *BackupCertificateResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BackupCertificateResult.

type Certificate added in v0.11.0

type Certificate struct {
	// The certificate attributes.
	Attributes *CertificateAttributes

	// CER contents of x509 certificate.
	CER []byte

	// The content type of the secret. eg. 'application/x-pem-file' or 'application/x-pkcs12',
	ContentType *string

	// Application specific metadata in the form of key-value pairs
	Tags map[string]*string

	// READ-ONLY; The certificate id.
	ID *ID

	// READ-ONLY; The key id.
	KID *ID

	// READ-ONLY; The management policy.
	Policy *CertificatePolicy

	// READ-ONLY; The secret id.
	SID *ID

	// READ-ONLY; Thumbprint of the certificate.
	X509Thumbprint []byte
}

Certificate - A certificate bundle consists of a certificate (X509) plus its attributes.

func (Certificate) MarshalJSON added in v0.11.0

func (c Certificate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Certificate.

func (*Certificate) UnmarshalJSON added in v0.11.0

func (c *Certificate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Certificate.

type CertificateAttributes

type CertificateAttributes struct {
	// Determines whether the object is enabled.
	Enabled *bool

	// Expiry date in UTC.
	Expires *time.Time

	// Not before date in UTC.
	NotBefore *time.Time

	// READ-ONLY; Creation time in UTC.
	Created *time.Time

	// READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0.
	RecoverableDays *int32

	// READ-ONLY; Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains
	// 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise,
	// only the system can purge the certificate, at the end of the retention interval.
	RecoveryLevel *string

	// READ-ONLY; Last updated time in UTC.
	Updated *time.Time
}

CertificateAttributes - The certificate management attributes.

func (CertificateAttributes) MarshalJSON

func (c CertificateAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertificateAttributes.

func (*CertificateAttributes) UnmarshalJSON

func (c *CertificateAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateAttributes.

type CertificateOperation

type CertificateOperation struct {
	// The certificate signing request (CSR) that is being used in the certificate operation.
	CSR []byte

	// Indicates if cancellation was requested on the certificate operation.
	CancellationRequested *bool

	// Error encountered, if any, during the certificate operation.
	Error *ErrorInfo

	// Parameters for the issuer of the X509 component of a certificate.
	IssuerParameters *IssuerParameters

	// Identifier for the certificate operation.
	RequestID *string

	// Status of the certificate operation.
	Status *string

	// The status details of the certificate operation.
	StatusDetails *string

	// Location which contains the result of the certificate operation.
	Target *string

	// READ-ONLY; The certificate id.
	ID *ID
}

CertificateOperation - A certificate operation is returned in case of asynchronous requests.

func (CertificateOperation) MarshalJSON

func (c CertificateOperation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertificateOperation.

func (*CertificateOperation) UnmarshalJSON

func (c *CertificateOperation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateOperation.

type CertificatePolicy

type CertificatePolicy struct {
	// The certificate attributes.
	Attributes *CertificateAttributes

	// Parameters for the issuer of the X509 component of a certificate.
	IssuerParameters *IssuerParameters

	// Properties of the key backing a certificate.
	KeyProperties *KeyProperties

	// Actions that will be performed by Key Vault over the lifetime of a certificate.
	LifetimeActions []*LifetimeAction

	// Properties of the secret backing a certificate.
	SecretProperties *SecretProperties

	// Properties of the X509 component of a certificate.
	X509CertificateProperties *X509CertificateProperties

	// READ-ONLY; The certificate id.
	ID *ID
}

CertificatePolicy - Management policy for a certificate.

func (CertificatePolicy) MarshalJSON

func (c CertificatePolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertificatePolicy.

func (*CertificatePolicy) UnmarshalJSON

func (c *CertificatePolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertificatePolicy.

type CertificatePolicyAction

type CertificatePolicyAction string

CertificatePolicyAction - The type of the action.

const (
	CertificatePolicyActionAutoRenew     CertificatePolicyAction = "AutoRenew"
	CertificatePolicyActionEmailContacts CertificatePolicyAction = "EmailContacts"
)

func PossibleCertificatePolicyActionValues

func PossibleCertificatePolicyActionValues() []CertificatePolicyAction

PossibleCertificatePolicyActionValues returns the possible values for the CertificatePolicyAction const type.

type CertificateProperties added in v0.11.0

type CertificateProperties struct {
	// The certificate management attributes.
	Attributes *CertificateAttributes

	// Certificate identifier.
	ID *ID

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string

	// Thumbprint of the certificate.
	X509Thumbprint []byte
}

CertificateProperties - The certificate item containing certificate metadata.

func (CertificateProperties) MarshalJSON added in v0.11.0

func (c CertificateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertificateProperties.

func (*CertificateProperties) UnmarshalJSON added in v0.11.0

func (c *CertificateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties.

type CertificatePropertiesListResult added in v0.11.0

type CertificatePropertiesListResult struct {
	// READ-ONLY; The URL to get the next set of certificates.
	NextLink *string

	// READ-ONLY; A response message containing a list of certificates in the key vault along with a link to the next page of
	// certificates.
	Value []*CertificateProperties
}

CertificatePropertiesListResult - The certificate list result.

func (CertificatePropertiesListResult) MarshalJSON added in v0.11.0

func (c CertificatePropertiesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertificatePropertiesListResult.

func (*CertificatePropertiesListResult) UnmarshalJSON added in v0.11.0

func (c *CertificatePropertiesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertificatePropertiesListResult.

type Client

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

Client contains the methods for the Client group. Don't use this type directly, use a constructor function instead.

func NewClient

func NewClient(vaultURL string, credential azcore.TokenCredential, options *ClientOptions) (*Client, error)

NewClient creates a client that accesses a Key Vault's certificates. You should validate that vaultURL references a valid Key Vault. See https://aka.ms/azsdk/blog/vault-uri for details.

Example
package main

import (
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		// TODO: handle error
	}
	vaultURL := "https://<TODO: your vault name>.vault.azure.net"
	client, err := azcertificates.NewClient(vaultURL, cred, nil)
	if err != nil {
		// TODO: handle error
	}

	_ = client
}
Output:

func (*Client) BackupCertificate

func (client *Client) BackupCertificate(ctx context.Context, certificateName string, options *BackupCertificateOptions) (BackupCertificateResponse, error)

BackupCertificate - Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • options - BackupCertificateOptions contains the optional parameters for the Client.BackupCertificate method.

func (*Client) CreateCertificate

func (client *Client) CreateCertificate(ctx context.Context, certificateName string, parameters CreateCertificateParameters, options *CreateCertificateOptions) (CreateCertificateResponse, error)

CreateCertificate - If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameters - The parameters to create a certificate.
  • options - CreateCertificateOptions contains the optional parameters for the Client.CreateCertificate method.
Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

var client *azcertificates.Client

func main() {
	createParams := azcertificates.CreateCertificateParameters{
		// this policy is suitable for a self-signed certificate
		CertificatePolicy: &azcertificates.CertificatePolicy{
			IssuerParameters:          &azcertificates.IssuerParameters{Name: to.Ptr("self")},
			X509CertificateProperties: &azcertificates.X509CertificateProperties{Subject: to.Ptr("CN=DefaultPolicy")},
		},
	}
	// if a certificate with the same name already exists, a new version of the certificate is created
	resp, err := client.CreateCertificate(context.TODO(), "certificateName", createParams, nil)
	if err != nil {
		// TODO: handle error
	}

	fmt.Println("Created a certificate with ID:", *resp.ID)
}
Output:

func (*Client) DeleteCertificate

func (client *Client) DeleteCertificate(ctx context.Context, certificateName string, options *DeleteCertificateOptions) (DeleteCertificateResponse, error)

DeleteCertificate - Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • options - DeleteCertificateOptions contains the optional parameters for the Client.DeleteCertificate method.
Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

var client *azcertificates.Client

func main() {
	// DeleteCertificate returns when Key Vault has begun deleting the certificate. That can take several
	// seconds to complete, so it may be necessary to wait before performing other operations on the
	// deleted certificate.
	resp, err := client.DeleteCertificate(context.TODO(), "certName", nil)
	if err != nil {
		// TODO: handle error
	}

	// In a soft-delete enabled vault, deleted resources can be recovered until they're purged (permanently deleted).
	fmt.Printf("Certificate will be purged at %v", *resp.ScheduledPurgeDate)
}
Output:

func (*Client) DeleteCertificateOperation

func (client *Client) DeleteCertificateOperation(ctx context.Context, certificateName string, options *DeleteCertificateOperationOptions) (DeleteCertificateOperationResponse, error)

DeleteCertificateOperation - Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • options - DeleteCertificateOperationOptions contains the optional parameters for the Client.DeleteCertificateOperation method.

func (*Client) DeleteContacts added in v0.11.0

func (client *Client) DeleteContacts(ctx context.Context, options *DeleteContactsOptions) (DeleteContactsResponse, error)

DeleteContacts - Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • options - DeleteContactsOptions contains the optional parameters for the Client.DeleteContacts method.

func (*Client) DeleteIssuer added in v0.11.0

func (client *Client) DeleteIssuer(ctx context.Context, issuerName string, options *DeleteIssuerOptions) (DeleteIssuerResponse, error)

DeleteIssuer - The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • issuerName - The name of the issuer.
  • options - DeleteIssuerOptions contains the optional parameters for the Client.DeleteIssuer method.

func (*Client) GetCertificate

func (client *Client) GetCertificate(ctx context.Context, certificateName string, certificateVersion string, options *GetCertificateOptions) (GetCertificateResponse, error)

GetCertificate - Gets information about a specific certificate. This operation requires the certificates/get permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate in the given vault.
  • certificateVersion - The version of the certificate. This URI fragment is optional. If not specified, the latest version of the certificate is returned.
  • options - GetCertificateOptions contains the optional parameters for the Client.GetCertificate method.
Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

var client *azcertificates.Client

func main() {
	// passing an empty string for the version gets the latest version of the certificate
	resp, err := client.GetCertificate(context.TODO(), "certName", "", nil)
	if err != nil {
		// TODO: handle error
	}
	fmt.Println(*resp.ID)
}
Output:

func (*Client) GetCertificateOperation

func (client *Client) GetCertificateOperation(ctx context.Context, certificateName string, options *GetCertificateOperationOptions) (GetCertificateOperationResponse, error)

GetCertificateOperation - Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • options - GetCertificateOperationOptions contains the optional parameters for the Client.GetCertificateOperation method.

func (*Client) GetCertificatePolicy

func (client *Client) GetCertificatePolicy(ctx context.Context, certificateName string, options *GetCertificatePolicyOptions) (GetCertificatePolicyResponse, error)

GetCertificatePolicy - The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate in a given key vault.
  • options - GetCertificatePolicyOptions contains the optional parameters for the Client.GetCertificatePolicy method.

func (*Client) GetContacts added in v0.11.0

func (client *Client) GetContacts(ctx context.Context, options *GetContactsOptions) (GetContactsResponse, error)

GetContacts - The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • options - GetContactsOptions contains the optional parameters for the Client.GetContacts method.

func (*Client) GetDeletedCertificate

func (client *Client) GetDeletedCertificate(ctx context.Context, certificateName string, options *GetDeletedCertificateOptions) (GetDeletedCertificateResponse, error)

GetDeletedCertificate - The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate
  • options - GetDeletedCertificateOptions contains the optional parameters for the Client.GetDeletedCertificate method.

func (*Client) GetIssuer added in v0.11.0

func (client *Client) GetIssuer(ctx context.Context, issuerName string, options *GetIssuerOptions) (GetIssuerResponse, error)

GetIssuer - The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • issuerName - The name of the issuer.
  • options - GetIssuerOptions contains the optional parameters for the Client.GetIssuer method.

func (*Client) ImportCertificate

func (client *Client) ImportCertificate(ctx context.Context, certificateName string, parameters ImportCertificateParameters, options *ImportCertificateOptions) (ImportCertificateResponse, error)

ImportCertificate - Imports an existing valid certificate, containing a private key, into Azure Key Vault. This operation requires the certificates/import permission. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. Key Vault will only accept a key in PKCS#8 format. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameters - The parameters to import the certificate.
  • options - ImportCertificateOptions contains the optional parameters for the Client.ImportCertificate method.

func (*Client) MergeCertificate

func (client *Client) MergeCertificate(ctx context.Context, certificateName string, parameters MergeCertificateParameters, options *MergeCertificateOptions) (MergeCertificateResponse, error)

MergeCertificate - The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • parameters - The parameters to merge certificate.
  • options - MergeCertificateOptions contains the optional parameters for the Client.MergeCertificate method.

func (*Client) NewListCertificatePropertiesPager added in v0.11.0

func (client *Client) NewListCertificatePropertiesPager(options *ListCertificatePropertiesOptions) *runtime.Pager[ListCertificatePropertiesResponse]

NewListCertificatePropertiesPager - The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

Generated from API version 7.5

  • options - ListCertificatePropertiesOptions contains the optional parameters for the Client.NewListCertificatePropertiesPager method.
Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

var client *azcertificates.Client

func main() {
	pager := client.NewListCertificatePropertiesPager(nil)
	for pager.More() {
		page, err := pager.NextPage(context.TODO())
		if err != nil {
			// TODO: handle error
		}
		for _, cert := range page.Value {
			fmt.Println(*cert.ID)
		}
	}
}
Output:

func (*Client) NewListCertificatePropertiesVersionsPager added in v0.11.0

func (client *Client) NewListCertificatePropertiesVersionsPager(certificateName string, options *ListCertificatePropertiesVersionsOptions) *runtime.Pager[ListCertificatePropertiesVersionsResponse]

NewListCertificatePropertiesVersionsPager - The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • options - ListCertificatePropertiesVersionsOptions contains the optional parameters for the Client.NewListCertificatePropertiesVersionsPager method.

func (*Client) NewListDeletedCertificatePropertiesPager added in v0.11.0

func (client *Client) NewListDeletedCertificatePropertiesPager(options *ListDeletedCertificatePropertiesOptions) *runtime.Pager[ListDeletedCertificatePropertiesResponse]

NewListDeletedCertificatePropertiesPager - The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

Generated from API version 7.5

  • options - ListDeletedCertificatePropertiesOptions contains the optional parameters for the Client.NewListDeletedCertificatePropertiesPager method.

func (*Client) NewListIssuerPropertiesPager added in v0.11.0

func (client *Client) NewListIssuerPropertiesPager(options *ListIssuerPropertiesOptions) *runtime.Pager[ListIssuerPropertiesResponse]

NewListIssuerPropertiesPager - The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

Generated from API version 7.5

  • options - ListIssuerPropertiesOptions contains the optional parameters for the Client.NewListIssuerPropertiesPager method.

func (*Client) PurgeDeletedCertificate

func (client *Client) PurgeDeletedCertificate(ctx context.Context, certificateName string, options *PurgeDeletedCertificateOptions) (PurgeDeletedCertificateResponse, error)

PurgeDeletedCertificate - The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify 'Purgeable'. This operation requires the certificate/purge permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate
  • options - PurgeDeletedCertificateOptions contains the optional parameters for the Client.PurgeDeletedCertificate method.

func (*Client) RecoverDeletedCertificate

func (client *Client) RecoverDeletedCertificate(ctx context.Context, certificateName string, options *RecoverDeletedCertificateOptions) (RecoverDeletedCertificateResponse, error)

RecoverDeletedCertificate - The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the deleted certificate
  • options - RecoverDeletedCertificateOptions contains the optional parameters for the Client.RecoverDeletedCertificate method.

func (*Client) RestoreCertificate

func (client *Client) RestoreCertificate(ctx context.Context, parameters RestoreCertificateParameters, options *RestoreCertificateOptions) (RestoreCertificateResponse, error)

RestoreCertificate - Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • parameters - The parameters to restore the certificate.
  • options - RestoreCertificateOptions contains the optional parameters for the Client.RestoreCertificate method.

func (*Client) SetContacts added in v0.11.0

func (client *Client) SetContacts(ctx context.Context, contacts Contacts, options *SetContactsOptions) (SetContactsResponse, error)

SetContacts - Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • contacts - The contacts for the key vault certificate.
  • options - SetContactsOptions contains the optional parameters for the Client.SetContacts method.

func (*Client) SetIssuer added in v0.11.0

func (client *Client) SetIssuer(ctx context.Context, issuerName string, parameter SetIssuerParameters, options *SetIssuerOptions) (SetIssuerResponse, error)

SetIssuer - The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • issuerName - The name of the issuer. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameter - Certificate issuer set parameter.
  • options - SetIssuerOptions contains the optional parameters for the Client.SetIssuer method.

func (*Client) UpdateCertificate

func (client *Client) UpdateCertificate(ctx context.Context, certificateName string, certificateVersion string, parameters UpdateCertificateParameters, options *UpdateCertificateOptions) (UpdateCertificateResponse, error)

UpdateCertificate - The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate in the given key vault.
  • certificateVersion - The version of the certificate.
  • parameters - The parameters for certificate update.
  • options - UpdateCertificateOptions contains the optional parameters for the Client.UpdateCertificate method.
Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates"
)

var client *azcertificates.Client

func main() {
	updateParams := azcertificates.UpdateCertificateParameters{
		CertificateAttributes: &azcertificates.CertificateAttributes{Enabled: to.Ptr(false)},
	}
	// passing an empty string for the version updates the latest version of the certificate
	resp, err := client.UpdateCertificate(context.TODO(), "certName", "", updateParams, nil)
	if err != nil {
		// TODO: handle error
	}
	fmt.Println(*resp.ID)
}
Output:

func (*Client) UpdateCertificateOperation

func (client *Client) UpdateCertificateOperation(ctx context.Context, certificateName string, certificateOperation UpdateCertificateOperationParameter, options *UpdateCertificateOperationOptions) (UpdateCertificateOperationResponse, error)

UpdateCertificateOperation - Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate.
  • certificateOperation - The certificate operation response.
  • options - UpdateCertificateOperationOptions contains the optional parameters for the Client.UpdateCertificateOperation method.

func (*Client) UpdateCertificatePolicy

func (client *Client) UpdateCertificatePolicy(ctx context.Context, certificateName string, certificatePolicy CertificatePolicy, options *UpdateCertificatePolicyOptions) (UpdateCertificatePolicyResponse, error)

UpdateCertificatePolicy - Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • certificateName - The name of the certificate in the given vault.
  • certificatePolicy - The policy for the certificate.
  • options - UpdateCertificatePolicyOptions contains the optional parameters for the Client.UpdateCertificatePolicy method.

func (*Client) UpdateIssuer added in v0.11.0

func (client *Client) UpdateIssuer(ctx context.Context, issuerName string, parameter UpdateIssuerParameters, options *UpdateIssuerOptions) (UpdateIssuerResponse, error)

UpdateIssuer - The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 7.5

  • issuerName - The name of the issuer.
  • parameter - Certificate issuer update parameter.
  • options - UpdateIssuerOptions contains the optional parameters for the Client.UpdateIssuer method.

type ClientOptions

type ClientOptions struct {
	azcore.ClientOptions

	// DisableChallengeResourceVerification controls whether the policy requires the
	// authentication challenge resource to match the Key Vault or Managed HSM domain.
	// See https://aka.ms/azsdk/blog/vault-uri for more information.
	DisableChallengeResourceVerification bool
}

ClientOptions contains optional settings for Client.

type Contact

type Contact struct {
	// Email address.
	Email *string

	// Name.
	Name *string

	// Phone number.
	Phone *string
}

Contact - The contact information for the vault certificates.

func (Contact) MarshalJSON

func (c Contact) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Contact.

func (*Contact) UnmarshalJSON

func (c *Contact) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Contact.

type Contacts

type Contacts struct {
	// The contact list for the vault certificates.
	ContactList []*Contact

	// READ-ONLY; Identifier for the contacts collection.
	ID *string
}

Contacts - The contacts for the vault certificates.

func (Contacts) MarshalJSON

func (c Contacts) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Contacts.

func (*Contacts) UnmarshalJSON

func (c *Contacts) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Contacts.

type CreateCertificateOptions

type CreateCertificateOptions struct {
}

CreateCertificateOptions contains the optional parameters for the Client.CreateCertificate method.

type CreateCertificateParameters

type CreateCertificateParameters struct {
	// The attributes of the certificate (optional).
	CertificateAttributes *CertificateAttributes

	// The management policy for the certificate.
	CertificatePolicy *CertificatePolicy

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

CreateCertificateParameters - The certificate create parameters.

func (CreateCertificateParameters) MarshalJSON

func (c CreateCertificateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateCertificateParameters.

func (*CreateCertificateParameters) UnmarshalJSON

func (c *CreateCertificateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateCertificateParameters.

type CreateCertificateResponse

type CreateCertificateResponse struct {
	// A certificate operation is returned in case of asynchronous requests.
	CertificateOperation
}

CreateCertificateResponse contains the response from method Client.CreateCertificate.

type CurveName added in v0.11.0

type CurveName string

CurveName - Elliptic curve name.

const (
	CurveNameP256  CurveName = "P-256"
	CurveNameP256K CurveName = "P-256K"
	CurveNameP384  CurveName = "P-384"
	CurveNameP521  CurveName = "P-521"
)

func PossibleCurveNameValues added in v0.11.0

func PossibleCurveNameValues() []CurveName

PossibleCurveNameValues returns the possible values for the CurveName const type.

type DeleteCertificateOperationOptions

type DeleteCertificateOperationOptions struct {
}

DeleteCertificateOperationOptions contains the optional parameters for the Client.DeleteCertificateOperation method.

type DeleteCertificateOperationResponse

type DeleteCertificateOperationResponse struct {
	// A certificate operation is returned in case of asynchronous requests.
	CertificateOperation
}

DeleteCertificateOperationResponse contains the response from method Client.DeleteCertificateOperation.

type DeleteCertificateOptions

type DeleteCertificateOptions struct {
}

DeleteCertificateOptions contains the optional parameters for the Client.DeleteCertificate method.

type DeleteCertificateResponse

type DeleteCertificateResponse struct {
	// A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be
	// purged.
	DeletedCertificate
}

DeleteCertificateResponse contains the response from method Client.DeleteCertificate.

type DeleteContactsOptions added in v0.11.0

type DeleteContactsOptions struct {
}

DeleteContactsOptions contains the optional parameters for the Client.DeleteContacts method.

type DeleteContactsResponse added in v0.11.0

type DeleteContactsResponse struct {
	// The contacts for the vault certificates.
	Contacts
}

DeleteContactsResponse contains the response from method Client.DeleteContacts.

type DeleteIssuerOptions added in v0.11.0

type DeleteIssuerOptions struct {
}

DeleteIssuerOptions contains the optional parameters for the Client.DeleteIssuer method.

type DeleteIssuerResponse added in v0.11.0

type DeleteIssuerResponse struct {
	// The issuer for Key Vault certificate.
	Issuer
}

DeleteIssuerResponse contains the response from method Client.DeleteIssuer.

type DeletedCertificate added in v0.11.0

type DeletedCertificate struct {
	// The certificate attributes.
	Attributes *CertificateAttributes

	// CER contents of x509 certificate.
	CER []byte

	// The content type of the secret. eg. 'application/x-pem-file' or 'application/x-pkcs12',
	ContentType *string

	// The url of the recovery object, used to identify and recover the deleted certificate.
	RecoveryID *string

	// Application specific metadata in the form of key-value pairs
	Tags map[string]*string

	// READ-ONLY; The time when the certificate was deleted, in UTC
	DeletedDate *time.Time

	// READ-ONLY; The certificate id.
	ID *ID

	// READ-ONLY; The key id.
	KID *ID

	// READ-ONLY; The management policy.
	Policy *CertificatePolicy

	// READ-ONLY; The secret id.
	SID *ID

	// READ-ONLY; The time when the certificate is scheduled to be purged, in UTC
	ScheduledPurgeDate *time.Time

	// READ-ONLY; Thumbprint of the certificate.
	X509Thumbprint []byte
}

DeletedCertificate - A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged.

func (DeletedCertificate) MarshalJSON added in v0.11.0

func (d DeletedCertificate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedCertificate.

func (*DeletedCertificate) UnmarshalJSON added in v0.11.0

func (d *DeletedCertificate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedCertificate.

type DeletedCertificateProperties added in v0.11.0

type DeletedCertificateProperties struct {
	// The certificate management attributes.
	Attributes *CertificateAttributes

	// Certificate identifier.
	ID *ID

	// The url of the recovery object, used to identify and recover the deleted certificate.
	RecoveryID *string

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string

	// Thumbprint of the certificate.
	X509Thumbprint []byte

	// READ-ONLY; The time when the certificate was deleted, in UTC
	DeletedDate *time.Time

	// READ-ONLY; The time when the certificate is scheduled to be purged, in UTC
	ScheduledPurgeDate *time.Time
}

DeletedCertificateProperties - The deleted certificate item containing metadata about the deleted certificate.

func (DeletedCertificateProperties) MarshalJSON added in v0.11.0

func (d DeletedCertificateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedCertificateProperties.

func (*DeletedCertificateProperties) UnmarshalJSON added in v0.11.0

func (d *DeletedCertificateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedCertificateProperties.

type DeletedCertificatePropertiesListResult added in v0.11.0

type DeletedCertificatePropertiesListResult struct {
	// READ-ONLY; The URL to get the next set of deleted certificates.
	NextLink *string

	// READ-ONLY; A response message containing a list of deleted certificates in the vault along with a link to the next page
	// of deleted certificates
	Value []*DeletedCertificateProperties
}

DeletedCertificatePropertiesListResult - A list of certificates that have been deleted in this vault.

func (DeletedCertificatePropertiesListResult) MarshalJSON added in v0.11.0

func (d DeletedCertificatePropertiesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedCertificatePropertiesListResult.

func (*DeletedCertificatePropertiesListResult) UnmarshalJSON added in v0.11.0

func (d *DeletedCertificatePropertiesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedCertificatePropertiesListResult.

type ErrorInfo

type ErrorInfo struct {
	// REQUIRED; A machine readable error code.
	Code string
	// contains filtered or unexported fields
}

ErrorInfo - Internal error from Azure Key Vault server.

func (*ErrorInfo) Error

func (e *ErrorInfo) Error() string

Error implements a custom error for type ErrorInfo. Returns full error message

func (*ErrorInfo) UnmarshalJSON

func (e *ErrorInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorInfo.

type GetCertificateOperationOptions

type GetCertificateOperationOptions struct {
}

GetCertificateOperationOptions contains the optional parameters for the Client.GetCertificateOperation method.

type GetCertificateOperationResponse

type GetCertificateOperationResponse struct {
	// A certificate operation is returned in case of asynchronous requests.
	CertificateOperation
}

GetCertificateOperationResponse contains the response from method Client.GetCertificateOperation.

type GetCertificateOptions

type GetCertificateOptions struct {
}

GetCertificateOptions contains the optional parameters for the Client.GetCertificate method.

type GetCertificatePolicyOptions

type GetCertificatePolicyOptions struct {
}

GetCertificatePolicyOptions contains the optional parameters for the Client.GetCertificatePolicy method.

type GetCertificatePolicyResponse

type GetCertificatePolicyResponse struct {
	// Management policy for a certificate.
	CertificatePolicy
}

GetCertificatePolicyResponse contains the response from method Client.GetCertificatePolicy.

type GetCertificateResponse

type GetCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

GetCertificateResponse contains the response from method Client.GetCertificate.

type GetContactsOptions added in v0.11.0

type GetContactsOptions struct {
}

GetContactsOptions contains the optional parameters for the Client.GetContacts method.

type GetContactsResponse added in v0.11.0

type GetContactsResponse struct {
	// The contacts for the vault certificates.
	Contacts
}

GetContactsResponse contains the response from method Client.GetContacts.

type GetDeletedCertificateOptions

type GetDeletedCertificateOptions struct {
}

GetDeletedCertificateOptions contains the optional parameters for the Client.GetDeletedCertificate method.

type GetDeletedCertificateResponse

type GetDeletedCertificateResponse struct {
	// A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be
	// purged.
	DeletedCertificate
}

GetDeletedCertificateResponse contains the response from method Client.GetDeletedCertificate.

type GetIssuerOptions added in v0.11.0

type GetIssuerOptions struct {
}

GetIssuerOptions contains the optional parameters for the Client.GetIssuer method.

type GetIssuerResponse added in v0.11.0

type GetIssuerResponse struct {
	// The issuer for Key Vault certificate.
	Issuer
}

GetIssuerResponse contains the response from method Client.GetIssuer.

type ID

type ID string

ID is a certificate's unique ID, containing its name and version.

func (*ID) Name

func (i *ID) Name() string

Name of the certificate.

func (*ID) Version

func (i *ID) Version() string

Version of the certificate. Returns an empty string when the ID contains no version.

type ImportCertificateOptions

type ImportCertificateOptions struct {
}

ImportCertificateOptions contains the optional parameters for the Client.ImportCertificate method.

type ImportCertificateParameters

type ImportCertificateParameters struct {
	// REQUIRED; Base64 encoded representation of the certificate object to import. This certificate needs to contain the private
	// key.
	Base64EncodedCertificate *string

	// The attributes of the certificate (optional).
	CertificateAttributes *CertificateAttributes

	// The management policy for the certificate.
	CertificatePolicy *CertificatePolicy

	// If the private key in base64EncodedCertificate is encrypted, the password used for encryption.
	Password *string

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

ImportCertificateParameters - The certificate import parameters.

func (ImportCertificateParameters) MarshalJSON

func (i ImportCertificateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImportCertificateParameters.

func (*ImportCertificateParameters) UnmarshalJSON

func (i *ImportCertificateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImportCertificateParameters.

type ImportCertificateResponse

type ImportCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

ImportCertificateResponse contains the response from method Client.ImportCertificate.

type Issuer added in v0.11.0

type Issuer struct {
	// Attributes of the issuer object.
	Attributes *IssuerAttributes

	// The credentials to be used for the issuer.
	Credentials *IssuerCredentials

	// Details of the organization as provided to the issuer.
	OrganizationDetails *OrganizationDetails

	// The issuer provider.
	Provider *string

	// READ-ONLY; Identifier for the issuer object.
	ID *string
}

Issuer - The issuer for Key Vault certificate.

func (Issuer) MarshalJSON added in v0.11.0

func (i Issuer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Issuer.

func (*Issuer) UnmarshalJSON added in v0.11.0

func (i *Issuer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Issuer.

type IssuerAttributes

type IssuerAttributes struct {
	// Determines whether the issuer is enabled.
	Enabled *bool

	// READ-ONLY; Creation time in UTC.
	Created *time.Time

	// READ-ONLY; Last updated time in UTC.
	Updated *time.Time
}

IssuerAttributes - The attributes of an issuer managed by the Key Vault service.

func (IssuerAttributes) MarshalJSON

func (i IssuerAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssuerAttributes.

func (*IssuerAttributes) UnmarshalJSON

func (i *IssuerAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssuerAttributes.

type IssuerCredentials

type IssuerCredentials struct {
	// The user name/account name/account id.
	AccountID *string

	// The password/secret/account key.
	Password *string
}

IssuerCredentials - The credentials to be used for the certificate issuer.

func (IssuerCredentials) MarshalJSON

func (i IssuerCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssuerCredentials.

func (*IssuerCredentials) UnmarshalJSON

func (i *IssuerCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssuerCredentials.

type IssuerParameters

type IssuerParameters struct {
	// Indicates if the certificates generated under this policy should be published to certificate transparency logs.
	CertificateTransparency *bool

	// Certificate type as supported by the provider (optional); for example 'OV-SSL', 'EV-SSL'
	CertificateType *string

	// Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'.
	Name *string
}

IssuerParameters - Parameters for the issuer of the X509 component of a certificate.

func (IssuerParameters) MarshalJSON

func (i IssuerParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssuerParameters.

func (*IssuerParameters) UnmarshalJSON

func (i *IssuerParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssuerParameters.

type IssuerProperties added in v0.11.0

type IssuerProperties struct {
	// Certificate Identifier.
	ID *string

	// The issuer provider.
	Provider *string
}

IssuerProperties - The certificate issuer item containing certificate issuer metadata.

func (IssuerProperties) MarshalJSON added in v0.11.0

func (i IssuerProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssuerProperties.

func (*IssuerProperties) UnmarshalJSON added in v0.11.0

func (i *IssuerProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssuerProperties.

type IssuerPropertiesListResult added in v0.11.0

type IssuerPropertiesListResult struct {
	// READ-ONLY; The URL to get the next set of certificate issuers.
	NextLink *string

	// READ-ONLY; A response message containing a list of certificate issuers in the key vault along with a link to the next page
	// of certificate issuers.
	Value []*IssuerProperties
}

IssuerPropertiesListResult - The certificate issuer list result.

func (IssuerPropertiesListResult) MarshalJSON added in v0.11.0

func (i IssuerPropertiesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IssuerPropertiesListResult.

func (*IssuerPropertiesListResult) UnmarshalJSON added in v0.11.0

func (i *IssuerPropertiesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IssuerPropertiesListResult.

type KeyProperties

type KeyProperties struct {
	// Elliptic curve name.
	Curve *CurveName

	// Indicates if the private key can be exported. Release policy must be provided when creating the first version of an exportable
	// key.
	Exportable *bool

	// The key size in bits. For example: 2048, 3072, or 4096 for RSA.
	KeySize *int32

	// The type of key pair to be used for the certificate.
	KeyType *KeyType

	// Indicates if the same key pair will be used on certificate renewal.
	ReuseKey *bool
}

KeyProperties - Properties of the key pair backing a certificate.

func (KeyProperties) MarshalJSON

func (k KeyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyProperties.

func (*KeyProperties) UnmarshalJSON

func (k *KeyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyProperties.

type KeyType added in v0.11.0

type KeyType string

KeyType - The type of key pair to be used for the certificate.

const (
	KeyTypeEC     KeyType = "EC"
	KeyTypeECHSM  KeyType = "EC-HSM"
	KeyTypeOct    KeyType = "oct"
	KeyTypeOctHSM KeyType = "oct-HSM"
	KeyTypeRSA    KeyType = "RSA"
	KeyTypeRSAHSM KeyType = "RSA-HSM"
)

func PossibleKeyTypeValues added in v0.11.0

func PossibleKeyTypeValues() []KeyType

PossibleKeyTypeValues returns the possible values for the KeyType const type.

type KeyUsageType

type KeyUsageType string

KeyUsageType - Defines how the certificate's key may be used.

const (
	KeyUsageTypeCRLSign          KeyUsageType = "cRLSign"
	KeyUsageTypeDataEncipherment KeyUsageType = "dataEncipherment"
	KeyUsageTypeDecipherOnly     KeyUsageType = "decipherOnly"
	KeyUsageTypeDigitalSignature KeyUsageType = "digitalSignature"
	KeyUsageTypeEncipherOnly     KeyUsageType = "encipherOnly"
	KeyUsageTypeKeyAgreement     KeyUsageType = "keyAgreement"
	KeyUsageTypeKeyCertSign      KeyUsageType = "keyCertSign"
	KeyUsageTypeKeyEncipherment  KeyUsageType = "keyEncipherment"
	KeyUsageTypeNonRepudiation   KeyUsageType = "nonRepudiation"
)

func PossibleKeyUsageTypeValues

func PossibleKeyUsageTypeValues() []KeyUsageType

PossibleKeyUsageTypeValues returns the possible values for the KeyUsageType const type.

type LifetimeAction

type LifetimeAction struct {
	// The action that will be executed.
	Action *LifetimeActionType

	// The condition that will execute the action.
	Trigger *LifetimeActionTrigger
}

LifetimeAction - Action and its trigger that will be performed by Key Vault over the lifetime of a certificate.

func (LifetimeAction) MarshalJSON

func (l LifetimeAction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LifetimeAction.

func (*LifetimeAction) UnmarshalJSON

func (l *LifetimeAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeAction.

type LifetimeActionTrigger added in v0.11.0

type LifetimeActionTrigger struct {
	// Days before expiry to attempt renewal. Value should be between 1 and validityinmonths multiplied by 27. If validityinmonths
	// is 36, then value should be between 1 and 972 (36 * 27).
	DaysBeforeExpiry *int32

	// Percentage of lifetime at which to trigger. Value should be between 1 and 99.
	LifetimePercentage *int32
}

LifetimeActionTrigger - A condition to be satisfied for an action to be executed.

func (LifetimeActionTrigger) MarshalJSON added in v0.11.0

func (l LifetimeActionTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LifetimeActionTrigger.

func (*LifetimeActionTrigger) UnmarshalJSON added in v0.11.0

func (l *LifetimeActionTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionTrigger.

type LifetimeActionType added in v0.11.0

type LifetimeActionType struct {
	// The type of the action.
	ActionType *CertificatePolicyAction
}

LifetimeActionType - The action that will be executed.

func (LifetimeActionType) MarshalJSON added in v0.11.0

func (l LifetimeActionType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LifetimeActionType.

func (*LifetimeActionType) UnmarshalJSON added in v0.11.0

func (l *LifetimeActionType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeActionType.

type ListCertificatePropertiesOptions added in v0.11.0

type ListCertificatePropertiesOptions struct {
	// Specifies whether to include certificates which are not completely provisioned.
	IncludePending *bool
}

ListCertificatePropertiesOptions contains the optional parameters for the Client.NewListCertificatePropertiesPager method.

type ListCertificatePropertiesResponse added in v0.11.0

type ListCertificatePropertiesResponse struct {
	// The certificate list result.
	CertificatePropertiesListResult
}

ListCertificatePropertiesResponse contains the response from method Client.NewListCertificatePropertiesPager.

type ListCertificatePropertiesVersionsOptions added in v0.11.0

type ListCertificatePropertiesVersionsOptions struct {
}

ListCertificatePropertiesVersionsOptions contains the optional parameters for the Client.NewListCertificatePropertiesVersionsPager method.

type ListCertificatePropertiesVersionsResponse added in v0.11.0

type ListCertificatePropertiesVersionsResponse struct {
	// The certificate list result.
	CertificatePropertiesListResult
}

ListCertificatePropertiesVersionsResponse contains the response from method Client.NewListCertificatePropertiesVersionsPager.

type ListDeletedCertificatePropertiesOptions added in v0.11.0

type ListDeletedCertificatePropertiesOptions struct {
	// Specifies whether to include certificates which are not completely provisioned.
	IncludePending *bool
}

ListDeletedCertificatePropertiesOptions contains the optional parameters for the Client.NewListDeletedCertificatePropertiesPager method.

type ListDeletedCertificatePropertiesResponse added in v0.11.0

type ListDeletedCertificatePropertiesResponse struct {
	// A list of certificates that have been deleted in this vault.
	DeletedCertificatePropertiesListResult
}

ListDeletedCertificatePropertiesResponse contains the response from method Client.NewListDeletedCertificatePropertiesPager.

type ListIssuerPropertiesOptions added in v0.11.0

type ListIssuerPropertiesOptions struct {
}

ListIssuerPropertiesOptions contains the optional parameters for the Client.NewListIssuerPropertiesPager method.

type ListIssuerPropertiesResponse added in v0.11.0

type ListIssuerPropertiesResponse struct {
	// The certificate issuer list result.
	IssuerPropertiesListResult
}

ListIssuerPropertiesResponse contains the response from method Client.NewListIssuerPropertiesPager.

type MergeCertificateOptions

type MergeCertificateOptions struct {
}

MergeCertificateOptions contains the optional parameters for the Client.MergeCertificate method.

type MergeCertificateParameters

type MergeCertificateParameters struct {
	// REQUIRED; The certificate or the certificate chain to merge.
	X509Certificates [][]byte

	// The attributes of the certificate (optional).
	CertificateAttributes *CertificateAttributes

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

MergeCertificateParameters - The certificate merge parameters

func (MergeCertificateParameters) MarshalJSON

func (m MergeCertificateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MergeCertificateParameters.

func (*MergeCertificateParameters) UnmarshalJSON

func (m *MergeCertificateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MergeCertificateParameters.

type MergeCertificateResponse

type MergeCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

MergeCertificateResponse contains the response from method Client.MergeCertificate.

type OrganizationDetails

type OrganizationDetails struct {
	// Details of the organization administrator.
	AdminContacts []*AdministratorContact

	// Id of the organization.
	ID *string
}

OrganizationDetails - Details of the organization of the certificate issuer.

func (OrganizationDetails) MarshalJSON

func (o OrganizationDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OrganizationDetails.

func (*OrganizationDetails) UnmarshalJSON

func (o *OrganizationDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OrganizationDetails.

type PurgeDeletedCertificateOptions

type PurgeDeletedCertificateOptions struct {
}

PurgeDeletedCertificateOptions contains the optional parameters for the Client.PurgeDeletedCertificate method.

type PurgeDeletedCertificateResponse

type PurgeDeletedCertificateResponse struct {
}

PurgeDeletedCertificateResponse contains the response from method Client.PurgeDeletedCertificate.

type RecoverDeletedCertificateOptions

type RecoverDeletedCertificateOptions struct {
}

RecoverDeletedCertificateOptions contains the optional parameters for the Client.RecoverDeletedCertificate method.

type RecoverDeletedCertificateResponse

type RecoverDeletedCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

RecoverDeletedCertificateResponse contains the response from method Client.RecoverDeletedCertificate.

type RestoreCertificateOptions

type RestoreCertificateOptions struct {
}

RestoreCertificateOptions contains the optional parameters for the Client.RestoreCertificate method.

type RestoreCertificateParameters

type RestoreCertificateParameters struct {
	// REQUIRED; The backup blob associated with a certificate bundle.
	CertificateBackup []byte
}

RestoreCertificateParameters - The certificate restore parameters.

func (RestoreCertificateParameters) MarshalJSON

func (r RestoreCertificateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RestoreCertificateParameters.

func (*RestoreCertificateParameters) UnmarshalJSON

func (r *RestoreCertificateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RestoreCertificateParameters.

type RestoreCertificateResponse

type RestoreCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

RestoreCertificateResponse contains the response from method Client.RestoreCertificate.

type SecretProperties

type SecretProperties struct {
	// The media type (MIME type).
	ContentType *string
}

SecretProperties - Properties of the key backing a certificate.

func (SecretProperties) MarshalJSON

func (s SecretProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SecretProperties.

func (*SecretProperties) UnmarshalJSON

func (s *SecretProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties.

type SetContactsOptions added in v0.11.0

type SetContactsOptions struct {
}

SetContactsOptions contains the optional parameters for the Client.SetContacts method.

type SetContactsResponse added in v0.11.0

type SetContactsResponse struct {
	// The contacts for the vault certificates.
	Contacts
}

SetContactsResponse contains the response from method Client.SetContacts.

type SetIssuerOptions added in v0.11.0

type SetIssuerOptions struct {
}

SetIssuerOptions contains the optional parameters for the Client.SetIssuer method.

type SetIssuerParameters added in v0.11.0

type SetIssuerParameters struct {
	// REQUIRED; The issuer provider.
	Provider *string

	// Attributes of the issuer object.
	Attributes *IssuerAttributes

	// The credentials to be used for the issuer.
	Credentials *IssuerCredentials

	// Details of the organization as provided to the issuer.
	OrganizationDetails *OrganizationDetails
}

SetIssuerParameters - The certificate issuer set parameters.

func (SetIssuerParameters) MarshalJSON added in v0.11.0

func (s SetIssuerParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SetIssuerParameters.

func (*SetIssuerParameters) UnmarshalJSON added in v0.11.0

func (s *SetIssuerParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SetIssuerParameters.

type SetIssuerResponse added in v0.11.0

type SetIssuerResponse struct {
	// The issuer for Key Vault certificate.
	Issuer
}

SetIssuerResponse contains the response from method Client.SetIssuer.

type SubjectAlternativeNames

type SubjectAlternativeNames struct {
	// Domain names.
	DNSNames []*string

	// Email addresses.
	Emails []*string

	// User principal names.
	UserPrincipalNames []*string
}

SubjectAlternativeNames - The subject alternate names of a X509 object.

func (SubjectAlternativeNames) MarshalJSON

func (s SubjectAlternativeNames) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SubjectAlternativeNames.

func (*SubjectAlternativeNames) UnmarshalJSON

func (s *SubjectAlternativeNames) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubjectAlternativeNames.

type UpdateCertificateOperationOptions

type UpdateCertificateOperationOptions struct {
}

UpdateCertificateOperationOptions contains the optional parameters for the Client.UpdateCertificateOperation method.

type UpdateCertificateOperationParameter

type UpdateCertificateOperationParameter struct {
	// REQUIRED; Indicates if cancellation was requested on the certificate operation.
	CancellationRequested *bool
}

UpdateCertificateOperationParameter - The certificate operation update parameters.

func (UpdateCertificateOperationParameter) MarshalJSON

func (u UpdateCertificateOperationParameter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateCertificateOperationParameter.

func (*UpdateCertificateOperationParameter) UnmarshalJSON

func (u *UpdateCertificateOperationParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateCertificateOperationParameter.

type UpdateCertificateOperationResponse

type UpdateCertificateOperationResponse struct {
	// A certificate operation is returned in case of asynchronous requests.
	CertificateOperation
}

UpdateCertificateOperationResponse contains the response from method Client.UpdateCertificateOperation.

type UpdateCertificateOptions

type UpdateCertificateOptions struct {
}

UpdateCertificateOptions contains the optional parameters for the Client.UpdateCertificate method.

type UpdateCertificateParameters

type UpdateCertificateParameters struct {
	// The attributes of the certificate (optional).
	CertificateAttributes *CertificateAttributes

	// The management policy for the certificate.
	CertificatePolicy *CertificatePolicy

	// Application specific metadata in the form of key-value pairs.
	Tags map[string]*string
}

UpdateCertificateParameters - The certificate update parameters.

func (UpdateCertificateParameters) MarshalJSON

func (u UpdateCertificateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateCertificateParameters.

func (*UpdateCertificateParameters) UnmarshalJSON

func (u *UpdateCertificateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateCertificateParameters.

type UpdateCertificatePolicyOptions

type UpdateCertificatePolicyOptions struct {
}

UpdateCertificatePolicyOptions contains the optional parameters for the Client.UpdateCertificatePolicy method.

type UpdateCertificatePolicyResponse

type UpdateCertificatePolicyResponse struct {
	// Management policy for a certificate.
	CertificatePolicy
}

UpdateCertificatePolicyResponse contains the response from method Client.UpdateCertificatePolicy.

type UpdateCertificateResponse

type UpdateCertificateResponse struct {
	// A certificate bundle consists of a certificate (X509) plus its attributes.
	Certificate
}

UpdateCertificateResponse contains the response from method Client.UpdateCertificate.

type UpdateIssuerOptions added in v0.11.0

type UpdateIssuerOptions struct {
}

UpdateIssuerOptions contains the optional parameters for the Client.UpdateIssuer method.

type UpdateIssuerParameters added in v0.11.0

type UpdateIssuerParameters struct {
	// Attributes of the issuer object.
	Attributes *IssuerAttributes

	// The credentials to be used for the issuer.
	Credentials *IssuerCredentials

	// Details of the organization as provided to the issuer.
	OrganizationDetails *OrganizationDetails

	// The issuer provider.
	Provider *string
}

UpdateIssuerParameters - The certificate issuer update parameters.

func (UpdateIssuerParameters) MarshalJSON added in v0.11.0

func (u UpdateIssuerParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateIssuerParameters.

func (*UpdateIssuerParameters) UnmarshalJSON added in v0.11.0

func (u *UpdateIssuerParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateIssuerParameters.

type UpdateIssuerResponse added in v0.11.0

type UpdateIssuerResponse struct {
	// The issuer for Key Vault certificate.
	Issuer
}

UpdateIssuerResponse contains the response from method Client.UpdateIssuer.

type X509CertificateProperties

type X509CertificateProperties struct {
	// The enhanced key usage.
	EnhancedKeyUsage []*string

	// Defines how the certificate's key may be used.
	KeyUsage []*KeyUsageType

	// The subject name. Should be a valid X509 distinguished Name.
	Subject *string

	// The subject alternative names.
	SubjectAlternativeNames *SubjectAlternativeNames

	// The duration that the certificate is valid in months.
	ValidityInMonths *int32
}

X509CertificateProperties - Properties of the X509 component of a certificate.

func (X509CertificateProperties) MarshalJSON

func (x X509CertificateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type X509CertificateProperties.

func (*X509CertificateProperties) UnmarshalJSON

func (x *X509CertificateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type X509CertificateProperties.

Jump to

Keyboard shortcuts

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