mixin

PubKey

const mixin PubKey : AsymKey

A public key in an asymmetric key pair. A public key can be used to verify and encrypt data.

methods encrypt

Encrypt the contents of the data buffer and return the result

verify

Throws an Err if the digest algorithm is not supported

encrypt abstract Buf encrypt(Buf data, Str padding)

Encrypt the contents of the data buffer and return the result.

Throws an Err if the algorithm does not support encryption, or if the padding is not supported for the algorithm.

encrypted := pubKey.encrypt("Message".toBuf)

verify abstract Bool verify(Buf data, Str digest, Buf signature)

Throws an Err if the digest algorithm is not supported.

valid := pubKey.verify("Message".toBuf, "SHA512", signature)

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST