// itemToCertAuthority attempts to decode the supplied `backend.Item` as
// a certificate authority resource (NOTE: does not filter secrets).
itemToCertAuthority attempts to decode the supplied `backend.Item` as
a certificate authority resource (NOTE: does not filter secrets).
// itemToCertAuthority attempts to decode the supplied ` backend . Item ` as // a certificate authority resource ( NOTE : does not filter secrets ) .
func itemToCertAuthority(item backend.Item) (services.CertAuthority, error) {
	ca, err := services.GetCertAuthorityMarshaler().UnmarshalCertAuthority(
		item.Value,
		services.WithResourceID(item.ID),
		services.WithExpires(item.Expires),
	)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	if err := services.ValidateCertAuthority(ca); err != nil {
		return nil, trace.Wrap(err)
	}
	return ca, nil
}
func itemToCertAuthority ( item backend . Item ) ( services . CertAuthority , error ) { ca , err := services . GetCertAuthorityMarshaler ( ) . UnmarshalCertAuthority ( item . Value , services . WithResourceID ( item . ID ) , services . WithExpires ( item . Expires ) , ) if err != nil { return nil , trace . Wrap ( err ) } if err := services . ValidateCertAuthority ( ca ) ; err != nil { return nil , trace . Wrap ( err ) } return ca , nil }
itemToCertAuthority attempts to decode the supplied `backend.Item` as
a certificate authority resource (NOTE: does not filter secrets).
itemToCertAuthority attempts to decode the supplied ` backend . Item ` as a certificate authority resource ( NOTE : does not filter secrets ) .