aboutsummaryrefslogtreecommitdiffstats
path: root/openpgp-ktx/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp-ktx/src/main/java/org')
-rw-r--r--openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.kt6
-rw-r--r--openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpMetadata.kt7
-rw-r--r--openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt54
3 files changed, 58 insertions, 9 deletions
diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.kt
index 18f8cd0c..72bc1b39 100644
--- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.kt
+++ b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpDecryptionResult.kt
@@ -22,7 +22,11 @@ public class OpenPgpDecryptionResult() : Parcelable {
decryptedSessionKey = null
}
- private constructor(result: Int, sessionKey: ByteArray?, decryptedSessionKey: ByteArray?) : this() {
+ private constructor(
+ result: Int,
+ sessionKey: ByteArray?,
+ decryptedSessionKey: ByteArray?
+ ) : this() {
this.result = result
if (sessionKey == null != (decryptedSessionKey == null)) {
throw AssertionError("sessionkey must be null iff decryptedSessionKey is null")
diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpMetadata.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpMetadata.kt
index a73c77c1..a22c8af0 100644
--- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpMetadata.kt
+++ b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpMetadata.kt
@@ -32,7 +32,12 @@ public class OpenPgpMetadata() : Parcelable {
this.charset = charset
}
- private constructor(filename: String?, mimeType: String?, modificationTime: Long, originalSize: Long) : this() {
+ private constructor(
+ filename: String?,
+ mimeType: String?,
+ modificationTime: Long,
+ originalSize: Long
+ ) : this() {
this.filename = filename
this.mimeType = mimeType
this.modificationTime = modificationTime
diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt
index 45f10abd..68a542a8 100644
--- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt
+++ b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt
@@ -58,7 +58,8 @@ public class OpenPgpSignatureResult : Parcelable {
}
// backward compatibility for this exact version
if (version > 2) {
- senderStatusResult = readEnumWithNullAndFallback(source, SenderStatusResult.values(), SenderStatusResult.UNKNOWN)
+ senderStatusResult =
+ readEnumWithNullAndFallback(source, SenderStatusResult.values(), SenderStatusResult.UNKNOWN)
confirmedUserIds = source.createStringArrayList()
} else {
senderStatusResult = SenderStatusResult.UNKNOWN
@@ -151,7 +152,9 @@ public class OpenPgpSignatureResult : Parcelable {
)
}
- public fun withAutocryptPeerResult(autocryptPeerentityResult: AutocryptPeerResult?): OpenPgpSignatureResult {
+ public fun withAutocryptPeerResult(
+ autocryptPeerentityResult: AutocryptPeerResult?
+ ): OpenPgpSignatureResult {
return OpenPgpSignatureResult(
result,
primaryUserId,
@@ -253,18 +256,55 @@ public class OpenPgpSignatureResult : Parcelable {
}
public fun createWithNoSignature(): OpenPgpSignatureResult {
- return OpenPgpSignatureResult(RESULT_NO_SIGNATURE, null, 0L, null, null, null, null, null, null)
+ return OpenPgpSignatureResult(
+ RESULT_NO_SIGNATURE,
+ null,
+ 0L,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ )
}
- public fun createWithKeyMissing(keyId: Long, signatureTimestamp: Date?): OpenPgpSignatureResult {
- return OpenPgpSignatureResult(RESULT_KEY_MISSING, null, keyId, null, null, null, null, signatureTimestamp, null)
+ public fun createWithKeyMissing(
+ keyId: Long,
+ signatureTimestamp: Date?
+ ): OpenPgpSignatureResult {
+ return OpenPgpSignatureResult(
+ RESULT_KEY_MISSING,
+ null,
+ keyId,
+ null,
+ null,
+ null,
+ null,
+ signatureTimestamp,
+ null
+ )
}
public fun createWithInvalidSignature(): OpenPgpSignatureResult {
- return OpenPgpSignatureResult(RESULT_INVALID_SIGNATURE, null, 0L, null, null, null, null, null, null)
+ return OpenPgpSignatureResult(
+ RESULT_INVALID_SIGNATURE,
+ null,
+ 0L,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ )
}
- private fun <T : Enum<T>?> readEnumWithNullAndFallback(source: Parcel, enumValues: Array<T>, fallback: T?): T? {
+ private fun <T : Enum<T>?> readEnumWithNullAndFallback(
+ source: Parcel,
+ enumValues: Array<T>,
+ fallback: T?
+ ): T? {
val valueOrdinal = source.readInt()
if (valueOrdinal == -1) {
return null