Problem with BcPGPPublicKeyRingCollection

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with BcPGPPublicKeyRingCollection

Rolf.Kremer@t-online.de
Hello all,
 
we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.

From a client we got a specific PGP public key with which we get this error message:

"org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"

The error occurrs in the function BcPGPPublicKeyRingCollection:

"pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"

Our code:

private void read(byte[] bytes) throws GRPPGPException {
  ByteArrayInputStream in = new ByteArrayInputStream(bytes);
   in.mark(bytes.length);
 
   try {
     skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
     if ( (skr != null) && skr.getKeyRings().hasNext()){
     // Must be secret ring
        isSecret = true;
       return;
    }
    // XXX Mind the (null)! This is not a secret key ring
 } catch (EOFException se) {
    //log.error("", se);
 } catch (IOException e) {
    IOHelper.closeQuietly(in);
    log.error("", e);
    throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
 } catch (PGPException e) {
    log.debug("Not a PGP secret key ring! Reading as public key ring ...");
 }
try {
   in.reset();
   pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
   if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
      isSecret = false;
      return;
   }
   // This is not a public key ring
      throw new PGPException("No public keys found in keyring!");
   } catch (IOException e) {
      throw new GRPPGPException("I/O error while parsing Public key ring!", e);
   } catch (PGPException e) {
      // final attempt failed
      throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
      + "Key ring will not be opened.", e);
   } finally {
      IOHelper.closeQuietly(in);
   }
}

Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.

We have also tested with PGPPublicKeyRingCollection, but with the same result.

We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.

Does anybody have an idea what could be the cause for the error?

Thanks in advanced!

Kind regards
Rolf
 


Reply | Threaded
Open this post in threaded view
|

RE: Problem with BcPGPPublicKeyRingCollection

Eckenfels. Bernd
Hello,

Can you dump the file with a PgPdumper like `gpg -list-packets`. You could also try to import it into a local gpg keystore and export it from there.

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 12:55
To: [hidden email]
Subject: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello all,

we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.

From a client we got a specific PGP public key with which we get this error message:

"org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"

The error occurrs in the function BcPGPPublicKeyRingCollection:

"pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"

Our code:

private void read(byte[] bytes) throws GRPPGPException {
  ByteArrayInputStream in = new ByteArrayInputStream(bytes);
   in.mark(bytes.length);

   try {
     skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
     if ( (skr != null) && skr.getKeyRings().hasNext()){
     // Must be secret ring
        isSecret = true;
       return;
    }
    // XXX Mind the (null)! This is not a secret key ring
 } catch (EOFException se) {
    //log.error("", se);
 } catch (IOException e) {
    IOHelper.closeQuietly(in);
    log.error("", e);
    throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
 } catch (PGPException e) {
    log.debug("Not a PGP secret key ring! Reading as public key ring ...");
 }
try {
   in.reset();
   pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
   if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
      isSecret = false;
      return;
   }
   // This is not a public key ring
      throw new PGPException("No public keys found in keyring!");
   } catch (IOException e) {
      throw new GRPPGPException("I/O error while parsing Public key ring!", e);
   } catch (PGPException e) {
      // final attempt failed
      throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
      + "Key ring will not be opened.", e);
   } finally {
      IOHelper.closeQuietly(in);
   }
}

Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.

We have also tested with PGPPublicKeyRingCollection, but with the same result.

We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.

Does anybody have an idea what could be the cause for the error?

Thanks in advanced!

Kind regards
Rolf











SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with BcPGPPublicKeyRingCollection

Rolf.Kremer@t-online.de

Hello Bernd,

enclosed the dump of the file:

# off=0 ctb=99 tag=6 hlen=3 plen=269
:public key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: CB065FBDE21CAA7ECB325635FCD9819571AD324094AF45E5D3A3770278B3CEA
6574961CE70B42019478BBD12D42FF4164ACC0CCB9E0240CE84D38A750E8D83408E1D3159DF75DC3
7203DD11D45B79222BE790758040524C3EEA59D916F005983F0AF11097F5EFED3DD2BB49433B0413
F59B48E8F5CB7FA355DC1DA9316E86EAEB5EF57E229EA780DD5EC1EA5847CCA7F4207150084B14CB
460CA99F4D7D16E3638F4201E5ECEF029FBEF4F257594E09D947082ABD461F7AEBB6FCA8206A3B15
330C1BE3E8F098938D7B970B4CDE8BC1FDF37933778073A4EDC0BA690EAE760F65308655B5727E58
BC7664D42DCF3FF397AEB99D9B39F3FB9D2B43274511CCB4D
        pkey[1]: 010001
        keyid: FB7427CEC70D4DBD
# off=272 ctb=b4 tag=13 hlen=2 plen=6
:user ID packet: "dal.de"
# off=280 ctb=89 tag=2 hlen=3 plen=395
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 3f 52
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 25 len 1 (primary user ID)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 63A0D14C029CD4E18B9C6209831F7EF7CB9E2EF59E4A3AFC21A977822EF3D3DA90
06D3E9ECC7B0BBD9D3FF0ADE80B422700E153755D9C93A741B2342AB73054DB65B8044C989A10482
569F71340015F65C6CA488F14B0C8263DC3BB2453F35B650D64FECA7C02BC4A7043B1F37411F3371
E9F581BACD45537B4E9F7FBFD11EA85285242F95C7B62A73CCC73E0D6690124204E6D5B37DA085C9
F0FB1A3E1FEB73BE69A09B7DBDCE9529E2A5D9510ECD64EFD15E079CA8072102C9D2C4EC37263214
B97CEB0C75493AF43DC293D7DF9349C0EEF7155DF3CD79F6E5F6F22F99957ED11339CD8BB2C4C830
3117F673F33CB6AB3C3CC37E2DA494F96BED9253F9A746
# off=678 ctb=b4 tag=13 hlen=2 plen=3
:user ID packet: "DAL"
# off=683 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 80
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 4D5B0D8D9F88DDF97F3B6B8FF3B591A1E99F08AB1FCC54E0BB4498B8B68D5A30BB
6A214AE032B7C186863F6BF475AAAA9FB3B91FCC3DE6C38CB84052447E1A99931393448EE8E4E031
0B743747B6201237FF48999595582C4A2744020E146944FB32B576B52B8CCD68FB87D50ABACF533B
F535970786BEF5CD1A46D60DD3D6DB9737070F8DA8D08F0196A179491F8F7668AEAAE3A710B4DEB0
3F05D0F62B962D049EECC4F6A90C99B0362A1479B73410604B00C053191182B38E865A6B55471897
C449F50035F4B2EE4BF2FE3DCEA819DAC7899265772D24C371D2E0AB98D14E2BAA159D91F0327707
B569D6E45794AF292B4C0727CCC96412A6498A806C7A2F
# off=1078 ctb=b4 tag=13 hlen=2 plen=19
:user ID packet: "dal.de <[hidden email]>"
# off=1099 ctb=89 tag=2 hlen=3 plen=371
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 62 89
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 137720B356990C611BCC059FC016C198ED52F7E5BAA0795C345B718EF663CA14F4
EB204054F4E35944D4BB79366A8E1335DB5476CBD1E2EBDEA010C6F82960FE32D914C5955A605927
F49ED914DE7149560B40771DE6D3E68C8432E9D76592E05AD2637E59F3CAC13D03A5DA12034E4F4F
409B5551155E231B8D27E56F74D5256A1D6F4311956EFE38566ED789DDB0A7EFF2004CAFA2B86284
B3990900C68782E99C57FF035346D42D362AB75FF43C3DF872EF622D9931F7F242AD1D40D60D96A2
44DA825CC161D04D3239D1EC341FA59DCEA6787CE4B521363F86B95DCD5429BCE771491CA47FEB6C
86732EFA41A77D53EC0C28FC8E1FC2C8EA10A75AA210FA
# off=1473 ctb=89 tag=2 hlen=3 plen=1089
:signature packet: algo 100, keyid 0000000000000000
        version 4, created 1477474440, md5len 0, sigclass 0x10
        digest algo gpg: can't handle public key algorithm 100
2, begin of digest 00 00
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 3 len 4 (sig expires after 10y0d0h0m)
        hashed subpkt 5 len 2 (trust signature of depth 255, value 120)
        hashed subpkt 27 len 1 (key flags: 0F)
        hashed subpkt 100 len 1054 (experimental / private subpacket)
        unknown algorithm 100
