Merge pull request #7421 from thunderbird/convert_to_kotlin

Convert `CertificateValidationException` and `CertificateChainException` to Kotlin
This commit is contained in:
cketti 2023-12-08 12:34:33 +01:00 committed by GitHub
commit b73ebdeecc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 47 deletions

View file

@ -1,27 +0,0 @@
package com.fsck.k9.mail;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* A {@link CertificateException} extension that provides access to
* the pertinent certificate chain.
*
*/
public class CertificateChainException extends CertificateException {
private static final long serialVersionUID = 1103894512106650107L;
private X509Certificate[] mCertChain;
public CertificateChainException(String msg, X509Certificate[] chain, Throwable cause) {
super(msg, cause);
setCertChain(chain);
}
public void setCertChain(X509Certificate[] chain) {
mCertChain = chain;
}
public X509Certificate[] getCertChain() {
return mCertChain;
}
}

View file

@ -0,0 +1,13 @@
package com.fsck.k9.mail
import java.security.cert.CertificateException
import java.security.cert.X509Certificate
/**
* A [CertificateException] extension that provides access to the pertinent certificate chain.
*/
class CertificateChainException(
message: String?,
val certChain: Array<out X509Certificate>?,
cause: Throwable?,
) : CertificateException(message, cause)

View file

@ -1,20 +0,0 @@
package com.fsck.k9.mail;
import java.security.cert.X509Certificate;
import java.util.List;
import org.jetbrains.annotations.NotNull;
public class CertificateValidationException extends MessagingException {
private final List<X509Certificate> certificateChain;
public CertificateValidationException(@NotNull List<X509Certificate> certificateChain, Throwable cause) {
super(cause);
this.certificateChain = certificateChain;
}
public List<X509Certificate> getCertificateChain() {
return certificateChain;
}
}

View file

@ -0,0 +1,8 @@
package com.fsck.k9.mail
import java.security.cert.X509Certificate
class CertificateValidationException(
val certificateChain: List<X509Certificate>,
cause: Throwable?,
) : MessagingException(cause)