corda / com.r3.corda.networkmanage.common.cryptoservice / CryptoServiceSpec

CryptoServiceSpec

abstract class CryptoServiceSpec<T : AuthenticationCredentials, U : KeyConfig>

This is a base class, containing the tests that consist the specification for CryptoService

Any implementations of it can extend this class to verify the implementation conforms to the spec.

Constructors

<init>

CryptoServiceSpec()

This is a base class, containing the tests that consist the specification for CryptoService

Properties

loggingContextRule

val loggingContextRule: <ERROR CLASS>

Functions

Content signer works with HsmX509Utilities

fun Content signer works with HsmX509Utilities(): Unit

Generate key, then sign and verify data

fun Generate key, then sign and verify data(): Unit

When key does not exist, getContentSigner should throw

fun When key does not exist, getContentSigner should throw(): Unit

When key does not exist, signing should throw

fun When key does not exist, signing should throw(): Unit

createKeyConfig

abstract fun createKeyConfig(alias: String): U

Method used to create a basic key config for a given alias.

delete

abstract fun delete(alias: String): Unit

Method used to delete any keys created during the tests.

generateRandomKeyAlias

open fun generateRandomKeyAlias(): String

getCryptoService

abstract fun getCryptoService(): CryptoService<T, U>

Method used to retrieve the CryptoService that will be tested.

Inheritors

AmazonCloudHsmCryptoServiceTest

class AmazonCloudHsmCryptoServiceTest : CryptoServiceSpec<CloudHsmPasswordCredentials, AmazonCloudHsmKeyConfig>

AzureKeyVaultCryptoServiceTest

class AzureKeyVaultCryptoServiceTest : CryptoServiceSpec<AzureKeyVaultCredentials, AzureKeyVaultKeyConfig>

These tests need to be run manually. They require an Amazon KeyVault (and the associated service principal) to be set up and will perform operations that are not free of charge.

SecurosysPrimusXCryptoServiceTest

class SecurosysPrimusXCryptoServiceTest : CryptoServiceSpec<SecurosysAuthenticationCredentials, SecurosysKeyConfig>

This test can be run against the cloud HSM provided by Securosys. It has the @Ignore annotation by default as the placeholder values have to be filled out in order to run it (see wiki page for credentials).