mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-06 17:25:05 -05:00
more probable changes for spongycastle2
This commit is contained in:
parent
f7afa0c820
commit
7897c6fadd
@ -103,6 +103,15 @@ public class PGPObjectFactory
|
||||
{
|
||||
throw new IOException("can't create secret key object: " + e);
|
||||
}
|
||||
case PacketTags.SECRET_SUBKEY:
|
||||
try
|
||||
{
|
||||
return PGPSecretKeyRing.readSubkey(in, fingerPrintCalculator);
|
||||
}
|
||||
catch (PGPException e)
|
||||
{
|
||||
throw new IOException("processing error: " + e.getMessage());
|
||||
}
|
||||
case PacketTags.PUBLIC_KEY:
|
||||
return new PGPPublicKeyRing(in, fingerPrintCalculator);
|
||||
case PacketTags.PUBLIC_SUBKEY:
|
||||
|
@ -477,4 +477,23 @@ public class PGPSecretKeyRing
|
||||
|
||||
return new PGPSecretKeyRing(keys, secRing.extraPubKeys);
|
||||
}
|
||||
|
||||
static PGPSecretKey readSubkey(BCPGInputStream in, KeyFingerPrintCalculator fingerPrintCalculator)
|
||||
throws IOException, PGPException
|
||||
{
|
||||
SecretSubkeyPacket sub = (SecretSubkeyPacket)in.readPacket();
|
||||
|
||||
//
|
||||
// ignore GPG comment packets if found.
|
||||
//
|
||||
while (in.nextPacketTag() == PacketTags.EXPERIMENTAL_2)
|
||||
{
|
||||
in.readPacket();
|
||||
}
|
||||
|
||||
TrustPacket subTrust = readOptionalTrustPacket(in);
|
||||
List sigList = readSignaturesAndTrust(in);
|
||||
|
||||
return new PGPSecretKey(sub, new PGPPublicKey(sub.getPublicKeyPacket(), subTrust, sigList, fingerPrintCalculator));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user