code: func WritePublicKey(pkiPath, name string, key crypto.PublicKey) error {
  	if key == nil {
  		return errors.New("public key cannot be nil when writing to file")
  	}
  
  	publicKeyBytes, err := EncodePublicKeyPEM(key)
  	if err != nil {
  		return err
  	}
  	publicKeyPath := pathForPublicKey(pkiPath, name)
  	if err := keyutil.WriteKey(publicKeyPath, publicKeyBytes); err != nil {
  		return errors.Wrapf(err, "unable to write public key to file %s", publicKeyPath)
  	}
  
  	return nil
  }
docs: // WritePublicKey stores the given public key at the given location