# off=2565 ctb=b4 tag=13 hlen=2 plen=10
:user ID packet: "dlf-stb.de"
# off=2577 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest c3 f3
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8885E590EB012B5589B89C2B4A8EAF693FFDF07AB319FE574F3AE2BFAD00A67746
6B6F221BB9407B236AFEFB8CFAB625C05E75C1242C5BCAF211DEA46B6A78132416DDF23F326D12DF
DEBD5FE51800F15C75B7B14F1162190CBEF792841B5D149B529A51EAEDCE959E488B3E5CCA99BB5C
86AB3465F0E422D2D4538FAF7A3EAE081DE8679C4B415B60DD11D6B2CF1F0F9669C4A72FAE27EBC5
F72893B30FFF9A36E16DDDB525285CD7EC61181363D5C74727EEB95F168C67F34505B37CD268A901
2C7172DC4042DF3C42976703EE216C5DE92F1975529CA41BF9304BAFC8CE0A6BB8AA6A55C23D29C5
A476033A90E6E8FDC45056485F9C41CB9279BA3E4AC5E4
# off=2972 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "deutsche-ppp.de"
# off=2989 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 43 71
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8C7EEF22C8BE67E27753E1580796BBB11B343C753996CCDFD81B97899840D620B7
13D2EB4A634EF6AE1A3556893DBFA73C5A2E0667E28D7151EF91B59F446ED5F71E431A1FB2284E85
DD55E73DD93CE947B044D565BE77B5ACF6A3D274272E3ED982F9F91DAE3FC289478CD8D44770744E
51388F8D795A16A0C4DBFA5CB7F8AE8735ED5AAF4356C7A164FBC10BC948DB1173903816D2C25FFE
1BFC5F187DF8964B2BCC518046A0A5EB10A4499A2D45C63A8377209C55F52B48312023F6634A5FA0
211B7D3DF14577BB034712B9595A69E647EF0E60C9A86F42DA3D15B01F08061DB218F54CC45FDC09
E22E4EFB556397638FC4D15A1BA4B11063A5880F97AC55
# off=3384 ctb=b4 tag=13 hlen=2 plen=16
:user ID packet: "deutsche-ppp.com"
# off=3402 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 44 aa
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: C8C9150687795F19F5A8DAFD7747E4E00B87965B564489FD4787CF166EF89167B6
AEED31CC22215B8905C8754A88CDD831707E8049610C6E324F86E4FEAAFB7F8BFB4A7A23D11DF17F
5963E6D49906D1F3E3038632A756798DDF2DBBF3B4CEACC41C3963C0247EAC736EF2ADCE177C19C0
2F3368E15B15534866A962DE11D85065B79E77DBA3ED9071593F363DB612F8C06A42415708F3CD34
22E92CF04D754A93EBE5914C4F6FAD14EA58238182C5A4B6A7999E4B8CE5A765F082F35F645B8BCD
1DF09A5ABD6EFFDFC977A676EE192DE2DB752B80EEB9BE8FD1E3D6C301DAF5DC4965DC7C08522394
57CEA6A27A7211638C0E9A4B18BFC5EA6DB2F2D34D4C47
# off=3797 ctb=b4 tag=13 hlen=2 plen=13
:user ID packet: "dal-polska.pl"
# off=3812 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 7e
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 9D20EB63166C795D6304958A6CADDB051955B57C856BB78783C925CDA3E856CE09
F2D333FBAFBD3D95370016D8A682BC473320980722408A780853C029DC6C40D888DC1042576A69AA
F4F05356D84F726F7F29C3BB5B98C0E6BD3D0A7C69D28F331BDDDC28D24EB7B28410F89209EF9AA0
C9694A4FA5045A2C135CDD757067831E548AA555D8FF3CE175DC96B03A5592979A54F7296599113C
626DBD41B88C4BDA2CF4056AC4E179C4F4BA3886F99B44ADFDE1B73337B43EC7A94D778C3E33A400
4ECE4C7ACB3CC2221A077B784EE72294DCD98032026F8920167E1A0651FC832B98D2950BC6229593
5B7296D45C1F3AB3A24EDB9548D451652347A375295270
# off=4207 ctb=b4 tag=13 hlen=2 plen=14
:user ID packet: "dal-romania.ro"
# off=4223 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest bd a6
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: BDDA560AF0F259F77FE378ABC897FBBA8DC6FCE607B3C527CB936AD87A8D95D06C
098ED366332E4958AB433AAA9A9A92CFF1FF2717D9229AC91E1BCBA8B1C97041912E36009AB93C29
A81928240DE343C3AF5B21F849E0F1148B2EF2E8086AB08A9B05DECCB87164FD8CF090676AFBF62B
FC002610925EF165EC5D833163B7B0BAD4D2462E470E7B8AB037D6F6A806B2290E815E4065CADF28
2B103012BA3139478EB0DBE4096051C50A07AF0663DBF6C7BEEE5C99149A309A8E3D3A4A914A3965
433A3CDF303B841FD9DD44B27F1D7A06A7725D4EAB2A6611502DFE54A3B066B0C020C10802F63458
254B868BEE894017A4B6F2AE122D1A0F42D02143945894
# off=4618 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "lbsh-leasing.de"
# off=4635 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 71 51
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 594065C8FAF2A43F508BC8E404619E8168EB31173AA0987DA7BB480C3FE57E5C24
A8142EA7590DB442D182567EC4B1E70BA85E1C77FF9A1919F71F0DE39F5E6F087675CF7B7A49C079
E99791D1C646DFBB9EBB2D3E9C7F0EE54F9193DBF0ED4A6DC56E46B3DAD40648A4763E1C4AF50728
68D22EFF62E3F4D4806C66C48F86518605709A848FFE36BB31F4F86CB57103440F42453AF79EE7A8
AF033FA926376E8E19EBFF73CD2FA17564BD779FD3E7305D6841F61FE521383B3FBA85A03F68A1AF
628864A893ED137A52C4C62EB253B3188B16A9AE2BD63AABCAF3A0458713C2B2DA32EC28CC1B7F95
08F733F45C0895CC7FCF477327B53FAC1F0126FA7E043A
# off=5030 ctb=b9 tag=14 hlen=3 plen=269
:public sub key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: C018FE8FED10246D89121FC9EABC798AC3992DF3622414BF511B7D03C1F5006
5E29262F456A35C9FFFCA83F9C5E5711591C08F2D82B7795CF9980542194DE6DB229B979D2FD72E6
4B0E09F4430DDBE41A11706A2D37D59FBCE9CB8E66889AB506A3CCF72F7EE56453D865D0B83B7E4E
9BF13019A9028D5150F5DC989687B5FFB7942A1E7C54BD80BACE8A1B6843E2955620D0D416F5E825
519AFD9ABCFA6F9819B6B316B7F3D62EB1CE78691A049A8AEB7B86FC291358423C06D99C4CC09D46
94683DCF02121A843FC5D41756B62442DC27379EC04D953294288117D38B89C94B0DF6D825C99171
076BB434E4221CEF37F526F7AAB71B4269E4643007ECED335
        pkey[1]: 010001
        keyid: DA7B0663454DA370
# off=5302 ctb=89 tag=2 hlen=3 plen=583
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x18
        digest algo 2, begin of digest 8d 5d
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 27 len 4 (key flags: 0C 00 00 00)
        hashed subpkt 32 len 284 (signature: v4, class 0x19, algo 1, digest algo
 8)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 528254CF86B215694FC8EC863ECE873E08F71AA5808BDA5EC781B447866BE0049F
EA5852E5C878FAF4C7A44E48CA4F892F0E3117526E01DA14E2CCFCF2CA05FEAF248C9869F1FCCBA6
9B810458EFB741BC1565024F5031E70DF34CE564A150CE0D797AE59EB6098E1D4F9BF7C06B74A926
5B9EDD54BFBB08534C4BE7B7BB100914110598CEF2EF9F952DFC723FB247FEF174DAA0B17D2C9BC6
6C5B4D4EFE4A304E54C7FCDA846950ADE77AA03772FC2E47CE0EEA89652322267D6F39F9EB683B78
C68AC62D1BDE0293184356428C65F78A415B28000AFABD94B511D29F5BE474123E807A89E503AB7C
6FE8DDB3DD1F40010E437536709D9B800EE1568314A042
# off=5888 ctb=fc tag=60 hlen=3 plen=527 new-ctb
:unknown packet: type 60, length 527
dump: 04 01 30 82 02 09 30 81  f2 02 01 01 30 0d 06 09  2a 86 48 86 f7 0d 01 01
  24: 0b 05 00 30 81 99 31 0f  30 0d 06 03 55 04 03 13  06 64 61 6c 2e 64 65 31
  48: 33 30 31 06 03 55 04 0a  0c 2a 44 41 4c 20 44 65  75 74 73 63 68 65 20 41
  72: 6e 6c 61 67 65 6e 2d 4c  65 61 73 69 6e 67 20 47  6d 62 48 20 26 20 43 6f
  96: 2e 20 4b 47 31 0b 30 09  06 03 55 04 0b 13 02 49  54 31 0e 30 0c 06 03 55
 120: 04 07 13 05 4d 61 69 6e  7a 31 0c 30 0a 06 03 55  04 08 13 03 52 4c 50 31
 144: 0b 30 09 06 03 55 04 06  13 02 44 45 31 19 30 17  06 09 2a 86 48 86 f7 0d
 168: 01 09 01 16 0a 75 68 64  40 64 61 6c 2e 64 65 17  0d 31 38 30 31 30 32 32
 192: 33 30 32 30 32 5a 17 0d  31 38 30 31 30 39 32 33  30 32 30 32 5a a0 24 30
 216: 22 30 13 06 03 55 1d 23  04 0c 30 0a 80 08 fb 74  27 ce c7 0d 4d bd 30 0b
 240: 06 03 55 1d 14 04 04 02  02 08 a0 30 0d 06 09 2a  86 48 86 f7 0d 01 01 0b
 264: 05 00 03 82 01 01 00 42  de 3c 28 51 92 e3 b2 8d  1e 3e 54 8b 8d 11 de a5
 288: 0c be 92 fc df cb d2 f3  79 55 e1 7e 0e 4d af a2  1c f5 fe fb 86 ac 74 5d
 312: 59 f7 b4 64 8d ec a6 f0  f3 79 d8 15 55 a0 57 8d  a8 8c ce 2e 14 5d c5 ee
 336: a3 54 69 d3 ed e8 d3 85  41 3a 82 72 a6 8f 00 5a  a9 26 b4 15 56 64 81 d8
 360: a5 c4 ed d6 9f d2 3d b1  e2 47 bd a5 2f 3b a1 44  94 7f ce 67 4e 6c b2 ff
 384: dc aa 6b 33 55 68 14 5f  e0 32 49 34 ad 09 98 0a  25 5d 16 78 0c 53 63 9b
 408: 29 e9 3c cb 58 c3 d8 8f  12 8e 26 60 99 84 6b 6e  e0 e8 42 7f 57 c1 e2 25
 432: cd 8b 21 b8 8e 30 c4 bd  36 72 62 1f 42 bf 9c 0f  d1 c3 4e 44 b8 68 88 c4
 456: 2f fd 73 13 37 8f a8 b0  35 2a 92 d2 01 fc 52 f4  c0 a2 8a 27 39 62 39 b0
 480: ba de b1 5b 5d 36 a1 d4  26 a1 45 43 4f fd cd 05  11 10 20 cb d7 db 43 db
 504: 5a 2a 31 a5 0a c6 84 80  61 1b 87 ba 82 95 a7 a4  a0 56 d7 1a 88 fb 1b
 
Kind regards
Rolf


-----Original-Nachricht-----
Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
Datum: 2018-04-26T13:43:18+0200
Von: "Eckenfels. Bernd" <[hidden email]>
An: "[hidden email]" <[hidden email]>

Hello,

Can you dump the file with a PgPdumper like `gpg -list-packets`. You could also try to import it into a local gpg keystore and export it from there.

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 12:55
To: [hidden email]
Subject: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello all,

we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.

From a client we got a specific PGP public key with which we get this error message:

"org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"

The error occurrs in the function BcPGPPublicKeyRingCollection:

"pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"

Our code:

private void read(byte[] bytes) throws GRPPGPException {
  ByteArrayInputStream in = new ByteArrayInputStream(bytes);
   in.mark(bytes.length);

   try {
     skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
     if ( (skr != null) && skr.getKeyRings().hasNext()){
     // Must be secret ring
        isSecret = true;
       return;
    }
    // XXX Mind the (null)! This is not a secret key ring
 } catch (EOFException se) {
    //log.error("", se);
 } catch (IOException e) {
    IOHelper.closeQuietly(in);
    log.error("", e);
    throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
 } catch (PGPException e) {
    log.debug("Not a PGP secret key ring! Reading as public key ring ...");
 }
try {
   in.reset();
   pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
   if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
      isSecret = false;
      return;
   }
   // This is not a public key ring
      throw new PGPException("No public keys found in keyring!");
   } catch (IOException e) {
      throw new GRPPGPException("I/O error while parsing Public key ring!", e);
   } catch (PGPException e) {
      // final attempt failed
      throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
      + "Key ring will not be opened.", e);
   } finally {
      IOHelper.closeQuietly(in);
   }
}

Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.

