use of org.hyperledger.fabric.sdk.security.CryptoPrimitives in project fabric-sdk-java by hyperledger.
the class HFCAClientTest method testRegisterNoServerResponseAllHostNames.
@Test
public void testRegisterNoServerResponseAllHostNames() throws Exception {
thrown.expect(RegistrationException.class);
thrown.expectMessage("Error while registering the user");
Properties testProps = new Properties();
testProps.setProperty("allowAllHostNames", "true");
HFCAClient client = HFCAClient.createNewInstance("client", "https://localhost:99", testProps);
CryptoPrimitives testcrypt = new CryptoPrimitives();
client.setCryptoSuite(testcrypt);
RegistrationRequest regreq = new RegistrationRequest("name", "affiliation");
client.register(regreq, admin);
}
use of org.hyperledger.fabric.sdk.security.CryptoPrimitives in project fabric-sdk-java by hyperledger.
the class HFCAClientTest method testRegisterNoServerResponseNoPemFile.
@Test
public void testRegisterNoServerResponseNoPemFile() throws Exception {
thrown.expect(InvalidArgumentException.class);
thrown.expectMessage("Unable to add CA certificate");
Properties testProps = new Properties();
testProps.setProperty("pemFile", "nofile.pem");
HFCAClient client = HFCAClient.createNewInstance("client", "https://localhost:99", testProps);
CryptoPrimitives testcrypt = new CryptoPrimitives();
client.setCryptoSuite(testcrypt);
RegistrationRequest regreq = new RegistrationRequest("name", "affiliation");
client.register(regreq, admin);
}
use of org.hyperledger.fabric.sdk.security.CryptoPrimitives in project fabric-sdk-java by hyperledger.
the class HFCAClientTest method setupBeforeClass.
@BeforeClass
public static void setupBeforeClass() {
try {
crypto = new CryptoPrimitives();
crypto.init();
} catch (Exception e) {
throw new RuntimeException("HFCAClientTest.setupBeforeClass failed!", e);
}
}
use of org.hyperledger.fabric.sdk.security.CryptoPrimitives in project fabric-sdk-java by hyperledger.
the class HFCAIdentityTest method setupBeforeClass.
@BeforeClass
public static void setupBeforeClass() {
try {
crypto = new CryptoPrimitives();
crypto.init();
} catch (Exception e) {
throw new RuntimeException("HFCAIdentityTest.setupBeforeClass failed!", e);
}
}
Aggregations