io.github.dbstarll.utils.lang.security.KeyGeneratorBuilder Maven / Gradle / Ivy
The newest version!
package io.github.dbstarll.utils.lang.security;
import javax.crypto.KeyGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public final class KeyGeneratorBuilder extends AbstractSecurityBuilder {
public KeyGeneratorBuilder(KeyGeneratorAlgorithm algorithm) throws NoSuchAlgorithmException, InstanceException {
super(KeyGenerator.class, algorithm);
}
public KeyGeneratorBuilder keySize(int keysize, SecureRandom random) {
type.init(keysize, random);
return this;
}
}