Formatting The Output Files & Matching Keys

I have the following 2 output files, one contain the standard output after i decrypt the encrypted file and another keys listed from the gpg trust db,

Provider File:

gpg: encrypted with 2048-bit RSA key, ID 96301328, created 2014-04-29
      "JKL <400@abc.com>"
gpg: encrypted with 2048-bit ELG-E key, ID ECB614CF, created 2002-02-06
      "GHI <300@abc.com>"
gpg: encrypted with 2048-bit ELG-E key, ID 1EB07C50, created 2014-02-20
      "ABC <100@abc.com>"
gpg: WARNING: message was not integrity protected

GPG Public Keys:

pub   1024D/17CD2890 2014-02-20
uid                  ABC <100@abc.com>
sub   2048g/1EB07C50 2014-02-20

pub   2048D/8911CBCA 2014-04-03
uid                  DEF <200@abc.com>
sub   2048g/F0E4D9C3 2014-04-03

pub   1024D/CB26F4C3 2002-02-06
uid                  GHI <300@abc.com>
sub   2048g/ECB614CF 2002-02-06

pub   2048R/547A8D75 2014-04-29
uid                  JKL <400@abc.com>
sub   2048R/96301328 2014-04-29

My requirements
1) After i decrypt the file i need to make sure there are three keys embedded or used to encrypt the file, i have to get the count from the file decryption output as shown in "Provider File" excerpt above.
2) I have to search for appropriate UID's and take the corresponding values 96301328,ECB614CF,1EB07C50 from "Provider File" and match those values with "GPG Public Keys" file and email out which key is different and associated email id.

For 1, i have following snippet awk -F"[<>]" '/@/ {L++ ; print $2} END{print L+0}' from a friend but how do i supress the email id's and just print only count?
For 2, I am still working on it?

Appreciate your inputs please help.

This sounds a lot like homework... I mean the fix to your friend's awk is trivial. Look at what happens after L++ (remove it)

Using the small sample base, this might work:

awk 'gsub(/ *ID */,""){T[$2];print $2;next} gsub(/^uid */,"") {UID=$0} {for (i in T) if ($0~i) print UID} ' FS=, file1 file2
96301328
ECB614CF
1EB07C50
ABC <100@abc.com>
GHI <300@abc.com>
JKL <400@abc.com>