// itemFromCertAuthority attempts to encode the supplied certificate authority
// as an instance of `backend.Item` suitable for storage.
itemFromCertAuthority attempts to encode the supplied certificate authority
as an instance of `backend.Item` suitable for storage.
// itemFromCertAuthority attempts to encode the supplied certificate authority // as an instance of ` backend . Item ` suitable for storage .
func itemFromCertAuthority(ca services.CertAuthority) (*backend.Item, error) {
	if err := services.ValidateCertAuthority(ca); err != nil {
		return nil, trace.Wrap(err)
	}
	value, err := services.GetCertAuthorityMarshaler().MarshalCertAuthority(ca)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	item := &backend.Item{
		Key:     backend.Key(authoritiesPrefix, string(ca.GetType()), ca.GetName()),
		Value:   value,
		Expires: ca.Expiry(),
		ID:      ca.GetResourceID(),
	}
	return item, nil
}
func itemFromCertAuthority ( ca services . CertAuthority ) ( * backend . Item , error ) { if err := services . ValidateCertAuthority ( ca ) ; err != nil { return nil , trace . Wrap ( err ) } value , err := services . GetCertAuthorityMarshaler ( ) . MarshalCertAuthority ( ca ) if err != nil { return nil , trace . Wrap ( err ) } item := & backend . Item { Key : backend . Key ( authoritiesPrefix , string ( ca . GetType ( ) ) , ca . GetName ( ) ) , Value : value , Expires : ca . Expiry ( ) , ID : ca . GetResourceID ( ) , } return item , nil }
itemFromCertAuthority attempts to encode the supplied certificate authority
as an instance of `backend.Item` suitable for storage.
itemFromCertAuthority attempts to encode the supplied certificate authority as an instance of ` backend . Item ` suitable for storage .