Package org.pgpainless.algorithm
Class Trustworthiness
java.lang.Object
org.pgpainless.algorithm.Trustworthiness
Facade class for
TrustSignature
.
A trust signature subpacket marks the trustworthiness of a certificate and defines its capabilities to act
as a trusted introducer.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canIntroduce
(int otherDepth) Return true, if the certified cert can introduce certificates with trust depth ofboolean
canIntroduce
(Trustworthiness other) Return true, if the certified cert can introduce certificates with the givenstatic Trustworthiness.Builder
This means that we are fully convinced of the trustworthiness of the key.int
Get the trust amount.int
getDepth()
Get the depth of the trust signature.boolean
Return true if the certificate is fully trusted.boolean
Return true, if the cert is an introducer.boolean
Return true if the certificate is at least marginally trusted.boolean
Returns true, if the trust amount is equal to 0.static Trustworthiness.Builder
This means that we are marginally (partially) convinced of the trustworthiness of the key.static Trustworthiness.Builder
This means that we do not trust the key.
-
Field Details
-
THRESHOLD_FULLY_CONVINCED
public static final int THRESHOLD_FULLY_CONVINCED- See Also:
-
MARGINALLY_CONVINCED
public static final int MARGINALLY_CONVINCED- See Also:
-
NOT_TRUSTED
public static final int NOT_TRUSTED- See Also:
-
-
Constructor Details
-
Trustworthiness
public Trustworthiness(int amount, int depth)
-
-
Method Details
-
getAmount
public int getAmount()Get the trust amount. This value means how confident the issuer of the signature is in validity of the binding.- Returns:
- trust amount
-
getDepth
public int getDepth()Get the depth of the trust signature. This value controls, whether the certificate can act as a trusted introducer.- Returns:
- depth
-
isNotTrusted
public boolean isNotTrusted()Returns true, if the trust amount is equal to 0. This means the key is not trusted. Otherwise return false- Returns:
- true if untrusted
-
isMarginallyTrusted
public boolean isMarginallyTrusted()Return true if the certificate is at least marginally trusted. That is the case, if the trust amount is greater than 0.- Returns:
- true if the cert is at least marginally trusted
-
isFullyTrusted
public boolean isFullyTrusted()Return true if the certificate is fully trusted. That is the case if the trust amount is greater than or equal to 120.- Returns:
- true if the cert is fully trusted
-
isIntroducer
public boolean isIntroducer()Return true, if the cert is an introducer. That is the case if the depth is greater 0.- Returns:
- true if introducer
-
canIntroduce
public boolean canIntroduce(int otherDepth) Return true, if the certified cert can introduce certificates with trust depth ofotherDepth
.- Parameters:
otherDepth
- other certifications trust depth- Returns:
- true if the cert can introduce the other
-
canIntroduce
Return true, if the certified cert can introduce certificates with the givenother
trust depth.- Parameters:
other
- other certificates trust depth- Returns:
- true if the cert can introduce the other
-
fullyTrusted
This means that we are fully convinced of the trustworthiness of the key.- Returns:
- builder
-
marginallyTrusted
This means that we are marginally (partially) convinced of the trustworthiness of the key.- Returns:
- builder
-
untrusted
This means that we do not trust the key. Can be used to overwrite previous trust.- Returns:
- builder
-