From b3b88d0ea721c45f32610714638562a2866a07cf Mon Sep 17 00:00:00 2001 From: malachy Date: Thu, 21 Sep 2023 15:08:47 +0100 Subject: [PATCH] Addressed feedback --- .../v5/application/crypto/SigningService.java | 7 ++----- .../crypto/SigningServiceSignContext.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 application/src/main/java/net/corda/v5/application/crypto/SigningServiceSignContext.java diff --git a/application/src/main/java/net/corda/v5/application/crypto/SigningService.java b/application/src/main/java/net/corda/v5/application/crypto/SigningService.java index 9f3a7f2e1b..ad3f276212 100644 --- a/application/src/main/java/net/corda/v5/application/crypto/SigningService.java +++ b/application/src/main/java/net/corda/v5/application/crypto/SigningService.java @@ -49,10 +49,7 @@ public interface SigningService { * primary identity, or previously generated via the freshKey method. If the {@link PublicKey} is actually * a {@link CompositeKey}, the first leaf signing key hosted by the node is used. * @param signatureSpec The {@link SignatureSpec} to use when producing this signature. - * @param context The execution context of the signing operation as a map of strings. Currently accepts the following parameters - * + * @param context The execution context of the signing operation. * * @return A {@link DigitalSignature.WithKeyId} representing the signed data and the {@link PublicKey} that belongs to the * same {@link KeyPair} as the {@link PrivateKey} that signed the data. @@ -61,7 +58,7 @@ public interface SigningService { */ @Suspendable @NotNull - DigitalSignature.WithKeyId sign(@NotNull byte[] bytes, @NotNull PublicKey publicKey, @NotNull SignatureSpec signatureSpec, @NotNull Map context); + DigitalSignature.WithKeyId sign(@NotNull byte[] bytes, @NotNull PublicKey publicKey, @NotNull SignatureSpec signatureSpec, @NotNull SigningServiceSignContext context); /** * Looks into a set of signing keys to find keys owned by the caller. In case of {@link CompositeKey} it looks into diff --git a/application/src/main/java/net/corda/v5/application/crypto/SigningServiceSignContext.java b/application/src/main/java/net/corda/v5/application/crypto/SigningServiceSignContext.java new file mode 100644 index 0000000000..adca72944a --- /dev/null +++ b/application/src/main/java/net/corda/v5/application/crypto/SigningServiceSignContext.java @@ -0,0 +1,18 @@ +package net.corda.v5.application.crypto; + +import net.corda.v5.base.annotations.CordaSerializable; + +/* + * Context attached to the sign operation of SigningService + */ +@CordaSerializable +public final class SigningServiceSignContext { + private final String keyCategory; + + /** + * @param keyCategory the category of the key to be signed with + */ + public SigningServiceSignContext(String keyCategory) { + this.keyCategory = keyCategory; + } +}