// [END kms_create_keyring] // [START kms_get_keyring] public static void GetKeyRing(string projectId, string locationId, string keyRingId) { KeyManagementServiceClient client = KeyManagementServiceClient.Create(); KeyRingName keyRingName = new KeyRingName(projectId, locationId, keyRingId); KeyRing result = client.GetKeyRing(keyRingName); Console.WriteLine($"Found KeyRing: {result.Name}"); Console.WriteLine($" Created on: {result.CreateTime}"); }
public void CreatesKeyRing() { // Run the sample code. var result = _sample.CreateKeyRing( projectId: _fixture.ProjectId, locationId: _fixture.LocationId, id: _keyRingId); // Get the key ring. KeyManagementServiceClient client = KeyManagementServiceClient.Create(); var keyRing = client.GetKeyRing(result.KeyRingName); Assert.Contains(_keyRingId, keyRing.Name); }