Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-18635 Avro schemas for session encryption operations #1400

Merged
merged 10 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "record",
"name": "DecryptRpcCommand",
"namespace": "net.corda.data.crypto.wire.ops.encryption.request",
"doc": "Request to decrypt the given byte array",
"fields": [
{
"name": "category",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: so this means we could be passing in any category. So for example LEDGER (ledger keys are meant to be used for signing) to decrypt secrets. Should we be restricting this field with an enum of valid categories?

"type": "string",
"doc": "The category of HSM e.g. ENCRYPTION_SECRET, TLS, etc."
},
{
"name": "alias",
"type": ["null", "string"],
"doc": "The symmetric key alias."
},
{
"name": "cipherBytes",
"type": "bytes",
"doc": "The data to decrypt."
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "record",
"name": "EncryptRpcCommand",
"namespace": "net.corda.data.crypto.wire.ops.encryption.request",
"doc": "Request to encrypt the given byte array",
"fields": [
{
"name": "category",
"type": "string",
"doc": "The category of HSM e.g. ENCRYPTION_SECRET, TLS, etc."
},
{
"name": "alias",
"type": ["null", "string"],
"doc": "The symmetric key alias."
},
{
"name": "plainBytes",
"type": "bytes",
"doc": "The data to encrypt."
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "record",
"name": "CryptoDecryptionResult",
"namespace": "net.corda.data.crypto.wire.ops.encryption.response",
"doc": "Decryption operation response",
"fields": [
{
"name": "plainBytes",
"type": "bytes",
"doc": "Decrypted byte array"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "record",
"name": "CryptoEncryptionResult",
"namespace": "net.corda.data.crypto.wire.ops.encryption.response",
"doc": "Encryption operation response",
"fields": [
{
"name": "cipherBytes",
"type": "bytes",
"doc": "Encrypted byte array"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "record",
"name": "DecryptionOpsResponse",
"namespace": "net.corda.data.crypto.wire.ops.encryption.response",
"doc": "Response for crypto's decryption operations envelope",
"fields": [
{
"name": "response",
"type": [
"net.corda.data.crypto.wire.ops.encryption.response.CryptoDecryptionResult",
"net.corda.data.crypto.wire.ops.encryption.response.EncryptionOpsError"
],
"doc": "Response's payload, depends on the requested operation"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "record",
"name": "EncryptionOpsError",
"namespace": "net.corda.data.crypto.wire.ops.encryption.response",
"doc": "Error result while performing encryption or decryption operation.",
"fields": [
{
"name": "errorMessage",
"type": "net.corda.data.ExceptionEnvelope"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "record",
"name": "EncryptionOpsResponse",
"namespace": "net.corda.data.crypto.wire.ops.encryption.response",
"doc": "Response for crypto's encryption operations envelope",
"fields": [
{
"name": "response",
"type": [
"net.corda.data.crypto.wire.ops.encryption.response.CryptoEncryptionResult",
"net.corda.data.crypto.wire.ops.encryption.response.EncryptionOpsError"
],
"doc": "Response's payload, depends on the requested operation"
}
]
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 17
cordaApiRevision = 18

# Main
kotlin.stdlib.default.dependency = false
Expand Down