com.r3corda.core.crypto / X509Utilities / addOrReplaceKey

addOrReplaceKey

fun KeyStore.addOrReplaceKey(alias: String, key: Key, password: CharArray, chain: Array<Certificate>): Unit

Helper extension method to add, or overwrite any key data in store

Parameters

alias - name to record the private key and certificate chain under

key - cryptographic key to store

password - password for unlocking the key entry in the future. This does not have to be the same password as any keys stored, but for SSL purposes this is recommended.

chain - the sequence of certificates starting with the public key certificate for this key and extending to the root CA cert