diff --git a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/model/common/backup/KeyBackupList.java b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/model/common/backup/KeyBackupList.java index 01a42e36..e38b5f58 100644 --- a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/model/common/backup/KeyBackupList.java +++ b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/model/common/backup/KeyBackupList.java @@ -10,11 +10,13 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; +import lombok.ToString; import java.util.List; @Getter @EqualsAndHashCode +@ToString public class KeyBackupList implements BackupListContainer { @Valid diff --git a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/EcKeyVaultKeyEntity.java b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/EcKeyVaultKeyEntity.java index 9613ab1f..e27df9da 100644 --- a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/EcKeyVaultKeyEntity.java +++ b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/EcKeyVaultKeyEntity.java @@ -12,6 +12,7 @@ import java.security.KeyPair; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; +import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; @@ -51,12 +52,12 @@ public KeyCreationInput keyCreationInput() { @Override public byte[] getX() { - return ((ECPublicKey) getKey().getPublic()).getW().getAffineX().toByteArray(); + return normalizeKeyParameter(((ECPublicKey) getKey().getPublic()).getW().getAffineX().toByteArray()); } @Override public byte[] getY() { - return ((ECPublicKey) getKey().getPublic()).getW().getAffineY().toByteArray(); + return normalizeKeyParameter(((ECPublicKey) getKey().getPublic()).getW().getAffineY().toByteArray()); } @Override @@ -111,4 +112,16 @@ protected byte[] postProcessGeneratedSignature(final byte[] signature) throws Ex protected byte[] preProcessVerifiableSignature(final byte[] rawSignature) throws Exception { return Asn1ConverterUtil.convertFromRawToAsn1(rawSignature); } + + private byte[] normalizeKeyParameter(final byte[] byteArray) { + final int expectedLength = getKeyParam().getByteLength(); + final int actualLength = byteArray.length; + //if the actual length is larger, then there is a leading 0 byte in front of the actual value + //this is added only because the next byte would be negative and the BigInteger would be negative as well + if (actualLength > expectedLength) { + return Arrays.copyOfRange(byteArray, actualLength - expectedLength, actualLength); + } else { + return byteArray; + } + } } diff --git a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/KeyVaultKeyEntity.java b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/KeyVaultKeyEntity.java index b9fbce56..13497efb 100644 --- a/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/KeyVaultKeyEntity.java +++ b/lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/service/key/impl/KeyVaultKeyEntity.java @@ -25,7 +25,6 @@ * @param The type of the key. * @param The type of the key parameter. */ -@SuppressWarnings("LombokGetterMayBeUsed") public abstract class KeyVaultKeyEntity extends KeyVaultBaseEntity implements ReadOnlyKeyVaultKeyEntity { @Getter diff --git a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/BaseKeyBackupRestoreControllerIntegrationTest.java b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/BaseKeyBackupRestoreControllerIntegrationTest.java new file mode 100644 index 00000000..b77b3483 --- /dev/null +++ b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/BaseKeyBackupRestoreControllerIntegrationTest.java @@ -0,0 +1,96 @@ +package com.github.nagyesta.lowkeyvault.controller; + +import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupListItem; +import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupModel; +import com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyPropertiesModel; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyVaultKeyModel; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyCurveName; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyOperation; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyType; +import com.github.nagyesta.lowkeyvault.model.v7_2.key.request.JsonWebKeyImportRequest; +import com.github.nagyesta.lowkeyvault.service.key.id.VersionedKeyEntityId; +import com.github.nagyesta.lowkeyvault.service.key.util.KeyGenUtil; +import org.junit.jupiter.api.Assertions; + +import java.net.URI; +import java.security.KeyPair; +import java.security.interfaces.ECPrivateKey; +import java.security.interfaces.ECPublicKey; +import java.security.spec.ECPoint; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static com.github.nagyesta.lowkeyvault.TestConstants.*; +import static com.github.nagyesta.lowkeyvault.TestConstantsKeys.KEY_NAME_1; + +public class BaseKeyBackupRestoreControllerIntegrationTest { + + @SuppressWarnings({"checkstyle:VisibilityModifier", "checkstyle:JavadocVariable"}) + protected URI uri; + + protected void assertRestoredKeyMatchesExpectations( + final KeyVaultKeyModel actualBody, final ECPublicKey publicKey, + final String version, final Map expectedTags) { + Assertions.assertEquals(new VersionedKeyEntityId(uri, KEY_NAME_1, version).asUri(uri).toString(), actualBody.getKey().getId()); + Assertions.assertEquals(KeyCurveName.P_256, actualBody.getKey().getCurveName()); + Assertions.assertEquals(KeyType.EC, actualBody.getKey().getKeyType()); + Assertions.assertIterableEquals(List.of(KeyOperation.SIGN, KeyOperation.VERIFY), actualBody.getKey().getKeyOps()); + final byte[] expectedX = normalize(publicKey.getW().getAffineX().toByteArray(), KeyCurveName.P_256.getByteLength()); + Assertions.assertArrayEquals(expectedX, actualBody.getKey().getX()); + final byte[] expectedY = normalize(publicKey.getW().getAffineY().toByteArray(), KeyCurveName.P_256.getByteLength()); + Assertions.assertArrayEquals(expectedY, actualBody.getKey().getY()); + //do not return private key material in response + Assertions.assertNull(actualBody.getKey().getD()); + Assertions.assertEquals(TIME_10_MINUTES_AGO, actualBody.getAttributes().getCreatedOn()); + Assertions.assertEquals(NOW, actualBody.getAttributes().getUpdatedOn()); + Assertions.assertEquals(TIME_IN_10_MINUTES, actualBody.getAttributes().getNotBefore()); + Assertions.assertEquals(TIME_IN_10_MINUTES.plusDays(1), actualBody.getAttributes().getExpiresOn()); + Assertions.assertEquals(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, actualBody.getAttributes().getRecoveryLevel()); + Assertions.assertEquals(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE, actualBody.getAttributes().getRecoverableDays()); + Assertions.assertTrue(actualBody.getAttributes().isEnabled()); + Assertions.assertEquals(expectedTags, actualBody.getTags()); + } + + protected KeyPair addVersionToList(final URI baseUri, final String name, final String version, + final KeyBackupModel backupModel, final Map tags) { + final KeyPair keyPair = KeyGenUtil.generateEc(KeyCurveName.P_256); + final JsonWebKeyImportRequest keyMaterial = new JsonWebKeyImportRequest(); + keyMaterial.setKeyType(KeyType.EC); + keyMaterial.setCurveName(KeyCurveName.P_256); + keyMaterial.setKeyOps(List.of(KeyOperation.SIGN, KeyOperation.VERIFY)); + keyMaterial.setD(((ECPrivateKey) keyPair.getPrivate()).getS().toByteArray()); + final ECPoint w = ((ECPublicKey) keyPair.getPublic()).getW(); + keyMaterial.setX(normalize(w.getAffineX().toByteArray(), KeyCurveName.P_256.getByteLength())); + keyMaterial.setY(normalize(w.getAffineY().toByteArray(), KeyCurveName.P_256.getByteLength())); + keyMaterial.setId(new VersionedKeyEntityId(baseUri, name, version).asUri(uri).toString()); + final KeyBackupListItem listItem = new KeyBackupListItem(); + listItem.setKeyMaterial(keyMaterial); + listItem.setVaultBaseUri(baseUri); + listItem.setId(name); + listItem.setVersion(version); + final KeyPropertiesModel propertiesModel = new KeyPropertiesModel(); + propertiesModel.setCreatedOn(TIME_10_MINUTES_AGO); + propertiesModel.setUpdatedOn(NOW); + propertiesModel.setNotBefore(TIME_IN_10_MINUTES); + propertiesModel.setExpiresOn(TIME_IN_10_MINUTES.plusDays(1)); + propertiesModel.setRecoveryLevel(RecoveryLevel.RECOVERABLE_AND_PURGEABLE); + propertiesModel.setRecoverableDays(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE); + listItem.setAttributes(propertiesModel); + listItem.setTags(tags); + final List list = new ArrayList<>(backupModel.getValue().getVersions()); + list.add(listItem); + backupModel.getValue().setVersions(list); + return keyPair; + } + + private byte[] normalize(final byte[] bytes, final int expectedLength) { + if (expectedLength < bytes.length) { + return Arrays.copyOfRange(bytes, bytes.length - expectedLength, bytes.length); + } else { + return bytes; + } + } +} diff --git a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_2/KeyBackupRestoreControllerIntegrationTest.java b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_2/KeyBackupRestoreControllerIntegrationTest.java index 531c175e..c50d24e6 100644 --- a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_2/KeyBackupRestoreControllerIntegrationTest.java +++ b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_2/KeyBackupRestoreControllerIntegrationTest.java @@ -2,23 +2,19 @@ import com.github.nagyesta.abortmission.booster.jupiter.annotation.LaunchAbortArmed; import com.github.nagyesta.lowkeyvault.TestConstantsUri; +import com.github.nagyesta.lowkeyvault.controller.BaseKeyBackupRestoreControllerIntegrationTest; import com.github.nagyesta.lowkeyvault.mapper.common.registry.KeyConverterRegistry; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupList; -import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupListItem; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupModel; import com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyPropertiesModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyVaultKeyModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyCurveName; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyOperation; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyType; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.request.JsonWebKeyImportRequest; import com.github.nagyesta.lowkeyvault.service.exception.NotFoundException; import com.github.nagyesta.lowkeyvault.service.key.KeyVaultFake; import com.github.nagyesta.lowkeyvault.service.key.id.VersionedKeyEntityId; import com.github.nagyesta.lowkeyvault.service.key.impl.EcKeyCreationInput; import com.github.nagyesta.lowkeyvault.service.key.impl.KeyCreateDetailedInput; -import com.github.nagyesta.lowkeyvault.service.key.util.KeyGenUtil; import com.github.nagyesta.lowkeyvault.service.vault.VaultService; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; @@ -35,11 +31,7 @@ import java.net.URI; import java.security.KeyPair; -import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.UUID; import java.util.stream.Stream; @@ -49,14 +41,13 @@ @LaunchAbortArmed @SpringBootTest -class KeyBackupRestoreControllerIntegrationTest { +class KeyBackupRestoreControllerIntegrationTest extends BaseKeyBackupRestoreControllerIntegrationTest { @Autowired @Qualifier("KeyBackupRestoreControllerV72") private KeyBackupRestoreController underTest; @Autowired private VaultService vaultService; - private URI uri; public static Stream nullProvider() { return Stream.builder() @@ -229,55 +220,4 @@ void testBackupEntityShouldReturnTheOriginalBackupModelWhenCalledAfterRestoreEnt Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode()); } - private void assertRestoredKeyMatchesExpectations( - final KeyVaultKeyModel actualBody, final ECPublicKey publicKey, - final String version, final Map expectedTags) { - Assertions.assertEquals(new VersionedKeyEntityId(uri, KEY_NAME_1, version).asUri(uri).toString(), actualBody.getKey().getId()); - Assertions.assertEquals(KeyCurveName.P_256, actualBody.getKey().getCurveName()); - Assertions.assertEquals(KeyType.EC, actualBody.getKey().getKeyType()); - Assertions.assertIterableEquals(List.of(KeyOperation.SIGN, KeyOperation.VERIFY), actualBody.getKey().getKeyOps()); - Assertions.assertArrayEquals(publicKey.getW().getAffineX().toByteArray(), actualBody.getKey().getX()); - Assertions.assertArrayEquals(publicKey.getW().getAffineY().toByteArray(), actualBody.getKey().getY()); - //do not return private key material in response - Assertions.assertNull(actualBody.getKey().getD()); - Assertions.assertEquals(TIME_10_MINUTES_AGO, actualBody.getAttributes().getCreatedOn()); - Assertions.assertEquals(NOW, actualBody.getAttributes().getUpdatedOn()); - Assertions.assertEquals(TIME_IN_10_MINUTES, actualBody.getAttributes().getNotBefore()); - Assertions.assertEquals(TIME_IN_10_MINUTES.plusDays(1), actualBody.getAttributes().getExpiresOn()); - Assertions.assertEquals(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, actualBody.getAttributes().getRecoveryLevel()); - Assertions.assertEquals(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE, actualBody.getAttributes().getRecoverableDays()); - Assertions.assertTrue(actualBody.getAttributes().isEnabled()); - Assertions.assertEquals(expectedTags, actualBody.getTags()); - } - - private KeyPair addVersionToList(final URI baseUri, final String name, final String version, - final KeyBackupModel backupModel, final Map tags) { - final KeyPair keyPair = KeyGenUtil.generateEc(KeyCurveName.P_256); - final JsonWebKeyImportRequest keyMaterial = new JsonWebKeyImportRequest(); - keyMaterial.setKeyType(KeyType.EC); - keyMaterial.setCurveName(KeyCurveName.P_256); - keyMaterial.setKeyOps(List.of(KeyOperation.SIGN, KeyOperation.VERIFY)); - keyMaterial.setD(((ECPrivateKey) keyPair.getPrivate()).getS().toByteArray()); - keyMaterial.setX(((ECPublicKey) keyPair.getPublic()).getW().getAffineX().toByteArray()); - keyMaterial.setY(((ECPublicKey) keyPair.getPublic()).getW().getAffineY().toByteArray()); - keyMaterial.setId(new VersionedKeyEntityId(baseUri, name, version).asUri(uri).toString()); - final KeyBackupListItem listItem = new KeyBackupListItem(); - listItem.setKeyMaterial(keyMaterial); - listItem.setVaultBaseUri(baseUri); - listItem.setId(name); - listItem.setVersion(version); - final KeyPropertiesModel propertiesModel = new KeyPropertiesModel(); - propertiesModel.setCreatedOn(TIME_10_MINUTES_AGO); - propertiesModel.setUpdatedOn(NOW); - propertiesModel.setNotBefore(TIME_IN_10_MINUTES); - propertiesModel.setExpiresOn(TIME_IN_10_MINUTES.plusDays(1)); - propertiesModel.setRecoveryLevel(RecoveryLevel.RECOVERABLE_AND_PURGEABLE); - propertiesModel.setRecoverableDays(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE); - listItem.setAttributes(propertiesModel); - listItem.setTags(tags); - final List list = new ArrayList<>(backupModel.getValue().getVersions()); - list.add(listItem); - backupModel.getValue().setVersions(list); - return keyPair; - } } diff --git a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_3/KeyBackupRestoreControllerIntegrationTest.java b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_3/KeyBackupRestoreControllerIntegrationTest.java index a5ec2939..366e48c6 100644 --- a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_3/KeyBackupRestoreControllerIntegrationTest.java +++ b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_3/KeyBackupRestoreControllerIntegrationTest.java @@ -2,17 +2,14 @@ import com.github.nagyesta.abortmission.booster.jupiter.annotation.LaunchAbortArmed; import com.github.nagyesta.lowkeyvault.TestConstantsUri; +import com.github.nagyesta.lowkeyvault.controller.BaseKeyBackupRestoreControllerIntegrationTest; import com.github.nagyesta.lowkeyvault.mapper.common.registry.KeyConverterRegistry; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupList; -import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupListItem; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupModel; import com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyPropertiesModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyVaultKeyModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyCurveName; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyOperation; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyType; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.request.JsonWebKeyImportRequest; import com.github.nagyesta.lowkeyvault.model.v7_3.key.*; import com.github.nagyesta.lowkeyvault.service.exception.NotFoundException; import com.github.nagyesta.lowkeyvault.service.key.KeyVaultFake; @@ -23,7 +20,6 @@ import com.github.nagyesta.lowkeyvault.service.key.id.VersionedKeyEntityId; import com.github.nagyesta.lowkeyvault.service.key.impl.EcKeyCreationInput; import com.github.nagyesta.lowkeyvault.service.key.impl.KeyCreateDetailedInput; -import com.github.nagyesta.lowkeyvault.service.key.util.KeyGenUtil; import com.github.nagyesta.lowkeyvault.service.vault.VaultService; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; @@ -40,13 +36,10 @@ import java.net.URI; import java.security.KeyPair; -import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.time.Period; -import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.stream.Stream; import static com.github.nagyesta.lowkeyvault.TestConstants.*; @@ -57,7 +50,7 @@ @LaunchAbortArmed @SpringBootTest -class KeyBackupRestoreControllerIntegrationTest { +class KeyBackupRestoreControllerIntegrationTest extends BaseKeyBackupRestoreControllerIntegrationTest { private static final Period EXPIRY_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_EXPIRY_PERIOD_IN_DAYS); private static final Period TRIGGER_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_THRESHOLD_BEFORE_EXPIRY); @@ -66,7 +59,6 @@ class KeyBackupRestoreControllerIntegrationTest { private KeyBackupRestoreController underTest; @Autowired private VaultService vaultService; - private URI uri; public static Stream nullProvider() { return Stream.builder() @@ -266,58 +258,6 @@ void testBackupEntityShouldReturnTheOriginalBackupModelWhenCalledAfterRestoreEnt Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode()); } - private void assertRestoredKeyMatchesExpectations( - final KeyVaultKeyModel actualBody, final ECPublicKey publicKey, - final String version, final Map expectedTags) { - Assertions.assertEquals(new VersionedKeyEntityId(uri, KEY_NAME_1, version).asUri(uri).toString(), actualBody.getKey().getId()); - Assertions.assertEquals(KeyCurveName.P_256, actualBody.getKey().getCurveName()); - Assertions.assertEquals(KeyType.EC, actualBody.getKey().getKeyType()); - Assertions.assertIterableEquals(List.of(KeyOperation.SIGN, KeyOperation.VERIFY), actualBody.getKey().getKeyOps()); - Assertions.assertArrayEquals(publicKey.getW().getAffineX().toByteArray(), actualBody.getKey().getX()); - Assertions.assertArrayEquals(publicKey.getW().getAffineY().toByteArray(), actualBody.getKey().getY()); - //do not return private key material in response - Assertions.assertNull(actualBody.getKey().getD()); - Assertions.assertEquals(TIME_10_MINUTES_AGO, actualBody.getAttributes().getCreatedOn()); - Assertions.assertEquals(NOW, actualBody.getAttributes().getUpdatedOn()); - Assertions.assertEquals(TIME_IN_10_MINUTES, actualBody.getAttributes().getNotBefore()); - Assertions.assertEquals(TIME_IN_10_MINUTES.plusDays(1), actualBody.getAttributes().getExpiresOn()); - Assertions.assertEquals(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, actualBody.getAttributes().getRecoveryLevel()); - Assertions.assertEquals(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE, actualBody.getAttributes().getRecoverableDays()); - Assertions.assertTrue(actualBody.getAttributes().isEnabled()); - Assertions.assertEquals(expectedTags, actualBody.getTags()); - } - - private KeyPair addVersionToList(final URI baseUri, final String name, final String version, - final KeyBackupModel backupModel, final Map tags) { - final KeyPair keyPair = KeyGenUtil.generateEc(KeyCurveName.P_256); - final JsonWebKeyImportRequest keyMaterial = new JsonWebKeyImportRequest(); - keyMaterial.setKeyType(KeyType.EC); - keyMaterial.setCurveName(KeyCurveName.P_256); - keyMaterial.setKeyOps(List.of(KeyOperation.SIGN, KeyOperation.VERIFY)); - keyMaterial.setD(((ECPrivateKey) keyPair.getPrivate()).getS().toByteArray()); - keyMaterial.setX(((ECPublicKey) keyPair.getPublic()).getW().getAffineX().toByteArray()); - keyMaterial.setY(((ECPublicKey) keyPair.getPublic()).getW().getAffineY().toByteArray()); - keyMaterial.setId(new VersionedKeyEntityId(baseUri, name, version).asUri(uri).toString()); - final KeyBackupListItem listItem = new KeyBackupListItem(); - listItem.setKeyMaterial(keyMaterial); - listItem.setVaultBaseUri(baseUri); - listItem.setId(name); - listItem.setVersion(version); - final KeyPropertiesModel propertiesModel = new KeyPropertiesModel(); - propertiesModel.setCreatedOn(TIME_10_MINUTES_AGO); - propertiesModel.setUpdatedOn(NOW); - propertiesModel.setNotBefore(TIME_IN_10_MINUTES); - propertiesModel.setExpiresOn(TIME_IN_10_MINUTES.plusDays(1)); - propertiesModel.setRecoveryLevel(RecoveryLevel.RECOVERABLE_AND_PURGEABLE); - propertiesModel.setRecoverableDays(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE); - listItem.setAttributes(propertiesModel); - listItem.setTags(tags); - final List list = new ArrayList<>(backupModel.getValue().getVersions()); - list.add(listItem); - backupModel.getValue().setVersions(list); - return keyPair; - } - private KeyRotationPolicyModel keyRotationPolicy(final KeyEntityId keyEntityId) { final KeyRotationPolicyModel model = new KeyRotationPolicyModel(); model.setId(keyEntityId.asRotationPolicyUri(keyEntityId.vault())); @@ -340,4 +280,5 @@ private KeyLifetimeActionModel actionModel() { actionModel.setTrigger(new KeyLifetimeActionTriggerModel(null, TRIGGER_TIME)); return actionModel; } + } diff --git a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_4/KeyBackupRestoreControllerIntegrationTest.java b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_4/KeyBackupRestoreControllerIntegrationTest.java index 458efce8..fd2d5a9a 100644 --- a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_4/KeyBackupRestoreControllerIntegrationTest.java +++ b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_4/KeyBackupRestoreControllerIntegrationTest.java @@ -2,17 +2,14 @@ import com.github.nagyesta.abortmission.booster.jupiter.annotation.LaunchAbortArmed; import com.github.nagyesta.lowkeyvault.TestConstantsUri; +import com.github.nagyesta.lowkeyvault.controller.BaseKeyBackupRestoreControllerIntegrationTest; import com.github.nagyesta.lowkeyvault.mapper.common.registry.KeyConverterRegistry; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupList; -import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupListItem; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupModel; import com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyPropertiesModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyVaultKeyModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyCurveName; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyOperation; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyType; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.request.JsonWebKeyImportRequest; import com.github.nagyesta.lowkeyvault.model.v7_3.key.*; import com.github.nagyesta.lowkeyvault.service.exception.NotFoundException; import com.github.nagyesta.lowkeyvault.service.key.KeyVaultFake; @@ -23,7 +20,6 @@ import com.github.nagyesta.lowkeyvault.service.key.id.VersionedKeyEntityId; import com.github.nagyesta.lowkeyvault.service.key.impl.EcKeyCreationInput; import com.github.nagyesta.lowkeyvault.service.key.impl.KeyCreateDetailedInput; -import com.github.nagyesta.lowkeyvault.service.key.util.KeyGenUtil; import com.github.nagyesta.lowkeyvault.service.vault.VaultService; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; @@ -40,13 +36,10 @@ import java.net.URI; import java.security.KeyPair; -import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.time.Period; -import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.stream.Stream; import static com.github.nagyesta.lowkeyvault.TestConstants.*; @@ -57,7 +50,7 @@ @LaunchAbortArmed @SpringBootTest -class KeyBackupRestoreControllerIntegrationTest { +class KeyBackupRestoreControllerIntegrationTest extends BaseKeyBackupRestoreControllerIntegrationTest { private static final Period EXPIRY_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_EXPIRY_PERIOD_IN_DAYS); private static final Period TRIGGER_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_THRESHOLD_BEFORE_EXPIRY); @@ -66,7 +59,6 @@ class KeyBackupRestoreControllerIntegrationTest { private KeyBackupRestoreController underTest; @Autowired private VaultService vaultService; - private URI uri; public static Stream nullProvider() { return Stream.builder() @@ -266,58 +258,6 @@ void testBackupEntityShouldReturnTheOriginalBackupModelWhenCalledAfterRestoreEnt Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode()); } - private void assertRestoredKeyMatchesExpectations( - final KeyVaultKeyModel actualBody, final ECPublicKey publicKey, - final String version, final Map expectedTags) { - Assertions.assertEquals(new VersionedKeyEntityId(uri, KEY_NAME_1, version).asUri(uri).toString(), actualBody.getKey().getId()); - Assertions.assertEquals(KeyCurveName.P_256, actualBody.getKey().getCurveName()); - Assertions.assertEquals(KeyType.EC, actualBody.getKey().getKeyType()); - Assertions.assertIterableEquals(List.of(KeyOperation.SIGN, KeyOperation.VERIFY), actualBody.getKey().getKeyOps()); - Assertions.assertArrayEquals(publicKey.getW().getAffineX().toByteArray(), actualBody.getKey().getX()); - Assertions.assertArrayEquals(publicKey.getW().getAffineY().toByteArray(), actualBody.getKey().getY()); - //do not return private key material in response - Assertions.assertNull(actualBody.getKey().getD()); - Assertions.assertEquals(TIME_10_MINUTES_AGO, actualBody.getAttributes().getCreatedOn()); - Assertions.assertEquals(NOW, actualBody.getAttributes().getUpdatedOn()); - Assertions.assertEquals(TIME_IN_10_MINUTES, actualBody.getAttributes().getNotBefore()); - Assertions.assertEquals(TIME_IN_10_MINUTES.plusDays(1), actualBody.getAttributes().getExpiresOn()); - Assertions.assertEquals(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, actualBody.getAttributes().getRecoveryLevel()); - Assertions.assertEquals(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE, actualBody.getAttributes().getRecoverableDays()); - Assertions.assertTrue(actualBody.getAttributes().isEnabled()); - Assertions.assertEquals(expectedTags, actualBody.getTags()); - } - - private KeyPair addVersionToList(final URI baseUri, final String name, final String version, - final KeyBackupModel backupModel, final Map tags) { - final KeyPair keyPair = KeyGenUtil.generateEc(KeyCurveName.P_256); - final JsonWebKeyImportRequest keyMaterial = new JsonWebKeyImportRequest(); - keyMaterial.setKeyType(KeyType.EC); - keyMaterial.setCurveName(KeyCurveName.P_256); - keyMaterial.setKeyOps(List.of(KeyOperation.SIGN, KeyOperation.VERIFY)); - keyMaterial.setD(((ECPrivateKey) keyPair.getPrivate()).getS().toByteArray()); - keyMaterial.setX(((ECPublicKey) keyPair.getPublic()).getW().getAffineX().toByteArray()); - keyMaterial.setY(((ECPublicKey) keyPair.getPublic()).getW().getAffineY().toByteArray()); - keyMaterial.setId(new VersionedKeyEntityId(baseUri, name, version).asUri(uri).toString()); - final KeyBackupListItem listItem = new KeyBackupListItem(); - listItem.setKeyMaterial(keyMaterial); - listItem.setVaultBaseUri(baseUri); - listItem.setId(name); - listItem.setVersion(version); - final KeyPropertiesModel propertiesModel = new KeyPropertiesModel(); - propertiesModel.setCreatedOn(TIME_10_MINUTES_AGO); - propertiesModel.setUpdatedOn(NOW); - propertiesModel.setNotBefore(TIME_IN_10_MINUTES); - propertiesModel.setExpiresOn(TIME_IN_10_MINUTES.plusDays(1)); - propertiesModel.setRecoveryLevel(RecoveryLevel.RECOVERABLE_AND_PURGEABLE); - propertiesModel.setRecoverableDays(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE); - listItem.setAttributes(propertiesModel); - listItem.setTags(tags); - final List list = new ArrayList<>(backupModel.getValue().getVersions()); - list.add(listItem); - backupModel.getValue().setVersions(list); - return keyPair; - } - private KeyRotationPolicyModel keyRotationPolicy(final KeyEntityId keyEntityId) { final KeyRotationPolicyModel model = new KeyRotationPolicyModel(); model.setId(keyEntityId.asRotationPolicyUri(keyEntityId.vault())); diff --git a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_5/KeyBackupRestoreControllerIntegrationTest.java b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_5/KeyBackupRestoreControllerIntegrationTest.java index 6f047c54..71fe51de 100644 --- a/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_5/KeyBackupRestoreControllerIntegrationTest.java +++ b/lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/controller/v7_5/KeyBackupRestoreControllerIntegrationTest.java @@ -2,17 +2,14 @@ import com.github.nagyesta.abortmission.booster.jupiter.annotation.LaunchAbortArmed; import com.github.nagyesta.lowkeyvault.TestConstantsUri; +import com.github.nagyesta.lowkeyvault.controller.BaseKeyBackupRestoreControllerIntegrationTest; import com.github.nagyesta.lowkeyvault.mapper.common.registry.KeyConverterRegistry; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupList; -import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupListItem; import com.github.nagyesta.lowkeyvault.model.common.backup.KeyBackupModel; import com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyPropertiesModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.KeyVaultKeyModel; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyCurveName; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyOperation; import com.github.nagyesta.lowkeyvault.model.v7_2.key.constants.KeyType; -import com.github.nagyesta.lowkeyvault.model.v7_2.key.request.JsonWebKeyImportRequest; import com.github.nagyesta.lowkeyvault.model.v7_3.key.*; import com.github.nagyesta.lowkeyvault.service.exception.NotFoundException; import com.github.nagyesta.lowkeyvault.service.key.KeyVaultFake; @@ -23,7 +20,6 @@ import com.github.nagyesta.lowkeyvault.service.key.id.VersionedKeyEntityId; import com.github.nagyesta.lowkeyvault.service.key.impl.EcKeyCreationInput; import com.github.nagyesta.lowkeyvault.service.key.impl.KeyCreateDetailedInput; -import com.github.nagyesta.lowkeyvault.service.key.util.KeyGenUtil; import com.github.nagyesta.lowkeyvault.service.vault.VaultService; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; @@ -40,13 +36,10 @@ import java.net.URI; import java.security.KeyPair; -import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.time.Period; -import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.stream.Stream; import static com.github.nagyesta.lowkeyvault.TestConstants.*; @@ -57,7 +50,7 @@ @LaunchAbortArmed @SpringBootTest -class KeyBackupRestoreControllerIntegrationTest { +class KeyBackupRestoreControllerIntegrationTest extends BaseKeyBackupRestoreControllerIntegrationTest { private static final Period EXPIRY_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_EXPIRY_PERIOD_IN_DAYS); private static final Period TRIGGER_TIME = Period.ofDays(LifetimeActionTriggerType.MINIMUM_THRESHOLD_BEFORE_EXPIRY); @@ -66,7 +59,6 @@ class KeyBackupRestoreControllerIntegrationTest { private com.github.nagyesta.lowkeyvault.controller.v7_5.KeyBackupRestoreController underTest; @Autowired private VaultService vaultService; - private URI uri; public static Stream nullProvider() { return Stream.builder() @@ -266,58 +258,6 @@ void testBackupEntityShouldReturnTheOriginalBackupModelWhenCalledAfterRestoreEnt Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode()); } - private void assertRestoredKeyMatchesExpectations( - final KeyVaultKeyModel actualBody, final ECPublicKey publicKey, - final String version, final Map expectedTags) { - Assertions.assertEquals(new VersionedKeyEntityId(uri, KEY_NAME_1, version).asUri(uri).toString(), actualBody.getKey().getId()); - Assertions.assertEquals(KeyCurveName.P_256, actualBody.getKey().getCurveName()); - Assertions.assertEquals(KeyType.EC, actualBody.getKey().getKeyType()); - Assertions.assertIterableEquals(List.of(KeyOperation.SIGN, KeyOperation.VERIFY), actualBody.getKey().getKeyOps()); - Assertions.assertArrayEquals(publicKey.getW().getAffineX().toByteArray(), actualBody.getKey().getX()); - Assertions.assertArrayEquals(publicKey.getW().getAffineY().toByteArray(), actualBody.getKey().getY()); - //do not return private key material in response - Assertions.assertNull(actualBody.getKey().getD()); - Assertions.assertEquals(TIME_10_MINUTES_AGO, actualBody.getAttributes().getCreatedOn()); - Assertions.assertEquals(NOW, actualBody.getAttributes().getUpdatedOn()); - Assertions.assertEquals(TIME_IN_10_MINUTES, actualBody.getAttributes().getNotBefore()); - Assertions.assertEquals(TIME_IN_10_MINUTES.plusDays(1), actualBody.getAttributes().getExpiresOn()); - Assertions.assertEquals(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, actualBody.getAttributes().getRecoveryLevel()); - Assertions.assertEquals(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE, actualBody.getAttributes().getRecoverableDays()); - Assertions.assertTrue(actualBody.getAttributes().isEnabled()); - Assertions.assertEquals(expectedTags, actualBody.getTags()); - } - - private KeyPair addVersionToList(final URI baseUri, final String name, final String version, - final KeyBackupModel backupModel, final Map tags) { - final KeyPair keyPair = KeyGenUtil.generateEc(KeyCurveName.P_256); - final JsonWebKeyImportRequest keyMaterial = new JsonWebKeyImportRequest(); - keyMaterial.setKeyType(KeyType.EC); - keyMaterial.setCurveName(KeyCurveName.P_256); - keyMaterial.setKeyOps(List.of(KeyOperation.SIGN, KeyOperation.VERIFY)); - keyMaterial.setD(((ECPrivateKey) keyPair.getPrivate()).getS().toByteArray()); - keyMaterial.setX(((ECPublicKey) keyPair.getPublic()).getW().getAffineX().toByteArray()); - keyMaterial.setY(((ECPublicKey) keyPair.getPublic()).getW().getAffineY().toByteArray()); - keyMaterial.setId(new VersionedKeyEntityId(baseUri, name, version).asUri(uri).toString()); - final KeyBackupListItem listItem = new KeyBackupListItem(); - listItem.setKeyMaterial(keyMaterial); - listItem.setVaultBaseUri(baseUri); - listItem.setId(name); - listItem.setVersion(version); - final KeyPropertiesModel propertiesModel = new KeyPropertiesModel(); - propertiesModel.setCreatedOn(TIME_10_MINUTES_AGO); - propertiesModel.setUpdatedOn(NOW); - propertiesModel.setNotBefore(TIME_IN_10_MINUTES); - propertiesModel.setExpiresOn(TIME_IN_10_MINUTES.plusDays(1)); - propertiesModel.setRecoveryLevel(RecoveryLevel.RECOVERABLE_AND_PURGEABLE); - propertiesModel.setRecoverableDays(RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE); - listItem.setAttributes(propertiesModel); - listItem.setTags(tags); - final List list = new ArrayList<>(backupModel.getValue().getVersions()); - list.add(listItem); - backupModel.getValue().setVersions(list); - return keyPair; - } - private KeyRotationPolicyModel keyRotationPolicy(final KeyEntityId keyEntityId) { final KeyRotationPolicyModel model = new KeyRotationPolicyModel(); model.setId(keyEntityId.asRotationPolicyUri(keyEntityId.vault())); @@ -340,4 +280,5 @@ private KeyLifetimeActionModel actionModel() { actionModel.setTrigger(new KeyLifetimeActionTriggerModel(null, TRIGGER_TIME)); return actionModel; } + } diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-72.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-72.json index bd10a263..7540f0a9 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-72.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-72.json @@ -21,7 +21,7 @@ ], "kid": "https://keys-backup-jsonBackupEc-256k-72.localhost:8443/keys/jsonBackupEc-256k-72/5425a5872c1f4a9fa96db8f40e6c5d07", "kty": "EC", - "x": "AOSHhd4mwdHNED-SdhTnMasUYuEwLPWpLb8rNx-NV9OH", + "x": "5IeF3ibB0c0QP5J2FOcxqxRi4TAs9aktvys3H41X04c", "y": "DJivtzkKcvFCNe9ZmzCzflbG_CSQrbuDBauJDneZ6Xc" } } diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-73.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-73.json index 1b0c76e0..2c830958 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-73.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-256k-73.json @@ -22,7 +22,7 @@ ], "kid": "https://keys-backup-jsonBackupEc-256k-73.localhost:8443/keys/jsonBackupEc-256k-73/5425a5872c1f4a9fa96db8f40e6c5d07", "kty": "EC", - "x": "AOSHhd4mwdHNED-SdhTnMasUYuEwLPWpLb8rNx-NV9OH", + "x": "5IeF3ibB0c0QP5J2FOcxqxRi4TAs9aktvys3H41X04c", "y": "DJivtzkKcvFCNe9ZmzCzflbG_CSQrbuDBauJDneZ6Xc" } } diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-72.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-72.json index 47af9694..15d383da 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-72.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-72.json @@ -22,7 +22,7 @@ "kid": "https://keys-backup-jsonBackupEc-384-72.localhost:8443/keys/jsonBackupEc-384-72/7f4c0a2ef5454e07a533e597434984a8", "kty": "EC", "x": "KzD2vTm-aSjXN_RFlY7P78R6hpfdJcSHTC9WM7QXmf0VJro3cXdFOZk6vrx5WDjE", - "y": "AKYy8hXwjc0O8mVBXOolUvHklqEV2POLIN6c3EpZIJ-Sz2H_Vce0EoAF320bZhxrfw" + "y": "pjLyFfCNzQ7yZUFc6iVS8eSWoRXY84sg3pzcSlkgn5LPYf9Vx7QSgAXfbRtmHGt_" } } ] diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-73.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-73.json index 142e1b7c..e794d3c9 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-73.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-73.json @@ -23,7 +23,7 @@ "kid": "https://keys-backup-jsonBackupEc-384-73.localhost:8443/keys/jsonBackupEc-384-73/7f4c0a2ef5454e07a533e597434984a8", "kty": "EC", "x": "KzD2vTm-aSjXN_RFlY7P78R6hpfdJcSHTC9WM7QXmf0VJro3cXdFOZk6vrx5WDjE", - "y": "AKYy8hXwjc0O8mVBXOolUvHklqEV2POLIN6c3EpZIJ-Sz2H_Vce0EoAF320bZhxrfw" + "y": "pjLyFfCNzQ7yZUFc6iVS8eSWoRXY84sg3pzcSlkgn5LPYf9Vx7QSgAXfbRtmHGt_" } } ], diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-74.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-74.json index a3825435..a51b9201 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-74.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-74.json @@ -23,7 +23,7 @@ "kid": "https://keys-backup-jsonBackupEc-384-74.localhost:8443/keys/jsonBackupEc-384-74/7f4c0a2ef5454e07a533e597434984a8", "kty": "EC", "x": "KzD2vTm-aSjXN_RFlY7P78R6hpfdJcSHTC9WM7QXmf0VJro3cXdFOZk6vrx5WDjE", - "y": "AKYy8hXwjc0O8mVBXOolUvHklqEV2POLIN6c3EpZIJ-Sz2H_Vce0EoAF320bZhxrfw" + "y": "pjLyFfCNzQ7yZUFc6iVS8eSWoRXY84sg3pzcSlkgn5LPYf9Vx7QSgAXfbRtmHGt_" } } ], diff --git a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-75.json b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-75.json index ab346d0c..90470c9c 100644 --- a/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-75.json +++ b/lowkey-vault-docker/src/test/resources/json/backups/jsonBackupEc-384-75.json @@ -23,7 +23,7 @@ "kid": "https://keys-backup-jsonBackupEc-384-75.localhost:8443/keys/jsonBackupEc-384-75/7f4c0a2ef5454e07a533e597434984a8", "kty": "EC", "x": "KzD2vTm-aSjXN_RFlY7P78R6hpfdJcSHTC9WM7QXmf0VJro3cXdFOZk6vrx5WDjE", - "y": "AKYy8hXwjc0O8mVBXOolUvHklqEV2POLIN6c3EpZIJ-Sz2H_Vce0EoAF320bZhxrfw" + "y": "pjLyFfCNzQ7yZUFc6iVS8eSWoRXY84sg3pzcSlkgn5LPYf9Vx7QSgAXfbRtmHGt_" } } ],