SecretKeyFactory
classin packageklyn.cryptography
public abstract class SecretKeyFactory extends Object:
└ SecretKeyFactory
Abstract base class for secret-key derivation algorithms. The primary password-based derivation API is exposed through `PBKDF2`.
import klyn.cryptography

factory as SecretKeyFactory = PBKDF2(SHA256())
spec = PBEKeySpec("password", "salty", 100000, 32)
print(factory.generateSecret(spec))
Fields
Modifier and Type Member Description
public readonly algorithm
algorithm as String
Canonical factory algorithm name.
Properties inherited from Object: type
Methods
Modifier and Type Member Description
public generateSecret
generateSecret(spec as PBEKeySpec) as String throws CryptoException:
Derives key material from a password-based specification.
public generateSecret
generateSecret(spec as PBEKeySpec, outputEncoding as String) as String throws CryptoException:
No summary.
public static getInstance
getInstance(algorithm as String) as SecretKeyFactory throws CryptoException:
Compatibility factory for dynamic algorithm selection.
public override toString
toString() as String:
No summary.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml