Package org.pgpainless.authentication
Class CertificateAuthenticity
- java.lang.Object
-
- org.pgpainless.authentication.CertificateAuthenticity
-
public class CertificateAuthenticity extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CertificateAuthenticity.CertificationChain
static class
CertificateAuthenticity.ChainLink
A chain link contains a node in the trust chain.
-
Constructor Summary
Constructors Constructor Description CertificateAuthenticity(org.bouncycastle.openpgp.PGPPublicKeyRing certificate, java.lang.String userId, java.util.Map<CertificateAuthenticity.CertificationChain,java.lang.Integer> certificationChains, int targetAmount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAuthenticityPercentage()
Return the degree of authentication of the binding in percent. 100% means full authentication.org.bouncycastle.openpgp.PGPPublicKeyRing
getCertificate()
java.util.Map<CertificateAuthenticity.CertificationChain,java.lang.Integer>
getCertificationChains()
Return a map ofCertificationChains
and their respective effective trust amount.int
getTotalTrustAmount()
java.lang.String
getUserId()
boolean
isAuthenticated()
Return true, if the binding is authenticated to a sufficient degree.
-
-
-
Constructor Detail
-
CertificateAuthenticity
public CertificateAuthenticity(@Nonnull org.bouncycastle.openpgp.PGPPublicKeyRing certificate, @Nonnull java.lang.String userId, @Nonnull java.util.Map<CertificateAuthenticity.CertificationChain,java.lang.Integer> certificationChains, int targetAmount)
-
-
Method Detail
-
getUserId
@Nonnull public java.lang.String getUserId()
-
getCertificate
@Nonnull public org.bouncycastle.openpgp.PGPPublicKeyRing getCertificate()
-
getTotalTrustAmount
public int getTotalTrustAmount()
-
getAuthenticityPercentage
public int getAuthenticityPercentage()
Return the degree of authentication of the binding in percent. 100% means full authentication. Values smaller than 100% mean partial authentication.- Returns:
- authenticity in percent
-
isAuthenticated
public boolean isAuthenticated()
Return true, if the binding is authenticated to a sufficient degree.- Returns:
- true if total gathered evidence outweighs the target trust amount.
-
getCertificationChains
@Nonnull public java.util.Map<CertificateAuthenticity.CertificationChain,java.lang.Integer> getCertificationChains()
Return a map ofCertificationChains
and their respective effective trust amount. The effective trust amount of a path might be smaller than its actual trust amount, for example if nodes of a path are used multiple times.- Returns:
- map of certification chains and their effective trust amounts
-
-