We have also tested with PGPPublicKeyRingCollection, but with the same result.

We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.

Does anybody have an idea what could be the cause for the error?

Thanks in advanced!

Kind regards
Rolf











SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.



Reply | Threaded
Open this post in threaded view
|

RE: Problem with BcPGPPublicKeyRingCollection

Eckenfels. Bernd
Hello,

Not sure what this packet type 60, some ownertrust or something? I guess one can just cut it off. Not sure how to easily do it in BCPGP.

Maybe it’s enough to ignore the exception while parsing it as a stream? Anyway, if this is a one-off the suggested Import/export should clean it off.

You could ask the originator what software they use and how they exported it (maybe they copied a internal data file and did not use export?).

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 16:39
To: [hidden email]
Subject: Re: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello Bernd,

enclosed the dump of the file:

# off=0 ctb=99 tag=6 hlen=3 plen=269
:public key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: CB065FBDE21CAA7ECB325635FCD9819571AD324094AF45E5D3A3770278B3CEA
6574961CE70B42019478BBD12D42FF4164ACC0CCB9E0240CE84D38A750E8D83408E1D3159DF75DC3
7203DD11D45B79222BE790758040524C3EEA59D916F005983F0AF11097F5EFED3DD2BB49433B0413
F59B48E8F5CB7FA355DC1DA9316E86EAEB5EF57E229EA780DD5EC1EA5847CCA7F4207150084B14CB
460CA99F4D7D16E3638F4201E5ECEF029FBEF4F257594E09D947082ABD461F7AEBB6FCA8206A3B15
330C1BE3E8F098938D7B970B4CDE8BC1FDF37933778073A4EDC0BA690EAE760F65308655B5727E58
BC7664D42DCF3FF397AEB99D9B39F3FB9D2B43274511CCB4D
        pkey[1]: 010001
        keyid: FB7427CEC70D4DBD
# off=272 ctb=b4 tag=13 hlen=2 plen=6
:user ID packet: "dal.de"
# off=280 ctb=89 tag=2 hlen=3 plen=395
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 3f 52
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 25 len 1 (primary user ID)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 63A0D14C029CD4E18B9C6209831F7EF7CB9E2EF59E4A3AFC21A977822EF3D3DA90
06D3E9ECC7B0BBD9D3FF0ADE80B422700E153755D9C93A741B2342AB73054DB65B8044C989A10482
569F71340015F65C6CA488F14B0C8263DC3BB2453F35B650D64FECA7C02BC4A7043B1F37411F3371
E9F581BACD45537B4E9F7FBFD11EA85285242F95C7B62A73CCC73E0D6690124204E6D5B37DA085C9
F0FB1A3E1FEB73BE69A09B7DBDCE9529E2A5D9510ECD64EFD15E079CA8072102C9D2C4EC37263214
B97CEB0C75493AF43DC293D7DF9349C0EEF7155DF3CD79F6E5F6F22F99957ED11339CD8BB2C4C830
3117F673F33CB6AB3C3CC37E2DA494F96BED9253F9A746
# off=678 ctb=b4 tag=13 hlen=2 plen=3
:user ID packet: "DAL"
# off=683 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 80
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 4D5B0D8D9F88DDF97F3B6B8FF3B591A1E99F08AB1FCC54E0BB4498B8B68D5A30BB
6A214AE032B7C186863F6BF475AAAA9FB3B91FCC3DE6C38CB84052447E1A99931393448EE8E4E031
0B743747B6201237FF48999595582C4A2744020E146944FB32B576B52B8CCD68FB87D50ABACF533B
F535970786BEF5CD1A46D60DD3D6DB9737070F8DA8D08F0196A179491F8F7668AEAAE3A710B4DEB0
3F05D0F62B962D049EECC4F6A90C99B0362A1479B73410604B00C053191182B38E865A6B55471897
C449F50035F4B2EE4BF2FE3DCEA819DAC7899265772D24C371D2E0AB98D14E2BAA159D91F0327707
B569D6E45794AF292B4C0727CCC96412A6498A806C7A2F
# off=1078 ctb=b4 tag=13 hlen=2 plen=19
:user ID packet: "dal.de <[hidden email]>"
# off=1099 ctb=89 tag=2 hlen=3 plen=371
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 62 89
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 137720B356990C611BCC059FC016C198ED52F7E5BAA0795C345B718EF663CA14F4
EB204054F4E35944D4BB79366A8E1335DB5476CBD1E2EBDEA010C6F82960FE32D914C5955A605927
F49ED914DE7149560B40771DE6D3E68C8432E9D76592E05AD2637E59F3CAC13D03A5DA12034E4F4F
409B5551155E231B8D27E56F74D5256A1D6F4311956EFE38566ED789DDB0A7EFF2004CAFA2B86284
B3990900C68782E99C57FF035346D42D362AB75FF43C3DF872EF622D9931F7F242AD1D40D60D96A2
44DA825CC161D04D3239D1EC341FA59DCEA6787CE4B521363F86B95DCD5429BCE771491CA47FEB6C
86732EFA41A77D53EC0C28FC8E1FC2C8EA10A75AA210FA
# off=1473 ctb=89 tag=2 hlen=3 plen=1089
:signature packet: algo 100, keyid 0000000000000000
        version 4, created 1477474440, md5len 0, sigclass 0x10
        digest algo gpg: can't handle public key algorithm 100
2, begin of digest 00 00
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 3 len 4 (sig expires after 10y0d0h0m)
        hashed subpkt 5 len 2 (trust signature of depth 255, value 120)
        hashed subpkt 27 len 1 (key flags: 0F)
        hashed subpkt 100 len 1054 (experimental / private subpacket)
        unknown algorithm 100
# off=2565 ctb=b4 tag=13 hlen=2 plen=10
:user ID packet: "dlf-stb.de"
# off=2577 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest c3 f3
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8885E590EB012B5589B89C2B4A8EAF693FFDF07AB319FE574F3AE2BFAD00A67746
6B6F221BB9407B236AFEFB8CFAB625C05E75C1242C5BCAF211DEA46B6A78132416DDF23F326D12DF
DEBD5FE51800F15C75B7B14F1162190CBEF792841B5D149B529A51EAEDCE959E488B3E5CCA99BB5C
86AB3465F0E422D2D4538FAF7A3EAE081DE8679C4B415B60DD11D6B2CF1F0F9669C4A72FAE27EBC5
F72893B30FFF9A36E16DDDB525285CD7EC61181363D5C74727EEB95F168C67F34505B37CD268A901
2C7172DC4042DF3C42976703EE216C5DE92F1975529CA41BF9304BAFC8CE0A6BB8AA6A55C23D29C5
A476033A90E6E8FDC45056485F9C41CB9279BA3E4AC5E4
# off=2972 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "deutsche-ppp.de"
# off=2989 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 43 71
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8C7EEF22C8BE67E27753E1580796BBB11B343C753996CCDFD81B97899840D620B7
13D2EB4A634EF6AE1A3556893DBFA73C5A2E0667E28D7151EF91B59F446ED5F71E431A1FB2284E85
DD55E73DD93CE947B044D565BE77B5ACF6A3D274272E3ED982F9F91DAE3FC289478CD8D44770744E
51388F8D795A16A0C4DBFA5CB7F8AE8735ED5AAF4356C7A164FBC10BC948DB1173903816D2C25FFE
1BFC5F187DF8964B2BCC518046A0A5EB10A4499A2D45C63A8377209C55F52B48312023F6634A5FA0
211B7D3DF14577BB034712B9595A69E647EF0E60C9A86F42DA3D15B01F08061DB218F54CC45FDC09
E22E4EFB556397638FC4D15A1BA4B11063A5880F97AC55
# off=3384 ctb=b4 tag=13 hlen=2 plen=16
:user ID packet: "deutsche-ppp.com"
# off=3402 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 44 aa
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: C8C9150687795F19F5A8DAFD7747E4E00B87965B564489FD4787CF166EF89167B6
AEED31CC22215B8905C8754A88CDD831707E8049610C6E324F86E4FEAAFB7F8BFB4A7A23D11DF17F
5963E6D49906D1F3E3038632A756798DDF2DBBF3B4CEACC41C3963C0247EAC736EF2ADCE177C19C0
2F3368E15B15534866A962DE11D85065B79E77DBA3ED9071593F363DB612F8C06A42415708F3CD34
22E92CF04D754A93EBE5914C4F6FAD14EA58238182C5A4B6A7999E4B8CE5A765F082F35F645B8BCD
1DF09A5ABD6EFFDFC977A676EE192DE2DB752B80EEB9BE8FD1E3D6C301DAF5DC4965DC7C08522394
57CEA6A27A7211638C0E9A4B18BFC5EA6DB2F2D34D4C47
# off=3797 ctb=b4 tag=13 hlen=2 plen=13
:user ID packet: "dal-polska.pl"
# off=3812 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 7e
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 9D20EB63166C795D6304958A6CADDB051955B57C856BB78783C925CDA3E856CE09
F2D333FBAFBD3D95370016D8A682BC473320980722408A780853C029DC6C40D888DC1042576A69AA
F4F05356D84F726F7F29C3BB5B98C0E6BD3D0A7C69D28F331BDDDC28D24EB7B28410F89209EF9AA0
C9694A4FA5045A2C135CDD757067831E548AA555D8FF3CE175DC96B03A5592979A54F7296599113C
626DBD41B88C4BDA2CF4056AC4E179C4F4BA3886F99B44ADFDE1B73337B43EC7A94D778C3E33A400
4ECE4C7ACB3CC2221A077B784EE72294DCD98032026F8920167E1A0651FC832B98D2950BC6229593
5B7296D45C1F3AB3A24EDB9548D451652347A375295270
# off=4207 ctb=b4 tag=13 hlen=2 plen=14
:user ID packet: "dal-romania.ro"
# off=4223 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest bd a6
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: BDDA560AF0F259F77FE378ABC897FBBA8DC6FCE607B3C527CB936AD87A8D95D06C
098ED366332E4958AB433AAA9A9A92CFF1FF2717D9229AC91E1BCBA8B1C97041912E36009AB93C29
A81928240DE343C3AF5B21F849E0F1148B2EF2E8086AB08A9B05DECCB87164FD8CF090676AFBF62B
FC002610925EF165EC5D833163B7B0BAD4D2462E470E7B8AB037D6F6A806B2290E815E4065CADF28
2B103012BA3139478EB0DBE4096051C50A07AF0663DBF6C7BEEE5C99149A309A8E3D3A4A914A3965
433A3CDF303B841FD9DD44B27F1D7A06A7725D4EAB2A6611502DFE54A3B066B0C020C10802F63458
254B868BEE894017A4B6F2AE122D1A0F42D02143945894
# off=4618 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "lbsh-leasing.de"
# off=4635 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 71 51
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 594065C8FAF2A43F508BC8E404619E8168EB31173AA0987DA7BB480C3FE57E5C24
A8142EA7590DB442D182567EC4B1E70BA85E1C77FF9A1919F71F0DE39F5E6F087675CF7B7A49C079
E99791D1C646DFBB9EBB2D3E9C7F0EE54F9193DBF0ED4A6DC56E46B3DAD40648A4763E1C4AF50728
68D22EFF62E3F4D4806C66C48F86518605709A848FFE36BB31F4F86CB57103440F42453AF79EE7A8
AF033FA926376E8E19EBFF73CD2FA17564BD779FD3E7305D6841F61FE521383B3FBA85A03F68A1AF
628864A893ED137A52C4C62EB253B3188B16A9AE2BD63AABCAF3A0458713C2B2DA32EC28CC1B7F95
08F733F45C0895CC7FCF477327B53FAC1F0126FA7E043A
# off=5030 ctb=b9 tag=14 hlen=3 plen=269
:public sub key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: C018FE8FED10246D89121FC9EABC798AC3992DF3622414BF511B7D03C1F5006
5E29262F456A35C9FFFCA83F9C5E5711591C08F2D82B7795CF9980542194DE6DB229B979D2FD72E6
4B0E09F4430DDBE41A11706A2D37D59FBCE9CB8E66889AB506A3CCF72F7EE56453D865D0B83B7E4E
9BF13019A9028D5150F5DC989687B5FFB7942A1E7C54BD80BACE8A1B6843E2955620D0D416F5E825
519AFD9ABCFA6F9819B6B316B7F3D62EB1CE78691A049A8AEB7B86FC291358423C06D99C4CC09D46
94683DCF02121A843FC5D41756B62442DC27379EC04D953294288117D38B89C94B0DF6D825C99171
076BB434E4221CEF37F526F7AAB71B4269E4643007ECED335
        pkey[1]: 010001
        keyid: DA7B0663454DA370
