class Sodium::CryptoBox::PublicKey

Defined in:

sodium/crypto_box/public_key.cr

Constant Summary

KEY_SIZE = LibSodium.crypto_box_publickeybytes.to_i
SEAL_SIZE = LibSodium.crypto_box_sealbytes

Constructors

Instance Method Summary

Instance methods inherited from class Sodium::Key

to_slice : Bytes to_slice

Instance methods inherited from module Sodium::Wipe

close close, finalize finalize

Constructor Detail

def self.new(bytes : Bytes) #

[View source]

Instance Method Detail

def encrypt(src, dst : Bytes? = nil) #

Anonymously send messages to a recipient given its public key.

Optionally supply a destination buffer.

For authenticated message use secret_key.box(recipient_public_key).encrypt.


[View source]
def to_slice : Bytes #

Returns key


[View source]