Skip to content

Commit

Permalink
added version constants (relates to github bcgit#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Jul 21, 2023
1 parent 10f8911 commit 41df006
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/SignaturePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
public class SignaturePacket
extends ContainedPacket implements PublicKeyAlgorithmTags
{
public static final int VERSION_2 = 2;
public static final int VERSION_3 = 3;
public static final int VERSION_4 = 4; // https://datatracker.ietf.org/doc/rfc4880/
public static final int VERSION_5 = 5; // https://datatracker.ietf.org/doc/draft-koch-openpgp-2015-rfc4880bis/
public static final int VERSION_6 = 6; // https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh/

private int version;
private int signatureType;
private long creationTime;
Expand All @@ -36,7 +42,7 @@ public class SignaturePacket

version = in.read();

if (version == 3 || version == 2)
if (version == VERSION_3 || version == VERSION_2)
{
int l = in.read();

Expand All @@ -53,7 +59,7 @@ public class SignaturePacket
keyAlgorithm = in.read();
hashAlgorithm = in.read();
}
else if (version == 4)
else if (version == VERSION_4)
{
signatureType = in.read();
keyAlgorithm = in.read();
Expand Down

0 comments on commit 41df006

Please sign in to comment.