# off=5302 ctb=89 tag=2 hlen=3 plen=583
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x18
        digest algo 2, begin of digest 8d 5d
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 27 len 4 (key flags: 0C 00 00 00)
        hashed subpkt 32 len 284 (signature: v4, class 0x19, algo 1, digest algo
 8)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 528254CF86B215694FC8EC863ECE873E08F71AA5808BDA5EC781B447866BE0049F
EA5852E5C878FAF4C7A44E48CA4F892F0E3117526E01DA14E2CCFCF2CA05FEAF248C9869F1FCCBA6
9B810458EFB741BC1565024F5031E70DF34CE564A150CE0D797AE59EB6098E1D4F9BF7C06B74A926
5B9EDD54BFBB08534C4BE7B7BB100914110598CEF2EF9F952DFC723FB247FEF174DAA0B17D2C9BC6
6C5B4D4EFE4A304E54C7FCDA846950ADE77AA03772FC2E47CE0EEA89652322267D6F39F9EB683B78
C68AC62D1BDE0293184356428C65F78A415B28000AFABD94B511D29F5BE474123E807A89E503AB7C
6FE8DDB3DD1F40010E437536709D9B800EE1568314A042
# off=5888 ctb=fc tag=60 hlen=3 plen=527 new-ctb
:unknown packet: type 60, length 527
dump: 04 01 30 82 02 09 30 81  f2 02 01 01 30 0d 06 09  2a 86 48 86 f7 0d 01 01
  24: 0b 05 00 30 81 99 31 0f  30 0d 06 03 55 04 03 13  06 64 61 6c 2e 64 65 31
  48: 33 30 31 06 03 55 04 0a  0c 2a 44 41 4c 20 44 65  75 74 73 63 68 65 20 41
  72: 6e 6c 61 67 65 6e 2d 4c  65 61 73 69 6e 67 20 47  6d 62 48 20 26 20 43 6f
  96: 2e 20 4b 47 31 0b 30 09  06 03 55 04 0b 13 02 49  54 31 0e 30 0c 06 03 55
 120: 04 07 13 05 4d 61 69 6e  7a 31 0c 30 0a 06 03 55  04 08 13 03 52 4c 50 31
 144: 0b 30 09 06 03 55 04 06  13 02 44 45 31 19 30 17  06 09 2a 86 48 86 f7 0d
 168: 01 09 01 16 0a 75 68 64  40 64 61 6c 2e 64 65 17  0d 31 38 30 31 30 32 32
 192: 33 30 32 30 32 5a 17 0d  31 38 30 31 30 39 32 33  30 32 30 32 5a a0 24 30
 216: 22 30 13 06 03 55 1d 23  04 0c 30 0a 80 08 fb 74  27 ce c7 0d 4d bd 30 0b
 240: 06 03 55 1d 14 04 04 02  02 08 a0 30 0d 06 09 2a  86 48 86 f7 0d 01 01 0b
 264: 05 00 03 82 01 01 00 42  de 3c 28 51 92 e3 b2 8d  1e 3e 54 8b 8d 11 de a5
 288: 0c be 92 fc df cb d2 f3  79 55 e1 7e 0e 4d af a2  1c f5 fe fb 86 ac 74 5d
 312: 59 f7 b4 64 8d ec a6 f0  f3 79 d8 15 55 a0 57 8d  a8 8c ce 2e 14 5d c5 ee
 336: a3 54 69 d3 ed e8 d3 85  41 3a 82 72 a6 8f 00 5a  a9 26 b4 15 56 64 81 d8
 360: a5 c4 ed d6 9f d2 3d b1  e2 47 bd a5 2f 3b a1 44  94 7f ce 67 4e 6c b2 ff
 384: dc aa 6b 33 55 68 14 5f  e0 32 49 34 ad 09 98 0a  25 5d 16 78 0c 53 63 9b
 408: 29 e9 3c cb 58 c3 d8 8f  12 8e 26 60 99 84 6b 6e  e0 e8 42 7f 57 c1 e2 25
 432: cd 8b 21 b8 8e 30 c4 bd  36 72 62 1f 42 bf 9c 0f  d1 c3 4e 44 b8 68 88 c4
 456: 2f fd 73 13 37 8f a8 b0  35 2a 92 d2 01 fc 52 f4  c0 a2 8a 27 39 62 39 b0
 480: ba de b1 5b 5d 36 a1 d4  26 a1 45 43 4f fd cd 05  11 10 20 cb d7 db 43 db
 504: 5a 2a 31 a5 0a c6 84 80  61 1b 87 ba 82 95 a7 a4  a0 56 d7 1a 88 fb 1b

Kind regards
Rolf


-----Original-Nachricht-----
Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
Datum: 2018-04-26T13:43:18+0200
Von: "Eckenfels. Bernd" <[hidden email]>
An: "[hidden email]" <[hidden email]>

Hello,

Can you dump the file with a PgPdumper like `gpg -list-packets`. You could also try to import it into a local gpg keystore and export it from there.

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 12:55
To: [hidden email]
Subject: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello all,

we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.

From a client we got a specific PGP public key with which we get this error message:

"org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"

The error occurrs in the function BcPGPPublicKeyRingCollection:

"pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"

Our code:

private void read(byte[] bytes) throws GRPPGPException {
  ByteArrayInputStream in = new ByteArrayInputStream(bytes);
   in.mark(bytes.length);

   try {
     skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
     if ( (skr != null) && skr.getKeyRings().hasNext()){
     // Must be secret ring
        isSecret = true;
       return;
    }
    // XXX Mind the (null)! This is not a secret key ring
 } catch (EOFException se) {
    //log.error("", se);
 } catch (IOException e) {
    IOHelper.closeQuietly(in);
    log.error("", e);
    throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
 } catch (PGPException e) {
    log.debug("Not a PGP secret key ring! Reading as public key ring ...");
 }
try {
   in.reset();
   pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
   if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
      isSecret = false;
      return;
   }
   // This is not a public key ring
      throw new PGPException("No public keys found in keyring!");
   } catch (IOException e) {
      throw new GRPPGPException("I/O error while parsing Public key ring!", e);
   } catch (PGPException e) {
      // final attempt failed
      throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
      + "Key ring will not be opened.", e);
   } finally {
      IOHelper.closeQuietly(in);
   }
}

Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.

We have also tested with PGPPublicKeyRingCollection, but with the same result.

We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.

Does anybody have an idea what could be the cause for the error?

Thanks in advanced!

Kind regards
Rolf











SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.

?









SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.


Reply | Threaded
Open this post in threaded view
|

AW: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Rolf.Kremer@t-online.de
Thanks for your fast response!

They used "PGP Universal 3.4.1 (Build 777)" for creating the key. But I do not know how they exported it...

Kind regards
Rolf


-----Original-Nachricht-----
Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
Datum: 2018-04-26T17:13:48+0200
Von: "Eckenfels. Bernd" <[hidden email]>
An: "[hidden email]" <[hidden email]>

Hello,

Not sure what this packet type 60, some ownertrust or something? I guess one can just cut it off. Not sure how to easily do it in BCPGP.

Maybe it’s enough to ignore the exception while parsing it as a stream? Anyway, if this is a one-off the suggested Import/export should clean it off.

You could ask the originator what software they use and how they exported it (maybe they copied a internal data file and did not use export?).

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 16:39
To: [hidden email]
Subject: Re: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello Bernd,

enclosed the dump of the file:

# off=0 ctb=99 tag=6 hlen=3 plen=269
:public key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: CB065FBDE21CAA7ECB325635FCD9819571AD324094AF45E5D3A3770278B3CEA
6574961CE70B42019478BBD12D42FF4164ACC0CCB9E0240CE84D38A750E8D83408E1D3159DF75DC3
7203DD11D45B79222BE790758040524C3EEA59D916F005983F0AF11097F5EFED3DD2BB49433B0413
F59B48E8F5CB7FA355DC1DA9316E86EAEB5EF57E229EA780DD5EC1EA5847CCA7F4207150084B14CB
460CA99F4D7D16E3638F4201E5ECEF029FBEF4F257594E09D947082ABD461F7AEBB6FCA8206A3B15
330C1BE3E8F098938D7B970B4CDE8BC1FDF37933778073A4EDC0BA690EAE760F65308655B5727E58
BC7664D42DCF3FF397AEB99D9B39F3FB9D2B43274511CCB4D
        pkey[1]: 010001
        keyid: FB7427CEC70D4DBD
