Skip to content

libsodium.PKI.SignData

Andrew Lambert edited this page Dec 6, 2021 · 11 revisions

libsodium.PKI.SignData

Method Signatures

 Protected Function SignData(Message As MemoryBlock, SenderKey As libsodium.PKI.SigningKey, Detached As Boolean = False, Exportable As Boolean = False) As MemoryBlock
 Protected Function SignData(Message As Readable, SenderKey As libsodium.PKI.SigningKey, Exportable As Boolean = False) As MemoryBlock
 Protected Function SignData(Algorithm As libsodium.HashType, Message As Readable, SenderKey As libsodium.PKI.SigningKey, Exportable As Boolean = False) As MemoryBlock

Parameters

SignData(MemoryBlock, libsodium.PKI.SigningKey, Boolean, Boolean)

Name Type Comment
Message MemoryBlock The data to be signed.
SenderKey SigningKey The signer's key pair.
Detached Boolean Optional. If True then only the signature is returned. The default is False which returns the Message and the signature concatenated.
Exportable Boolean Optional. If True then the return value is encoded in a text-based export format; otherwise the raw binary data is returned.

SignData(libsodium.HashType, Readable, libsodium.PKI.SigningKey, Boolean)

Name Type Comment
Algorithm HashType Optional. If specified, the type of generic hash to use.
Message Readable A stream from which to read the message from.
SenderKey SigningKey The signer's key pair.
Exportable Boolean Optional. If True then the return value is encoded in a text-based export format; otherwise the raw binary data is returned.

Return value

The Message and signature concatenated, or (if Detatched=True) the signature only. On error returns Nil.

Remarks

Digitally signs the Message using the private half of the specified Ed25519 key pair. By default, the message and signature are returned concatenated. To get the signature only specify the Detatched parameter.

If Exportable=True then the return value is the signed message encoded in a plain text format. Both the raw binary and plain text format are understood by the VerifyData method.

When the Message is a Readable object, an Ed25519ph signature is generated instead.

See also

Clone this wiki locally