Skip to content

Commit 13bc779

Browse files
committed
Rename more methods for clarity
1 parent 645765b commit 13bc779

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,7 @@ private OpenPGPSignatureChain(OpenPGPSignatureChain copy)
28272827

28282828
public OpenPGPComponentSignature getSignature()
28292829
{
2830-
return getHeadLink().getSignature();
2830+
return getLeafLink().getSignature();
28312831
}
28322832

28332833
/**
@@ -2839,7 +2839,7 @@ public OpenPGPComponentSignature getSignature()
28392839
public OpenPGPSignatureChain plus(OpenPGPComponentSignature sig,
28402840
OpenPGPCertificateComponent targetComponent)
28412841
{
2842-
if (getHeadKey() != sig.getIssuerComponent())
2842+
if (getLeafLinkTargetKey() != sig.getIssuerComponent())
28432843
{
28442844
throw new IllegalArgumentException("Chain head is not equal to link issuer.");
28452845
}
@@ -2863,17 +2863,17 @@ public Link getRootLink()
28632863
return chainLinks.get(0);
28642864
}
28652865

2866-
public OpenPGPComponentKey getRootKey()
2866+
public OpenPGPComponentKey getRootLinkIssuer()
28672867
{
2868-
return getRootLink().issuer;
2868+
return getRootLink().getSignature().getIssuer();
28692869
}
28702870

2871-
public Link getHeadLink()
2871+
public Link getLeafLink()
28722872
{
28732873
return chainLinks.get(chainLinks.size() - 1);
28742874
}
28752875

2876-
public OpenPGPComponentKey getHeadKey()
2876+
public OpenPGPComponentKey getLeafLinkTargetKey()
28772877
{
28782878
return getSignature().getTargetKeyComponent();
28792879
}
@@ -2966,7 +2966,7 @@ public boolean isEffectiveAt(Date evaluationDate)
29662966
public boolean isValid()
29672967
throws PGPSignatureException
29682968
{
2969-
OpenPGPComponentKey rootKey = getRootKey();
2969+
OpenPGPComponentKey rootKey = getRootLinkIssuer();
29702970
if (rootKey == null)
29712971
{
29722972
throw new MissingIssuerCertException(getRootLink().signature, "Missing issuer certificate.");
@@ -3026,7 +3026,7 @@ public int compareTo(OpenPGPSignatureChain other)
30263026
return compare;
30273027
}
30283028

3029-
compare = -getHeadLink().since().compareTo(other.getHeadLink().since());
3029+
compare = -getLeafLink().since().compareTo(other.getLeafLink().since());
30303030
if (compare != 0)
30313031
{
30323032
return compare;
@@ -3325,7 +3325,7 @@ public OpenPGPSignatureChains fromOrigin(OpenPGPComponentKey root)
33253325
OpenPGPSignatureChains chainsFromRoot = new OpenPGPSignatureChains(root);
33263326
for (OpenPGPSignatureChain chain : chains)
33273327
{
3328-
OpenPGPComponentKey chainRoot = chain.getRootKey();
3328+
OpenPGPComponentKey chainRoot = chain.getRootLinkIssuer();
33293329
if (chainRoot == root)
33303330
{
33313331
chainsFromRoot.add(chain);

0 commit comments

Comments
 (0)