# off=272 ctb=b4 tag=13 hlen=2 plen=6
:user ID packet: "dal.de"
# off=280 ctb=89 tag=2 hlen=3 plen=395
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 3f 52
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 25 len 1 (primary user ID)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 63A0D14C029CD4E18B9C6209831F7EF7CB9E2EF59E4A3AFC21A977822EF3D3DA90
06D3E9ECC7B0BBD9D3FF0ADE80B422700E153755D9C93A741B2342AB73054DB65B8044C989A10482
569F71340015F65C6CA488F14B0C8263DC3BB2453F35B650D64FECA7C02BC4A7043B1F37411F3371
E9F581BACD45537B4E9F7FBFD11EA85285242F95C7B62A73CCC73E0D6690124204E6D5B37DA085C9
F0FB1A3E1FEB73BE69A09B7DBDCE9529E2A5D9510ECD64EFD15E079CA8072102C9D2C4EC37263214
B97CEB0C75493AF43DC293D7DF9349C0EEF7155DF3CD79F6E5F6F22F99957ED11339CD8BB2C4C830
3117F673F33CB6AB3C3CC37E2DA494F96BED9253F9A746
# off=678 ctb=b4 tag=13 hlen=2 plen=3
:user ID packet: "DAL"
# off=683 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 80
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 4D5B0D8D9F88DDF97F3B6B8FF3B591A1E99F08AB1FCC54E0BB4498B8B68D5A30BB
6A214AE032B7C186863F6BF475AAAA9FB3B91FCC3DE6C38CB84052447E1A99931393448EE8E4E031
0B743747B6201237FF48999595582C4A2744020E146944FB32B576B52B8CCD68FB87D50ABACF533B
F535970786BEF5CD1A46D60DD3D6DB9737070F8DA8D08F0196A179491F8F7668AEAAE3A710B4DEB0
3F05D0F62B962D049EECC4F6A90C99B0362A1479B73410604B00C053191182B38E865A6B55471897
C449F50035F4B2EE4BF2FE3DCEA819DAC7899265772D24C371D2E0AB98D14E2BAA159D91F0327707
B569D6E45794AF292B4C0727CCC96412A6498A806C7A2F
# off=1078 ctb=b4 tag=13 hlen=2 plen=19
:user ID packet: "dal.de <[hidden email]>"
# off=1099 ctb=89 tag=2 hlen=3 plen=371
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 62 89
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 137720B356990C611BCC059FC016C198ED52F7E5BAA0795C345B718EF663CA14F4
EB204054F4E35944D4BB79366A8E1335DB5476CBD1E2EBDEA010C6F82960FE32D914C5955A605927
F49ED914DE7149560B40771DE6D3E68C8432E9D76592E05AD2637E59F3CAC13D03A5DA12034E4F4F
409B5551155E231B8D27E56F74D5256A1D6F4311956EFE38566ED789DDB0A7EFF2004CAFA2B86284
B3990900C68782E99C57FF035346D42D362AB75FF43C3DF872EF622D9931F7F242AD1D40D60D96A2
44DA825CC161D04D3239D1EC341FA59DCEA6787CE4B521363F86B95DCD5429BCE771491CA47FEB6C
86732EFA41A77D53EC0C28FC8E1FC2C8EA10A75AA210FA
# off=1473 ctb=89 tag=2 hlen=3 plen=1089
:signature packet: algo 100, keyid 0000000000000000
        version 4, created 1477474440, md5len 0, sigclass 0x10
        digest algo gpg: can't handle public key algorithm 100
2, begin of digest 00 00
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 3 len 4 (sig expires after 10y0d0h0m)
        hashed subpkt 5 len 2 (trust signature of depth 255, value 120)
        hashed subpkt 27 len 1 (key flags: 0F)
        hashed subpkt 100 len 1054 (experimental / private subpacket)
        unknown algorithm 100
# off=2565 ctb=b4 tag=13 hlen=2 plen=10
:user ID packet: "dlf-stb.de"
# off=2577 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest c3 f3
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8885E590EB012B5589B89C2B4A8EAF693FFDF07AB319FE574F3AE2BFAD00A67746
6B6F221BB9407B236AFEFB8CFAB625C05E75C1242C5BCAF211DEA46B6A78132416DDF23F326D12DF
DEBD5FE51800F15C75B7B14F1162190CBEF792841B5D149B529A51EAEDCE959E488B3E5CCA99BB5C
86AB3465F0E422D2D4538FAF7A3EAE081DE8679C4B415B60DD11D6B2CF1F0F9669C4A72FAE27EBC5
F72893B30FFF9A36E16DDDB525285CD7EC61181363D5C74727EEB95F168C67F34505B37CD268A901
2C7172DC4042DF3C42976703EE216C5DE92F1975529CA41BF9304BAFC8CE0A6BB8AA6A55C23D29C5
A476033A90E6E8FDC45056485F9C41CB9279BA3E4AC5E4
# off=2972 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "deutsche-ppp.de"
# off=2989 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 43 71
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 8C7EEF22C8BE67E27753E1580796BBB11B343C753996CCDFD81B97899840D620B7
13D2EB4A634EF6AE1A3556893DBFA73C5A2E0667E28D7151EF91B59F446ED5F71E431A1FB2284E85
DD55E73DD93CE947B044D565BE77B5ACF6A3D274272E3ED982F9F91DAE3FC289478CD8D44770744E
51388F8D795A16A0C4DBFA5CB7F8AE8735ED5AAF4356C7A164FBC10BC948DB1173903816D2C25FFE
1BFC5F187DF8964B2BCC518046A0A5EB10A4499A2D45C63A8377209C55F52B48312023F6634A5FA0
211B7D3DF14577BB034712B9595A69E647EF0E60C9A86F42DA3D15B01F08061DB218F54CC45FDC09
E22E4EFB556397638FC4D15A1BA4B11063A5880F97AC55
# off=3384 ctb=b4 tag=13 hlen=2 plen=16
:user ID packet: "deutsche-ppp.com"
# off=3402 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 44 aa
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: C8C9150687795F19F5A8DAFD7747E4E00B87965B564489FD4787CF166EF89167B6
AEED31CC22215B8905C8754A88CDD831707E8049610C6E324F86E4FEAAFB7F8BFB4A7A23D11DF17F
5963E6D49906D1F3E3038632A756798DDF2DBBF3B4CEACC41C3963C0247EAC736EF2ADCE177C19C0
2F3368E15B15534866A962DE11D85065B79E77DBA3ED9071593F363DB612F8C06A42415708F3CD34
22E92CF04D754A93EBE5914C4F6FAD14EA58238182C5A4B6A7999E4B8CE5A765F082F35F645B8BCD
1DF09A5ABD6EFFDFC977A676EE192DE2DB752B80EEB9BE8FD1E3D6C301DAF5DC4965DC7C08522394
57CEA6A27A7211638C0E9A4B18BFC5EA6DB2F2D34D4C47
# off=3797 ctb=b4 tag=13 hlen=2 plen=13
:user ID packet: "dal-polska.pl"
# off=3812 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 67 7e
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 9D20EB63166C795D6304958A6CADDB051955B57C856BB78783C925CDA3E856CE09
F2D333FBAFBD3D95370016D8A682BC473320980722408A780853C029DC6C40D888DC1042576A69AA
F4F05356D84F726F7F29C3BB5B98C0E6BD3D0A7C69D28F331BDDDC28D24EB7B28410F89209EF9AA0
C9694A4FA5045A2C135CDD757067831E548AA555D8FF3CE175DC96B03A5592979A54F7296599113C
626DBD41B88C4BDA2CF4056AC4E179C4F4BA3886F99B44ADFDE1B73337B43EC7A94D778C3E33A400
4ECE4C7ACB3CC2221A077B784EE72294DCD98032026F8920167E1A0651FC832B98D2950BC6229593
5B7296D45C1F3AB3A24EDB9548D451652347A375295270
# off=4207 ctb=b4 tag=13 hlen=2 plen=14
:user ID packet: "dal-romania.ro"
# off=4223 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest bd a6
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: BDDA560AF0F259F77FE378ABC897FBBA8DC6FCE607B3C527CB936AD87A8D95D06C
098ED366332E4958AB433AAA9A9A92CFF1FF2717D9229AC91E1BCBA8B1C97041912E36009AB93C29
A81928240DE343C3AF5B21F849E0F1148B2EF2E8086AB08A9B05DECCB87164FD8CF090676AFBF62B
FC002610925EF165EC5D833163B7B0BAD4D2462E470E7B8AB037D6F6A806B2290E815E4065CADF28
2B103012BA3139478EB0DBE4096051C50A07AF0663DBF6C7BEEE5C99149A309A8E3D3A4A914A3965
433A3CDF303B841FD9DD44B27F1D7A06A7725D4EAB2A6611502DFE54A3B066B0C020C10802F63458
254B868BEE894017A4B6F2AE122D1A0F42D02143945894
# off=4618 ctb=b4 tag=13 hlen=2 plen=15
:user ID packet: "lbsh-leasing.de"
# off=4635 ctb=89 tag=2 hlen=3 plen=392
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x10
        digest algo 2, begin of digest 71 51
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
ime)
        hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
        hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
        hashed subpkt 27 len 4 (key flags: 03 00 00 00)
        hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
        hashed subpkt 30 len 4 (features: 01 00 00 00)
        hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 594065C8FAF2A43F508BC8E404619E8168EB31173AA0987DA7BB480C3FE57E5C24
A8142EA7590DB442D182567EC4B1E70BA85E1C77FF9A1919F71F0DE39F5E6F087675CF7B7A49C079
E99791D1C646DFBB9EBB2D3E9C7F0EE54F9193DBF0ED4A6DC56E46B3DAD40648A4763E1C4AF50728
68D22EFF62E3F4D4806C66C48F86518605709A848FFE36BB31F4F86CB57103440F42453AF79EE7A8
AF033FA926376E8E19EBFF73CD2FA17564BD779FD3E7305D6841F61FE521383B3FBA85A03F68A1AF
628864A893ED137A52C4C62EB253B3188B16A9AE2BD63AABCAF3A0458713C2B2DA32EC28CC1B7F95
08F733F45C0895CC7FCF477327B53FAC1F0126FA7E043A
# off=5030 ctb=b9 tag=14 hlen=3 plen=269
:public sub key packet:
        version 4, algo 1, created 1319469699, expires 0
        pkey[0]: C018FE8FED10246D89121FC9EABC798AC3992DF3622414BF511B7D03C1F5006
