Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified crypto-lib/libs/libcdoc.jar
Binary file not shown.
Binary file modified crypto-lib/src/debug/jniLibs/arm64-v8a/libcdoc_java.so
Binary file not shown.
Binary file modified crypto-lib/src/debug/jniLibs/armeabi-v7a/libcdoc_java.so
Binary file not shown.
Binary file modified crypto-lib/src/debug/jniLibs/x86_64/libcdoc_java.so
Binary file not shown.
Binary file modified crypto-lib/src/main/jniLibs/arm64-v8a/libcdoc_java.so
Binary file not shown.
Binary file modified crypto-lib/src/main/jniLibs/armeabi-v7a/libcdoc_java.so
Binary file not shown.
Binary file modified crypto-lib/src/main/jniLibs/x86_64/libcdoc_java.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -348,30 +348,30 @@ class CryptoContainer
}

val cdocWriter = CDocWriter.createWriter(version, file?.path, conf, null, network)
withContext(IO) {
if (version == 2 && cdoc2Settings.getUseOnlineEncryption()) {
val serverId = cdoc2Settings.getCDOC2UUID()
recipients.forEach { addressee ->
val recipient = Recipient.makeEIDServer(addressee?.data, serverId)
if (cdocWriter.addRecipient(recipient) != 0L) {
throw CryptoException("Failed to add recipient")
}
}
} else {
recipients.forEach { addressee ->
val recipient = Recipient.makeEID(addressee?.data)
if (cdocWriter.addRecipient(recipient) != 0L) {
throw CryptoException("Failed to add recipient")
}
}
}
}

try {
if (cdocWriter.beginEncryption() != 0L) {
throw CryptoException("Failed to begin encryption")
}

withContext(IO) {
if (version == 2 && cdoc2Settings.getUseOnlineEncryption()) {
val serverId = cdoc2Settings.getCDOC2UUID()
recipients.forEach { addressee ->
val recipient = Recipient.makeEIDServer(addressee?.data, serverId)
if (cdocWriter.addRecipient(recipient) != 0L) {
throw CryptoException("Failed to add recipient")
}
}
} else {
recipients.forEach { addressee ->
val recipient = Recipient.makeEID(addressee?.data)
if (cdocWriter.addRecipient(recipient) != 0L) {
throw CryptoException("Failed to add recipient")
}
}
}
}

withContext(IO) {
dataFiles.forEach { dataFile ->
val ifs: InputStream = FileInputStream(dataFile)
Expand Down