1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-19 02:42:05 +01:00

Kotlin conversion: CertificateAuthority

This commit is contained in:
Paul Schaub 2023-08-06 14:38:38 +02:00
parent 58951ce19a
commit 84e554fc0d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -4,11 +4,8 @@
package org.pgpainless.authentication; package org.pgpainless.authentication;
import org.pgpainless.key.OpenPgpFingerprint; import org.pgpainless.key.OpenPgpFingerprint
import java.util.*
import javax.annotation.Nonnull;
import java.util.Date;
import java.util.List;
/** /**
* Interface for a CA that can authenticate trust-worthy certificates. * Interface for a CA that can authenticate trust-worthy certificates.
@ -17,7 +14,7 @@ import java.util.List;
* @see <a href="https://github.com/pgpainless/pgpainless-wot">PGPainless-WOT</a> * @see <a href="https://github.com/pgpainless/pgpainless-wot">PGPainless-WOT</a>
* @see <a href="https://sequoia-pgp.gitlab.io/sequoia-wot/">OpenPGP Web of Trust</a> * @see <a href="https://sequoia-pgp.gitlab.io/sequoia-wot/">OpenPGP Web of Trust</a>
*/ */
public interface CertificateAuthority { interface CertificateAuthority {
/** /**
* Determine the authenticity of the binding between the given fingerprint and the userId. * Determine the authenticity of the binding between the given fingerprint and the userId.
@ -33,11 +30,11 @@ public interface CertificateAuthority {
* 60 = partially authenticated...) * 60 = partially authenticated...)
* @return information about the authenticity of the binding * @return information about the authenticity of the binding
*/ */
CertificateAuthenticity authenticateBinding(@Nonnull OpenPgpFingerprint fingerprint, fun authenticateBinding(fingerprint: OpenPgpFingerprint,
@Nonnull String userId, userId: String,
boolean email, email: Boolean,
@Nonnull Date referenceTime, referenceTime: Date,
int targetAmount); targetAmount: Int): CertificateAuthenticity;
/** /**
* Lookup certificates, which carry a trustworthy binding to the given userId. * Lookup certificates, which carry a trustworthy binding to the given userId.
@ -50,10 +47,10 @@ public interface CertificateAuthority {
* 60 = partially authenticated...) * 60 = partially authenticated...)
* @return list of identified bindings * @return list of identified bindings
*/ */
List<CertificateAuthenticity> lookupByUserId(@Nonnull String userId, fun lookupByUserId(userId: String,
boolean email, email: Boolean,
@Nonnull Date referenceTime, referenceTime: Date,
int targetAmount); targetAmount: Int): List<CertificateAuthenticity>
/** /**
* Identify trustworthy bindings for a certificate. * Identify trustworthy bindings for a certificate.
@ -65,7 +62,7 @@ public interface CertificateAuthority {
* 60 = partially authenticated...) * 60 = partially authenticated...)
* @return list of identified bindings * @return list of identified bindings
*/ */
List<CertificateAuthenticity> identifyByFingerprint(@Nonnull OpenPgpFingerprint fingerprint, fun identifyByFingerprint(fingerprint: OpenPgpFingerprint,
@Nonnull Date referenceTime, referenceTime: Date,
int targetAmount); targetAmount: Int): List<CertificateAuthenticity>
} }