5E29262F456A35C9FFFCA83F9C5E5711591C08F2D82B7795CF9980542194DE6DB229B979D2FD72E6
4B0E09F4430DDBE41A11706A2D37D59FBCE9CB8E66889AB506A3CCF72F7EE56453D865D0B83B7E4E
9BF13019A9028D5150F5DC989687B5FFB7942A1E7C54BD80BACE8A1B6843E2955620D0D416F5E825
519AFD9ABCFA6F9819B6B316B7F3D62EB1CE78691A049A8AEB7B86FC291358423C06D99C4CC09D46
94683DCF02121A843FC5D41756B62442DC27379EC04D953294288117D38B89C94B0DF6D825C99171
076BB434E4221CEF37F526F7AAB71B4269E4643007ECED335
        pkey[1]: 010001
        keyid: DA7B0663454DA370
# off=5302 ctb=89 tag=2 hlen=3 plen=583
:signature packet: algo 1, keyid FB7427CEC70D4DBD
        version 4, created 1477473683, md5len 0, sigclass 0x18
        digest algo 2, begin of digest 8d 5d
        hashed subpkt 2 len 4 (sig created 2016-10-26)
        hashed subpkt 9 len 4 (key does not expire)
        hashed subpkt 27 len 4 (key flags: 0C 00 00 00)
        hashed subpkt 32 len 284 (signature: v4, class 0x19, algo 1, digest algo
 8)
        subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
        data: 528254CF86B215694FC8EC863ECE873E08F71AA5808BDA5EC781B447866BE0049F
EA5852E5C878FAF4C7A44E48CA4F892F0E3117526E01DA14E2CCFCF2CA05FEAF248C9869F1FCCBA6
9B810458EFB741BC1565024F5031E70DF34CE564A150CE0D797AE59EB6098E1D4F9BF7C06B74A926
5B9EDD54BFBB08534C4BE7B7BB100914110598CEF2EF9F952DFC723FB247FEF174DAA0B17D2C9BC6
6C5B4D4EFE4A304E54C7FCDA846950ADE77AA03772FC2E47CE0EEA89652322267D6F39F9EB683B78
C68AC62D1BDE0293184356428C65F78A415B28000AFABD94B511D29F5BE474123E807A89E503AB7C
6FE8DDB3DD1F40010E437536709D9B800EE1568314A042
# off=5888 ctb=fc tag=60 hlen=3 plen=527 new-ctb
:unknown packet: type 60, length 527
dump: 04 01 30 82 02 09 30 81  f2 02 01 01 30 0d 06 09  2a 86 48 86 f7 0d 01 01
  24: 0b 05 00 30 81 99 31 0f  30 0d 06 03 55 04 03 13  06 64 61 6c 2e 64 65 31
  48: 33 30 31 06 03 55 04 0a  0c 2a 44 41 4c 20 44 65  75 74 73 63 68 65 20 41
  72: 6e 6c 61 67 65 6e 2d 4c  65 61 73 69 6e 67 20 47  6d 62 48 20 26 20 43 6f
  96: 2e 20 4b 47 31 0b 30 09  06 03 55 04 0b 13 02 49  54 31 0e 30 0c 06 03 55
 120: 04 07 13 05 4d 61 69 6e  7a 31 0c 30 0a 06 03 55  04 08 13 03 52 4c 50 31
 144: 0b 30 09 06 03 55 04 06  13 02 44 45 31 19 30 17  06 09 2a 86 48 86 f7 0d
 168: 01 09 01 16 0a 75 68 64  40 64 61 6c 2e 64 65 17  0d 31 38 30 31 30 32 32
 192: 33 30 32 30 32 5a 17 0d  31 38 30 31 30 39 32 33  30 32 30 32 5a a0 24 30
 216: 22 30 13 06 03 55 1d 23  04 0c 30 0a 80 08 fb 74  27 ce c7 0d 4d bd 30 0b
 240: 06 03 55 1d 14 04 04 02  02 08 a0 30 0d 06 09 2a  86 48 86 f7 0d 01 01 0b
 264: 05 00 03 82 01 01 00 42  de 3c 28 51 92 e3 b2 8d  1e 3e 54 8b 8d 11 de a5
 288: 0c be 92 fc df cb d2 f3  79 55 e1 7e 0e 4d af a2  1c f5 fe fb 86 ac 74 5d
 312: 59 f7 b4 64 8d ec a6 f0  f3 79 d8 15 55 a0 57 8d  a8 8c ce 2e 14 5d c5 ee
 336: a3 54 69 d3 ed e8 d3 85  41 3a 82 72 a6 8f 00 5a  a9 26 b4 15 56 64 81 d8
 360: a5 c4 ed d6 9f d2 3d b1  e2 47 bd a5 2f 3b a1 44  94 7f ce 67 4e 6c b2 ff
 384: dc aa 6b 33 55 68 14 5f  e0 32 49 34 ad 09 98 0a  25 5d 16 78 0c 53 63 9b
 408: 29 e9 3c cb 58 c3 d8 8f  12 8e 26 60 99 84 6b 6e  e0 e8 42 7f 57 c1 e2 25
 432: cd 8b 21 b8 8e 30 c4 bd  36 72 62 1f 42 bf 9c 0f  d1 c3 4e 44 b8 68 88 c4
 456: 2f fd 73 13 37 8f a8 b0  35 2a 92 d2 01 fc 52 f4  c0 a2 8a 27 39 62 39 b0
 480: ba de b1 5b 5d 36 a1 d4  26 a1 45 43 4f fd cd 05  11 10 20 cb d7 db 43 db
 504: 5a 2a 31 a5 0a c6 84 80  61 1b 87 ba 82 95 a7 a4  a0 56 d7 1a 88 fb 1b

Kind regards
Rolf


-----Original-Nachricht-----
Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
Datum: 2018-04-26T13:43:18+0200
Von: "Eckenfels. Bernd" <[hidden email]>
An: "[hidden email]" <[hidden email]>

Hello,

Can you dump the file with a PgPdumper like `gpg -list-packets`. You could also try to import it into a local gpg keystore and export it from there.

Gruss
Bernd

--
http://www.seeburger.com
________________________________________
From: [hidden email] [[hidden email]]
Sent: Thursday, April 26, 2018 12:55
To: [hidden email]
Subject: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

Hello all,

we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.

From a client we got a specific PGP public key with which we get this error message:

"org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"

The error occurrs in the function BcPGPPublicKeyRingCollection:

"pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"

Our code:

private void read(byte[] bytes) throws GRPPGPException {
  ByteArrayInputStream in = new ByteArrayInputStream(bytes);
   in.mark(bytes.length);

   try {
     skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
     if ( (skr != null) && skr.getKeyRings().hasNext()){
     // Must be secret ring
        isSecret = true;
       return;
    }
    // XXX Mind the (null)! This is not a secret key ring
 } catch (EOFException se) {
    //log.error("", se);
 } catch (IOException e) {
    IOHelper.closeQuietly(in);
    log.error("", e);
    throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
 } catch (PGPException e) {
    log.debug("Not a PGP secret key ring! Reading as public key ring ...");
 }
try {
   in.reset();
   pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
   if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
      isSecret = false;
      return;
   }
   // This is not a public key ring
      throw new PGPException("No public keys found in keyring!");
   } catch (IOException e) {
      throw new GRPPGPException("I/O error while parsing Public key ring!", e);
   } catch (PGPException e) {
      // final attempt failed
      throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
      + "Key ring will not be opened.", e);
   } finally {
      IOHelper.closeQuietly(in);
   }
}

Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.

We have also tested with PGPPublicKeyRingCollection, but with the same result.

We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.

Does anybody have an idea what could be the cause for the error?

Thanks in advanced!

Kind regards
Rolf











SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.

?









SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
Edisonstr. 1
D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de               Registergericht/Commercial Register:
e-mail: [hidden email]               HRB 240708 Mannheim


Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.


This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.




Reply | Threaded
Open this post in threaded view
|

Re: AW: [dev-crypto] Problem with BcPGPPublicKeyRingCollection

David Hook-3

I think you could cut the last packet off by regenerating the encoding
using  a BCPGInputStream and a BCPGOutputStream - looking at the dump
and the stack trace is appears the proprietary data is appearing where
the parser would normally expect the next subkey to appear. The idea
would be to just re-encode everything you read and discard the
experimental packets. The result should give you a valid key ring.

Regards,

David
 
On 27/04/18 02:30, [hidden email] wrote:

