-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added sign message, verify message, and purge key
Signed-off-by: Samuel Bailey <[email protected]>
- Loading branch information
1 parent
2709858
commit 1e1cd61
Showing
14 changed files
with
128 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# PsaSignMessage | ||
|
||
Sign a message with a private key. Opcode: 24 (`0x0018`) | ||
|
||
## Parameters | ||
|
||
| Name | Type | Description | | ||
|------------|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------| | ||
| `key_name` | String | Name of the key to use for the operation | | ||
| `alg` | [`AsymmetricSignature`](psa_algorithm.md#asymmetricsignature-algorithm) | An asymmetric signature algorithm that separates the message and sign operations that is compatible with the type of key | | ||
| `message` | Vector of bytes | The message to sign | | ||
|
||
- `key_name` must be the name of an asymmetric key pair. The key must allow the [usage | ||
flag](psa_key_attributes.md#usageflags-type) `sign_hash`. | ||
|
||
## Results | ||
|
||
| Name | Type | Description | | ||
|-------------|-----------------|---------------------------------| | ||
| `signature` | Vector of bytes | Buffer containing the signature | | ||
|
||
## Specific response status codes | ||
|
||
- `PsaErrorNotPermitted`: The key does not have the `sign_hash` flag, or it does not permit the | ||
requested algorithm. | ||
|
||
## Description | ||
|
||
This function will sign a message with a private key. For hash-and-sign algorithms, this includes | ||
the hashing step. | ||
|
||
## Contract | ||
|
||
[Protobuf](https://github.com/parallaxsecond/parsec-operations/blob/master/protobuf/psa_sign_message.proto) | ||
|
||
*Copyright 2020 Contributors to the Parsec project.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# PsaVerifyMessage | ||
|
||
Verify the signature of a message using a public key. Opcode: 25 (`0x0019`) | ||
|
||
## Parameters | ||
|
||
| Name | Type | Description | | ||
|-------------|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------| | ||
| `key_name` | String | Name of the key to use for the operation | | ||
| `alg` | [`AsymmetricSignature`](psa_algorithm.md#asymmetricsignature-algorithm) | An asymmetric signature algorithm that separates the message and sign operations that is compatible with the type of key | | ||
| `message` | Vector of bytes | The message whose signature is to be verified | | ||
| `signature` | Vector of bytes | Buffer containing the signature to verify | | ||
|
||
- `key_name` must be the name of a public key or an asymmetric key pair. The key must allow the | ||
[usage flag](psa_key_attributes.md#usageflags-type) `verify_hash`. | ||
|
||
No values are returned by this operation. If `Success` is returned the signature is valid. | ||
|
||
## Specific response status codes | ||
|
||
- `PsaErrorNotPermitted`: The key does not have the `verify_hash` flag, or it does not permit the | ||
requested algorithm. | ||
- `PsaErrorInvalidSignature`: The calculation was performed successfully, but the passed signature | ||
is not a valid signature. | ||
|
||
## Description | ||
|
||
This function will verify the signature of a message with a public key, using a hash-and-sign | ||
verification algorithm. | ||
|
||
## Contract | ||
|
||
[Protobuf](https://github.com/parallaxsecond/parsec-operations/blob/master/protobuf/psa_verify_message.proto) | ||
|
||
*Copyright 2020 Contributors to the Parsec project.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters