code: func WriteKey(pkiPath, name string, key crypto.Signer) error {
  	if key == nil {
  		return errors.New("private key cannot be nil when writing to file")
  	}
  
  	privateKeyPath := pathForKey(pkiPath, name)
  	encoded, err := keyutil.MarshalPrivateKeyToPEM(key)
  	if err != nil {
  		return errors.Wrapf(err, "unable to marshal private key to PEM")
  	}
  	if err := keyutil.WriteKey(privateKeyPath, encoded); err != nil {
  		return errors.Wrapf(err, "unable to write private key to file %s", privateKeyPath)
  	}
  
  	return nil
  }
docs: // WriteKey stores the given key at the given location