Merge pull request #7421 from thunderbird/convert_to_kotlin
Convert `CertificateValidationException` and `CertificateChainException` to Kotlin
This commit is contained in:
commit
b73ebdeecc
4 changed files with 21 additions and 47 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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)
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.fsck.k9.mail
|
||||
|
||||
import java.security.cert.X509Certificate
|
||||
|
||||
class CertificateValidationException(
|
||||
val certificateChain: List<X509Certificate>,
|
||||
cause: Throwable?,
|
||||
) : MessagingException(cause)
|
Loading…
Reference in a new issue