APIPublic Key

Public Key

The public key of an actor.

Instance creation

PublicKey publicKey = PublicKey.from(object);
var publicKey = cds.publicKeyFromObject(object);
my $publicKey = CDS::PublicKey->fromObject($object);

Parses the public key from the Condensation object returns a corresponding instance. This function returns nullundef if the object does not contain a parsable public key.


Bytes encryptedBytes = publicKey.encrypt(bytes);
var encryptedBytes = publicKey.encrypt(bytes);
my $encryptedBytes = $publicKey->encrypt($bytes);

Encrypts bytes.

Signature verification

boolean ok = publicKey.verify(digestBytes, signatureBytes);
boolean ok = publicKey.verify(hash, signatureBytes);
var ok = publicKey.verifyHash(hash, signatureBytes);
my $ok = $publicKey->verifyHash($hash, $signatureBytes);

Verifies whether signatureBytes is a valid signature for hash or digestBytes.


Public keys are immutable objects and can be accessed concurrently from multiple threads.