Skip to content
Start here

Download current certificate in PEM format

client.ZeroTrust.Access.SAMLCertificates.GetPem(ctx, samlCERTSetID, query) (*Response, error)
GET/accounts/{account_id}/access/saml_certificates/{saml_cert_set_id}/pem

Downloads the current SAML encryption certificate’s public key in PEM format for the specified certificate set. This endpoint is useful for providing the certificate to Identity Providers for SAML assertion encryption configuration.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
samlCERTSetID string

UUID.

maxLength36
query AccessSAMLCertificateGetPemParams
AccountID param.Field[string]

Identifier.

maxLength32
ReturnsExpand Collapse
type AccessSAMLCertificateGetPemResponse interface{…}

Download current certificate in PEM format

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.ZeroTrust.Access.SAMLCertificates.GetPem(
    context.TODO(),
    "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    zero_trust.AccessSAMLCertificateGetPemParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
Returns Examples