mirror of
https://github.com/corda/corda.git
synced 2024-12-27 08:22:35 +00:00
Dynamically add BouncyCastle provider (#185)
This commit is contained in:
parent
2725f53ef5
commit
96d8ec9640
@ -114,4 +114,8 @@ dependencies {
|
|||||||
//TODO remove once we can put driver jar into a predefined directory
|
//TODO remove once we can put driver jar into a predefined directory
|
||||||
//JDBC driver can be passed to the Node at startup using setting the jarDirs property in the Node configuration file.
|
//JDBC driver can be passed to the Node at startup using setting the jarDirs property in the Node configuration file.
|
||||||
compile 'com.microsoft.sqlserver:mssql-jdbc:6.2.1.jre8'
|
compile 'com.microsoft.sqlserver:mssql-jdbc:6.2.1.jre8'
|
||||||
|
|
||||||
|
// Bouncy Castle for HSM signing
|
||||||
|
compile "org.bouncycastle:bcprov-jdk15on:${bouncycastle_version}"
|
||||||
|
compile "org.bouncycastle:bcpkix-jdk15on:${bouncycastle_version}"
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,9 @@ import com.r3.corda.networkmanage.hsm.persistence.DBSignedCertificateRequestStor
|
|||||||
import com.r3.corda.networkmanage.hsm.signer.HsmCsrSigner
|
import com.r3.corda.networkmanage.hsm.signer.HsmCsrSigner
|
||||||
import com.r3.corda.networkmanage.hsm.signer.HsmNetworkMapSigner
|
import com.r3.corda.networkmanage.hsm.signer.HsmNetworkMapSigner
|
||||||
import com.r3.corda.networkmanage.hsm.utils.mapCryptoServerException
|
import com.r3.corda.networkmanage.hsm.utils.mapCryptoServerException
|
||||||
|
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
||||||
|
import java.security.Security
|
||||||
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
run(parseParameters(*args))
|
run(parseParameters(*args))
|
||||||
@ -22,6 +25,11 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
fun run(parameters: Parameters) {
|
fun run(parameters: Parameters) {
|
||||||
parameters.run {
|
parameters.run {
|
||||||
|
// Ensure the BouncyCastle provider is installed
|
||||||
|
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
|
||||||
|
Security.addProvider(BouncyCastleProvider())
|
||||||
|
}
|
||||||
|
|
||||||
// Create DB connection.
|
// Create DB connection.
|
||||||
checkNotNull(dataSourceProperties)
|
checkNotNull(dataSourceProperties)
|
||||||
val database = configureDatabase(dataSourceProperties, databaseConfig)
|
val database = configureDatabase(dataSourceProperties, databaseConfig)
|
||||||
|
Loading…
Reference in New Issue
Block a user