code: func EntityFromSecring(keyID, keyFile string) (*openpgp.Entity, error) {
  	if keyID == "" {
  		return nil, errors.New("empty keyID passed to EntityFromSecring")
  	}
  	keyID = strings.ToUpper(keyID)
  	if keyFile == "" {
  		keyFile = osutil.SecretRingFile()
  	}
  	secring, err := wkfs.Open(keyFile)
  	if err != nil {
  		return nil, fmt.Errorf("jsonsign: failed to open keyring: %v", err)
  	}
  	defer secring.Close()
  
  	el, err := openpgp.ReadKeyRing(secring)
  	if err != nil {
  		return nil, fmt.Errorf("openpgp.ReadKeyRing of %q: %v", keyFile, err)
  	}
  	var entity *openpgp.Entity
  	for _, e := range el {
  		pk := e.PrivateKey
  		if pk == nil || (pk.KeyIdString() != keyID && pk.KeyIdShortString() != keyID) {
  			continue
  		}
  		entity = e
  	}
  	if entity == nil {
  		found := []string{}
  		for _, e := range el {
  			pk := e.PrivateKey
  			if pk == nil {
  				continue
  			}
  			found = append(found, pk.KeyIdShortString())
  		}
  		return nil, fmt.Errorf("didn't find a key in %q for keyID %q; other keyIDs in file = %v", keyFile, keyID, found)
  	}
  	return entity, nil
  }
docs: // EntityFromSecring returns the openpgp Entity from keyFile that matches keyID.
  // If empty, keyFile defaults to osutil.SecretRingFile().