edu.uiuc.ncsa.security.util.pkcs.KeyPairPopulationThread Maven / Gradle / Ivy
package edu.uiuc.ncsa.security.util.pkcs;
import edu.uiuc.ncsa.security.core.exceptions.GeneralException;
import edu.uiuc.ncsa.security.core.util.QueuePopulationThread;
import edu.uiuc.ncsa.security.core.util.QueueWithSpare;
import java.security.KeyPair;
/**
* Worker thread that creates {@link KeyPair}s and puts them into a queue.
* Created by Jeff Gaynor
* on 2/20/12 at 2:35 PM
*/
public class KeyPairPopulationThread extends QueuePopulationThread {
public KeyPairPopulationThread(int maxQueueSize, long sleepInterval, QueueWithSpare q) {
super(maxQueueSize, sleepInterval, q);
}
public KeyPairPopulationThread(QueueWithSpare q) {
super(q);
}
@Override
protected KeyPair createNew() {
try {
return KeyUtil.generateKeyPair();
} catch (Exception e) {
throw new GeneralException("Error generating keypair", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy