use of org.hyperledger.fabric.sdk.Enrollment in project fabric-sdk-java by hyperledger.
the class HFCAClientTest method testRevoke1Exception.
@Test
public void testRevoke1Exception() throws Exception {
thrown.expect(RevocationException.class);
thrown.expectMessage("Error while revoking cert");
HFCAClient client = HFCAClient.createNewInstance("client", "http://localhost:99", null);
client.setCryptoSuite(crypto);
KeyPair keypair = crypto.keyGen();
Enrollment enrollment = new HFCAEnrollment(keypair, "abc");
client.revoke(admin, enrollment, "keyCompromise");
}
use of org.hyperledger.fabric.sdk.Enrollment in project fabric-sdk-java by hyperledger.
the class HFCAClientTest method testRevoke1NullUser.
// revoke1: revoke(User revoker, Enrollment enrollment, String reason)
@Test
public void testRevoke1NullUser() throws Exception {
thrown.expect(InvalidArgumentException.class);
thrown.expectMessage("revoker is not set");
HFCAClient client = HFCAClient.createNewInstance("client", "http://localhost:99", null);
client.setCryptoSuite(crypto);
KeyPair keypair = crypto.keyGen();
Enrollment enrollment = new HFCAEnrollment(keypair, "abc");
client.revoke(null, enrollment, "keyCompromise");
}
Aggregations