code: func (p *ProcessStorage) WriteIdentity(name string, id Identity) error {
  	res := IdentityV2{
  		ResourceHeader: services.ResourceHeader{
  			Kind:    services.KindIdentity,
  			Version: services.V2,
  			Metadata: services.Metadata{
  				Name: name,
  			},
  		},
  		Spec: IdentitySpecV2{
  			Key:        id.KeyBytes,
  			SSHCert:    id.CertBytes,
  			TLSCert:    id.TLSCertBytes,
  			TLSCACerts: id.TLSCACertsBytes,
  			SSHCACerts: id.SSHCACertBytes,
  		},
  	}
  	if err := res.CheckAndSetDefaults(); err != nil {
  		return trace.Wrap(err)
  	}
  	value, err := json.Marshal(res)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	item := backend.Item{
  		Key:   backend.Key(idsPrefix, strings.ToLower(id.ID.Role.String()), name),
  		Value: value,
  	}
  	_, err = p.Put(context.TODO(), item)
  	return trace.Wrap(err)
  }
docs: // WriteIdentity writes identity to the backend.