Class PortCryptoEngine
java.lang.Object
com.codename1.security.CryptoEngine
com.codename1.security.PortCryptoEngine
The client's default
CryptoEngine: PBKDF2 goes to the port's native
derivation (CodenameOneImplementation.pbkdf2(String, byte[], byte[], int, int)), everything else runs
in Java, and the asynchronous CryptoBatch calls answer on the EDT. A port with more native kernels subclasses it.-
Field Summary
Fields inherited from class CryptoEngine
BATCH_ED25519, BATCH_SCHNORR, BATCH_SECP256K1 -
Constructor Summary
ConstructorsConstructorDescriptionPortCryptoEngine(com.codename1.impl.CodenameOneImplementation impl) Creates the engine over a port. -
Method Summary
Modifier and TypeMethodDescriptionvoidRuns the callback of an asynchronousCryptoBatchcall on the EDT.byte[]PBKDF2 (RFC 8018) with HMAC overhashAlgorithm(Hash.SHA256orHash.SHA512), ornullto use the Java derivation.booleanrandomBytes(byte[] out) Fillsoutwith bytes from the platform's CSPRNG, answeringfalsewhen this engine has no source.Methods inherited from class CryptoEngine
ed25519PublicKey, ed25519Sign, ed25519Verify, get, gpuRecord, gpuRecordWords, hashBatch, hashPacked, hmac, install, keccak256, random, ripemd160, runInBackground, schnorrPublicKey, schnorrSign, schnorrVerify, secpPrivateKeyTweakAdd, secpPublicKey, secpPublicKeyTweakAdd, secpRecover, secpSign, secpVerify, sha256, sha512, verifyBatch, verifyPacked
-
Constructor Details
-
PortCryptoEngine
public PortCryptoEngine(com.codename1.impl.CodenameOneImplementation impl) Creates the engine over a port.
Parameters
impl: the port whose native derivation PBKDF2 uses
-
-
Method Details
-
randomBytes
public boolean randomBytes(byte[] out) Description copied from class:CryptoEngineFillsoutwith bytes from the platform's CSPRNG, answeringfalsewhen this engine has no source. Every installed engine has one: the client's draws on the port, the backend's on the server runtime.- Overrides:
randomBytesin classCryptoEngine
-
deliver
Runs the callback of an asynchronousCryptoBatchcall on the EDT.- Overrides:
deliverin classCryptoEngine
-
pbkdf2
public byte[] pbkdf2(String hashAlgorithm, byte[] password, byte[] salt, int iterations, int length) Description copied from class:CryptoEnginePBKDF2 (RFC 8018) with HMAC overhashAlgorithm(Hash.SHA256orHash.SHA512), ornullto use the Java derivation. The arguments are already validated.- Overrides:
pbkdf2in classCryptoEngine
-