> Thanks for your fast response!
>
> They used "PGP Universal 3.4.1 (Build 777)" for creating the key. But I do not know how they exported it...
>
> Kind regards
> Rolf
>
>
> -----Original-Nachricht-----
> Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
> Datum: 2018-04-26T17:13:48+0200
> Von: "Eckenfels. Bernd" <[hidden email]>
> An: "[hidden email]" <[hidden email]>
>
> Hello,
>
> Not sure what this packet type 60, some ownertrust or something? I guess one can just cut it off. Not sure how to easily do it in BCPGP.
>
> Maybe it’s enough to ignore the exception while parsing it as a stream? Anyway, if this is a one-off the suggested Import/export should clean it off.
>
> You could ask the originator what software they use and how they exported it (maybe they copied a internal data file and did not use export?).
>
> Gruss
> Bernd
>
> --
> http://www.seeburger.com
> ________________________________________
> From: [hidden email] [[hidden email]]
> Sent: Thursday, April 26, 2018 16:39
> To: [hidden email]
> Subject: Re: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
>
> Hello Bernd,
>
> enclosed the dump of the file:
>
> # off=0 ctb=99 tag=6 hlen=3 plen=269
> :public key packet:
>         version 4, algo 1, created 1319469699, expires 0
>         pkey[0]: CB065FBDE21CAA7ECB325635FCD9819571AD324094AF45E5D3A3770278B3CEA
> 6574961CE70B42019478BBD12D42FF4164ACC0CCB9E0240CE84D38A750E8D83408E1D3159DF75DC3
> 7203DD11D45B79222BE790758040524C3EEA59D916F005983F0AF11097F5EFED3DD2BB49433B0413
> F59B48E8F5CB7FA355DC1DA9316E86EAEB5EF57E229EA780DD5EC1EA5847CCA7F4207150084B14CB
> 460CA99F4D7D16E3638F4201E5ECEF029FBEF4F257594E09D947082ABD461F7AEBB6FCA8206A3B15
> 330C1BE3E8F098938D7B970B4CDE8BC1FDF37933778073A4EDC0BA690EAE760F65308655B5727E58
> BC7664D42DCF3FF397AEB99D9B39F3FB9D2B43274511CCB4D
>         pkey[1]: 010001
>         keyid: FB7427CEC70D4DBD
> # off=272 ctb=b4 tag=13 hlen=2 plen=6
> :user ID packet: "dal.de"
> # off=280 ctb=89 tag=2 hlen=3 plen=395
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 3f 52
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 25 len 1 (primary user ID)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 63A0D14C029CD4E18B9C6209831F7EF7CB9E2EF59E4A3AFC21A977822EF3D3DA90
> 06D3E9ECC7B0BBD9D3FF0ADE80B422700E153755D9C93A741B2342AB73054DB65B8044C989A10482
> 569F71340015F65C6CA488F14B0C8263DC3BB2453F35B650D64FECA7C02BC4A7043B1F37411F3371
> E9F581BACD45537B4E9F7FBFD11EA85285242F95C7B62A73CCC73E0D6690124204E6D5B37DA085C9
> F0FB1A3E1FEB73BE69A09B7DBDCE9529E2A5D9510ECD64EFD15E079CA8072102C9D2C4EC37263214
> B97CEB0C75493AF43DC293D7DF9349C0EEF7155DF3CD79F6E5F6F22F99957ED11339CD8BB2C4C830
> 3117F673F33CB6AB3C3CC37E2DA494F96BED9253F9A746
> # off=678 ctb=b4 tag=13 hlen=2 plen=3
> :user ID packet: "DAL"
> # off=683 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 67 80
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 4D5B0D8D9F88DDF97F3B6B8FF3B591A1E99F08AB1FCC54E0BB4498B8B68D5A30BB
> 6A214AE032B7C186863F6BF475AAAA9FB3B91FCC3DE6C38CB84052447E1A99931393448EE8E4E031
> 0B743747B6201237FF48999595582C4A2744020E146944FB32B576B52B8CCD68FB87D50ABACF533B
> F535970786BEF5CD1A46D60DD3D6DB9737070F8DA8D08F0196A179491F8F7668AEAAE3A710B4DEB0
> 3F05D0F62B962D049EECC4F6A90C99B0362A1479B73410604B00C053191182B38E865A6B55471897
> C449F50035F4B2EE4BF2FE3DCEA819DAC7899265772D24C371D2E0AB98D14E2BAA159D91F0327707
> B569D6E45794AF292B4C0727CCC96412A6498A806C7A2F
> # off=1078 ctb=b4 tag=13 hlen=2 plen=19
> :user ID packet: "dal.de <[hidden email]>"
> # off=1099 ctb=89 tag=2 hlen=3 plen=371
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 62 89
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 137720B356990C611BCC059FC016C198ED52F7E5BAA0795C345B718EF663CA14F4
> EB204054F4E35944D4BB79366A8E1335DB5476CBD1E2EBDEA010C6F82960FE32D914C5955A605927
> F49ED914DE7149560B40771DE6D3E68C8432E9D76592E05AD2637E59F3CAC13D03A5DA12034E4F4F
> 409B5551155E231B8D27E56F74D5256A1D6F4311956EFE38566ED789DDB0A7EFF2004CAFA2B86284
> B3990900C68782E99C57FF035346D42D362AB75FF43C3DF872EF622D9931F7F242AD1D40D60D96A2
> 44DA825CC161D04D3239D1EC341FA59DCEA6787CE4B521363F86B95DCD5429BCE771491CA47FEB6C
> 86732EFA41A77D53EC0C28FC8E1FC2C8EA10A75AA210FA
> # off=1473 ctb=89 tag=2 hlen=3 plen=1089
> :signature packet: algo 100, keyid 0000000000000000
>         version 4, created 1477474440, md5len 0, sigclass 0x10
>         digest algo gpg: can't handle public key algorithm 100
> 2, begin of digest 00 00
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 3 len 4 (sig expires after 10y0d0h0m)
>         hashed subpkt 5 len 2 (trust signature of depth 255, value 120)
>         hashed subpkt 27 len 1 (key flags: 0F)
>         hashed subpkt 100 len 1054 (experimental / private subpacket)
>         unknown algorithm 100
> # off=2565 ctb=b4 tag=13 hlen=2 plen=10
> :user ID packet: "dlf-stb.de"
> # off=2577 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest c3 f3
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 8885E590EB012B5589B89C2B4A8EAF693FFDF07AB319FE574F3AE2BFAD00A67746
> 6B6F221BB9407B236AFEFB8CFAB625C05E75C1242C5BCAF211DEA46B6A78132416DDF23F326D12DF
> DEBD5FE51800F15C75B7B14F1162190CBEF792841B5D149B529A51EAEDCE959E488B3E5CCA99BB5C
> 86AB3465F0E422D2D4538FAF7A3EAE081DE8679C4B415B60DD11D6B2CF1F0F9669C4A72FAE27EBC5
> F72893B30FFF9A36E16DDDB525285CD7EC61181363D5C74727EEB95F168C67F34505B37CD268A901
> 2C7172DC4042DF3C42976703EE216C5DE92F1975529CA41BF9304BAFC8CE0A6BB8AA6A55C23D29C5
> A476033A90E6E8FDC45056485F9C41CB9279BA3E4AC5E4
> # off=2972 ctb=b4 tag=13 hlen=2 plen=15
> :user ID packet: "deutsche-ppp.de"
> # off=2989 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 43 71
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 8C7EEF22C8BE67E27753E1580796BBB11B343C753996CCDFD81B97899840D620B7
> 13D2EB4A634EF6AE1A3556893DBFA73C5A2E0667E28D7151EF91B59F446ED5F71E431A1FB2284E85
> DD55E73DD93CE947B044D565BE77B5ACF6A3D274272E3ED982F9F91DAE3FC289478CD8D44770744E
> 51388F8D795A16A0C4DBFA5CB7F8AE8735ED5AAF4356C7A164FBC10BC948DB1173903816D2C25FFE
> 1BFC5F187DF8964B2BCC518046A0A5EB10A4499A2D45C63A8377209C55F52B48312023F6634A5FA0
> 211B7D3DF14577BB034712B9595A69E647EF0E60C9A86F42DA3D15B01F08061DB218F54CC45FDC09
> E22E4EFB556397638FC4D15A1BA4B11063A5880F97AC55
> # off=3384 ctb=b4 tag=13 hlen=2 plen=16
> :user ID packet: "deutsche-ppp.com"
> # off=3402 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 44 aa
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: C8C9150687795F19F5A8DAFD7747E4E00B87965B564489FD4787CF166EF89167B6
> AEED31CC22215B8905C8754A88CDD831707E8049610C6E324F86E4FEAAFB7F8BFB4A7A23D11DF17F
> 5963E6D49906D1F3E3038632A756798DDF2DBBF3B4CEACC41C3963C0247EAC736EF2ADCE177C19C0
> 2F3368E15B15534866A962DE11D85065B79E77DBA3ED9071593F363DB612F8C06A42415708F3CD34
> 22E92CF04D754A93EBE5914C4F6FAD14EA58238182C5A4B6A7999E4B8CE5A765F082F35F645B8BCD
> 1DF09A5ABD6EFFDFC977A676EE192DE2DB752B80EEB9BE8FD1E3D6C301DAF5DC4965DC7C08522394
> 57CEA6A27A7211638C0E9A4B18BFC5EA6DB2F2D34D4C47
> # off=3797 ctb=b4 tag=13 hlen=2 plen=13
> :user ID packet: "dal-polska.pl"
> # off=3812 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 67 7e
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 9D20EB63166C795D6304958A6CADDB051955B57C856BB78783C925CDA3E856CE09
> F2D333FBAFBD3D95370016D8A682BC473320980722408A780853C029DC6C40D888DC1042576A69AA
> F4F05356D84F726F7F29C3BB5B98C0E6BD3D0A7C69D28F331BDDDC28D24EB7B28410F89209EF9AA0
> C9694A4FA5045A2C135CDD757067831E548AA555D8FF3CE175DC96B03A5592979A54F7296599113C
> 626DBD41B88C4BDA2CF4056AC4E179C4F4BA3886F99B44ADFDE1B73337B43EC7A94D778C3E33A400
> 4ECE4C7ACB3CC2221A077B784EE72294DCD98032026F8920167E1A0651FC832B98D2950BC6229593
> 5B7296D45C1F3AB3A24EDB9548D451652347A375295270
> # off=4207 ctb=b4 tag=13 hlen=2 plen=14
> :user ID packet: "dal-romania.ro"
> # off=4223 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest bd a6
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: BDDA560AF0F259F77FE378ABC897FBBA8DC6FCE607B3C527CB936AD87A8D95D06C
> 098ED366332E4958AB433AAA9A9A92CFF1FF2717D9229AC91E1BCBA8B1C97041912E36009AB93C29
> A81928240DE343C3AF5B21F849E0F1148B2EF2E8086AB08A9B05DECCB87164FD8CF090676AFBF62B
> FC002610925EF165EC5D833163B7B0BAD4D2462E470E7B8AB037D6F6A806B2290E815E4065CADF28
> 2B103012BA3139478EB0DBE4096051C50A07AF0663DBF6C7BEEE5C99149A309A8E3D3A4A914A3965
> 433A3CDF303B841FD9DD44B27F1D7A06A7725D4EAB2A6611502DFE54A3B066B0C020C10802F63458
> 254B868BEE894017A4B6F2AE122D1A0F42D02143945894
> # off=4618 ctb=b4 tag=13 hlen=2 plen=15
> :user ID packet: "lbsh-leasing.de"
> # off=4635 ctb=89 tag=2 hlen=3 plen=392
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x10
>         digest algo 2, begin of digest 71 51
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 20 len 47 (notation: [hidden email]=pgpm
> ime)
>         hashed subpkt 11 len 5 (pref-sym-algos: 9 3 2 1 10)
>         hashed subpkt 24 len 24 (preferred keyserver: ldap://pme001cl01.dal.de)
>         hashed subpkt 27 len 4 (key flags: 03 00 00 00)
>         hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
>         hashed subpkt 30 len 4 (features: 01 00 00 00)
>         hashed subpkt 21 len 2 (pref-hash-algos: 8 10)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 594065C8FAF2A43F508BC8E404619E8168EB31173AA0987DA7BB480C3FE57E5C24
> A8142EA7590DB442D182567EC4B1E70BA85E1C77FF9A1919F71F0DE39F5E6F087675CF7B7A49C079
> E99791D1C646DFBB9EBB2D3E9C7F0EE54F9193DBF0ED4A6DC56E46B3DAD40648A4763E1C4AF50728
> 68D22EFF62E3F4D4806C66C48F86518605709A848FFE36BB31F4F86CB57103440F42453AF79EE7A8
> AF033FA926376E8E19EBFF73CD2FA17564BD779FD3E7305D6841F61FE521383B3FBA85A03F68A1AF
> 628864A893ED137A52C4C62EB253B3188B16A9AE2BD63AABCAF3A0458713C2B2DA32EC28CC1B7F95
> 08F733F45C0895CC7FCF477327B53FAC1F0126FA7E043A
> # off=5030 ctb=b9 tag=14 hlen=3 plen=269
> :public sub key packet:
>         version 4, algo 1, created 1319469699, expires 0
>         pkey[0]: C018FE8FED10246D89121FC9EABC798AC3992DF3622414BF511B7D03C1F5006
> 5E29262F456A35C9FFFCA83F9C5E5711591C08F2D82B7795CF9980542194DE6DB229B979D2FD72E6
> 4B0E09F4430DDBE41A11706A2D37D59FBCE9CB8E66889AB506A3CCF72F7EE56453D865D0B83B7E4E
> 9BF13019A9028D5150F5DC989687B5FFB7942A1E7C54BD80BACE8A1B6843E2955620D0D416F5E825
> 519AFD9ABCFA6F9819B6B316B7F3D62EB1CE78691A049A8AEB7B86FC291358423C06D99C4CC09D46
> 94683DCF02121A843FC5D41756B62442DC27379EC04D953294288117D38B89C94B0DF6D825C99171
> 076BB434E4221CEF37F526F7AAB71B4269E4643007ECED335
>         pkey[1]: 010001
>         keyid: DA7B0663454DA370
> # off=5302 ctb=89 tag=2 hlen=3 plen=583
> :signature packet: algo 1, keyid FB7427CEC70D4DBD
>         version 4, created 1477473683, md5len 0, sigclass 0x18
>         digest algo 2, begin of digest 8d 5d
>         hashed subpkt 2 len 4 (sig created 2016-10-26)
>         hashed subpkt 9 len 4 (key does not expire)
>         hashed subpkt 27 len 4 (key flags: 0C 00 00 00)
>         hashed subpkt 32 len 284 (signature: v4, class 0x19, algo 1, digest algo
>  8)
>         subpkt 16 len 8 (issuer key ID FB7427CEC70D4DBD)
>         data: 528254CF86B215694FC8EC863ECE873E08F71AA5808BDA5EC781B447866BE0049F
> EA5852E5C878FAF4C7A44E48CA4F892F0E3117526E01DA14E2CCFCF2CA05FEAF248C9869F1FCCBA6
> 9B810458EFB741BC1565024F5031E70DF34CE564A150CE0D797AE59EB6098E1D4F9BF7C06B74A926
> 5B9EDD54BFBB08534C4BE7B7BB100914110598CEF2EF9F952DFC723FB247FEF174DAA0B17D2C9BC6
> 6C5B4D4EFE4A304E54C7FCDA846950ADE77AA03772FC2E47CE0EEA89652322267D6F39F9EB683B78
> C68AC62D1BDE0293184356428C65F78A415B28000AFABD94B511D29F5BE474123E807A89E503AB7C
> 6FE8DDB3DD1F40010E437536709D9B800EE1568314A042
> # off=5888 ctb=fc tag=60 hlen=3 plen=527 new-ctb
> :unknown packet: type 60, length 527
> dump: 04 01 30 82 02 09 30 81  f2 02 01 01 30 0d 06 09  2a 86 48 86 f7 0d 01 01
>   24: 0b 05 00 30 81 99 31 0f  30 0d 06 03 55 04 03 13  06 64 61 6c 2e 64 65 31
>   48: 33 30 31 06 03 55 04 0a  0c 2a 44 41 4c 20 44 65  75 74 73 63 68 65 20 41
>   72: 6e 6c 61 67 65 6e 2d 4c  65 61 73 69 6e 67 20 47  6d 62 48 20 26 20 43 6f
>   96: 2e 20 4b 47 31 0b 30 09  06 03 55 04 0b 13 02 49  54 31 0e 30 0c 06 03 55
>  120: 04 07 13 05 4d 61 69 6e  7a 31 0c 30 0a 06 03 55  04 08 13 03 52 4c 50 31
>  144: 0b 30 09 06 03 55 04 06  13 02 44 45 31 19 30 17  06 09 2a 86 48 86 f7 0d
>  168: 01 09 01 16 0a 75 68 64  40 64 61 6c 2e 64 65 17  0d 31 38 30 31 30 32 32
>  192: 33 30 32 30 32 5a 17 0d  31 38 30 31 30 39 32 33  30 32 30 32 5a a0 24 30
>  216: 22 30 13 06 03 55 1d 23  04 0c 30 0a 80 08 fb 74  27 ce c7 0d 4d bd 30 0b
>  240: 06 03 55 1d 14 04 04 02  02 08 a0 30 0d 06 09 2a  86 48 86 f7 0d 01 01 0b
>  264: 05 00 03 82 01 01 00 42  de 3c 28 51 92 e3 b2 8d  1e 3e 54 8b 8d 11 de a5
>  288: 0c be 92 fc df cb d2 f3  79 55 e1 7e 0e 4d af a2  1c f5 fe fb 86 ac 74 5d
>  312: 59 f7 b4 64 8d ec a6 f0  f3 79 d8 15 55 a0 57 8d  a8 8c ce 2e 14 5d c5 ee
>  336: a3 54 69 d3 ed e8 d3 85  41 3a 82 72 a6 8f 00 5a  a9 26 b4 15 56 64 81 d8
>  360: a5 c4 ed d6 9f d2 3d b1  e2 47 bd a5 2f 3b a1 44  94 7f ce 67 4e 6c b2 ff
>  384: dc aa 6b 33 55 68 14 5f  e0 32 49 34 ad 09 98 0a  25 5d 16 78 0c 53 63 9b
>  408: 29 e9 3c cb 58 c3 d8 8f  12 8e 26 60 99 84 6b 6e  e0 e8 42 7f 57 c1 e2 25
>  432: cd 8b 21 b8 8e 30 c4 bd  36 72 62 1f 42 bf 9c 0f  d1 c3 4e 44 b8 68 88 c4
>  456: 2f fd 73 13 37 8f a8 b0  35 2a 92 d2 01 fc 52 f4  c0 a2 8a 27 39 62 39 b0
>  480: ba de b1 5b 5d 36 a1 d4  26 a1 45 43 4f fd cd 05  11 10 20 cb d7 db 43 db
>  504: 5a 2a 31 a5 0a c6 84 80  61 1b 87 ba 82 95 a7 a4  a0 56 d7 1a 88 fb 1b
>
> Kind regards
> Rolf
>
>
> -----Original-Nachricht-----
> Betreff: RE: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
> Datum: 2018-04-26T13:43:18+0200
> Von: "Eckenfels. Bernd" <[hidden email]>
> An: "[hidden email]" <[hidden email]>
>
> Hello,
>
> Can you dump the file with a PgPdumper like `gpg -list-packets`. You could also try to import it into a local gpg keystore and export it from there.
>
> Gruss
> Bernd
>
> --
> http://www.seeburger.com
> ________________________________________
> From: [hidden email] [[hidden email]]
> Sent: Thursday, April 26, 2018 12:55
> To: [hidden email]
> Subject: [dev-crypto] Problem with BcPGPPublicKeyRingCollection
>
> Hello all,
>
> we have an application to manage certificates/public keys. For this we use the Bouncy Castle library.
>
> >From a client we got a specific PGP public key with which we get this error message:
>
> "org.bouncycastle.openpgp.PGPException: org.bouncycastle.bcpg.ExperimentalPacket found where PGPPublicKeyRing expected"
>
> The error occurrs in the function BcPGPPublicKeyRingCollection:
>
> "pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));"
>
> Our code:
>
> private void read(byte[] bytes) throws GRPPGPException {
>   ByteArrayInputStream in = new ByteArrayInputStream(bytes);
>    in.mark(bytes.length);
>
>    try {
>      skr = new BcPGPSecretKeyRingCollection (PGPUtil.getDecoderStream(in));
>      if ( (skr != null) && skr.getKeyRings().hasNext()){
>      // Must be secret ring
>         isSecret = true;
>        return;
>     }
>     // XXX Mind the (null)! This is not a secret key ring
>  } catch (EOFException se) {
>     //log.error("", se);
>  } catch (IOException e) {
>     IOHelper.closeQuietly(in);
>     log.error("", e);
>     throw new GRPPGPException("I/O error while parsing Secret key ring!", e);
>  } catch (PGPException e) {
>     log.debug("Not a PGP secret key ring! Reading as public key ring ...");
>  }
> try {
>    in.reset();
>    pbkr = new BcPGPPublicKeyRingCollection(PGPUtil.getDecoderStream(in));
>    if ( (pbkr != null) && pbkr.getKeyRings().hasNext()){
>       isSecret = false;
>       return;
>    }
>    // This is not a public key ring
>       throw new PGPException("No public keys found in keyring!");
>    } catch (IOException e) {
>       throw new GRPPGPException("I/O error while parsing Public key ring!", e);
>    } catch (PGPException e) {
>       // final attempt failed
>       throw new GRPPGPException("Key ring is neither of PGP secret type, nor of PGP public type! "
>       + "Key ring will not be opened.", e);
>    } finally {
>       IOHelper.closeQuietly(in);
>    }
> }
>
> Unfortunately we could not found the cause. We could not reproduced the issue with any other PGP public key.
>
> We have also tested with PGPPublicKeyRingCollection, but with the same result.
>
> We have tested it with the versions 1.51 and 1.59. In both versions we got the same error.
>
> Does anybody have an idea what could be the cause for the error?
>
> Thanks in advanced!
>
> Kind regards
> Rolf
>
>
>
>
>
>
>
>
>
>
>
> SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
> Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
> Edisonstr. 1
> D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
> Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
> Fax: 07252 / 96 - 2222
> Internet: http://www.seeburger.de               Registergericht/Commercial Register:
> e-mail: [hidden email]               HRB 240708 Mannheim
>
>
> Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.
>
>
> This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.
>
> ?
>
>
>
>
>
>
>
>
>
> SEEBURGER AG            Vorstand/SEEBURGER Executive Board:
> Sitz der Gesellschaft/Registered Office:                Axel Haas, Michael Kleeberg, Friedemann Heinz, Dr. Martin Kuntz, Matthias Feßenbecker
> Edisonstr. 1
> D-75015 Bretten         Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
> Tel.: 07252 / 96 - 0            Prof. Dr. Simone Zeuchner
> Fax: 07252 / 96 - 2222
> Internet: http://www.seeburger.de               Registergericht/Commercial Register:
> e-mail: [hidden email]               HRB 240708 Mannheim
>
>
> Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung, Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Eckenfels. Bernd) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge auf Viren zu prüfen.
>
>
> This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional secrecy. Any fact or opinion contained, or expression of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding, copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Eckenfels. Bernd) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.
>
>
> 
>
>