Class SignatureMapExtensions
Extension methods for working with protobuf signature maps.
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public static class SignatureMapExtensions
Methods
| Edit this page View SourceAddSignatureAsync(SignatureMap, ReadOnlyMemory<byte>, Signatory)
Adds one or more signatures from the given Signatory to the existing Proto.SignatureMap instance.
Declaration
public static Task AddSignatureAsync(this SignatureMap signatureMap, ReadOnlyMemory<byte> data, Signatory signatory)
Parameters
| Type | Name | Description |
|---|---|---|
| SignatureMap | signatureMap | The signature map which may or may not contain pre-existing signatures. |
| ReadOnlyMemory<byte> | data |
and the message will be an empty string. |
| Signatory | signatory | The signatory that is asked to sign the message. |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
This method does not examine the message being signed nor provide any validation of the results or de-duplication of identical signatures. It is meant to support edge cases outside the normal usage patterns of this SDK, therefore use sparingly and with care.
Satisfies(SignatureMap, ReadOnlyMemory<byte>, Endorsement)
Returns
True
if the given signature map contains enough correct signatures to satisfy the key signing requirements of the given Endorsement.
Declaration
public static bool Satisfies(this SignatureMap signatureMap, ReadOnlyMemory<byte> data, Endorsement endorsement)
Parameters
| Type | Name | Description |
|---|---|---|
| SignatureMap | signatureMap | A signature map containing one or more signatures. |
| ReadOnlyMemory<byte> | data | The message that was signed. |
| Endorsement | endorsement | The key signing requirements that must be met. |
Returns
| Type | Description |
|---|---|
| bool |
if the signature map contains enough valid signatures for the data to satisfy the Endorsement key signing requirements. |
Remarks
Note: this method does not return errors when it discovers invalid
signatures. It may still return
true
if sufficient correct signatures exist in the signature map to satisfy the requirements described in the target Endorsement.