File tree 4 files changed +81
-41
lines changed
application/src/main/kotlin/net/corda/v5/application/crypto
cipher-suite/src/main/kotlin/net/corda/v5/cipher/suite
4 files changed +81
-41
lines changed Original file line number Diff line number Diff line change
1
+ package net.corda.v5.application.crypto
2
+
3
+ import net.corda.v5.base.annotations.DoNotImplement
4
+ import net.corda.v5.base.annotations.Suspendable
5
+ import net.corda.v5.crypto.DigestAlgorithmName
6
+ import net.corda.v5.crypto.SecureHash
7
+ import java.io.InputStream
8
+
9
+ /* *
10
+ * Provides hashing capabilities to be used in all sandbox types.
11
+ */
12
+ @DoNotImplement
13
+ interface DigestService {
14
+ /* *
15
+ * Computes the digest of the [ByteArray].
16
+ *
17
+ * @param bytes The [ByteArray] to hash.
18
+ * @param digestName The digest algorithm to be used for hashing.
19
+ */
20
+ @Suspendable
21
+ fun hash (bytes : ByteArray , digestName : DigestAlgorithmName ): SecureHash
22
+
23
+ /* *
24
+ * Computes the digest of the [InputStream].
25
+ *
26
+ * @param inputStream The [InputStream] to hash.
27
+ * @param digestName The digest algorithm to be used for hashing.
28
+ */
29
+ @Suspendable
30
+ fun hash (inputStream : InputStream , digestName : DigestAlgorithmName ): SecureHash
31
+
32
+ /* *
33
+ * Returns the [DigestAlgorithmName] digest length in bytes.
34
+ *
35
+ * @param digestName The digest algorithm to get the digest length for.
36
+ */
37
+ @Suspendable
38
+ fun digestLength (digestName : DigestAlgorithmName ): Int
39
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ package net.corda.v5.cipher.suite
2
+
3
+ import net.corda.v5.crypto.DigestAlgorithmName
4
+ import net.corda.v5.crypto.SecureHash
5
+ import java.io.InputStream
6
+
7
+ /* *
8
+ * The platform digest calculation service. Holds a list of supported digest algorithms to be used for hashing.
9
+ */
10
+ interface PlatformDigestService {
11
+
12
+ /* *
13
+ * Computes the digest of the [ByteArray].
14
+ *
15
+ * @param bytes The [ByteArray] to hash.
16
+ * @param platformDigestName The digest algorithm to be used for hashing, looked up in platform supported digest algorithms.
17
+ *
18
+ * @throws [IllegalArgumentException] if the digest algorithm is not supported.
19
+ */
20
+ fun hash (bytes : ByteArray , platformDigestName : DigestAlgorithmName ): SecureHash
21
+
22
+ /* *
23
+ * Computes the digest of the [InputStream].
24
+ *
25
+ * @param inputStream The [InputStream] to hash.
26
+ * @param platformDigestName The digest algorithm to be used for hashing, looked up in platform supported digest algorithms.
27
+ *
28
+ * @throws [IllegalArgumentException] if the digest algorithm is not supported.
29
+ */
30
+ fun hash (inputStream : InputStream , platformDigestName : DigestAlgorithmName ): SecureHash
31
+
32
+ /* *
33
+ * Returns the [DigestAlgorithmName] digest length in bytes.
34
+ *
35
+ * @param platformDigestName The digest algorithm to get the digest length for, looked up in platform supported
36
+ * digest algorithms.
37
+ *
38
+ * @throws [IllegalArgumentException] if the digest algorithm is not supported.
39
+ */
40
+ fun digestLength (platformDigestName : DigestAlgorithmName ): Int
41
+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ cordaProductVersion = 5.0.0
7
7
# NOTE: update this each time this module contains a breaking change
8
8
# # NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
9
9
# # a per module property in which case module versions can change independently.
10
- cordaApiRevision = 505
10
+ cordaApiRevision = 506
11
11
12
12
# Main
13
13
kotlinVersion = 1.7.21
You can’t perform that action at this time.
0 commit comments