register crypto provider in main when program startsup (#745)

This commit is contained in:
Patrick Kuo 2018-04-18 17:09:45 +01:00 committed by GitHub
parent 5373c6364f
commit 9cbf7fd7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -6,10 +6,12 @@ import joptsimple.OptionParser
import joptsimple.OptionSpecBuilder import joptsimple.OptionSpecBuilder
import joptsimple.util.PathConverter import joptsimple.util.PathConverter
import joptsimple.util.PathProperties import joptsimple.util.PathProperties
import net.corda.core.crypto.Crypto
import java.nio.file.Path import java.nio.file.Path
import kotlin.system.exitProcess import kotlin.system.exitProcess
fun main(args: Array<String>) { fun main(args: Array<String>) {
Crypto.registerProviders() // Required to register Providers first thing on boot.
val options = try { val options = try {
parseOptions(*args) parseOptions(*args)
} catch (e: ShowHelpException) { } catch (e: ShowHelpException) {

View File

@ -25,7 +25,7 @@ import kotlin.system.exitProcess
private val logger = LoggerFactory.getLogger("com.r3.corda.networkmanage.doorman") private val logger = LoggerFactory.getLogger("com.r3.corda.networkmanage.doorman")
fun main(args: Array<String>) { fun main(args: Array<String>) {
Crypto.findProvider(CordaSecurityProvider.PROVIDER_NAME) // Required to register Providers first thing on boot. Crypto.registerProviders() // Required to register Providers first thing on boot.
if (Manifests.exists("Doorman-Version")) { if (Manifests.exists("Doorman-Version")) {
println("Version: ${Manifests.read("Doorman-Version")}") println("Version: ${Manifests.read("Doorman-Version")}")
} }