com.fitbur.bouncycastle.crypto.generators.EphemeralKeyPairGenerator Maven / Gradle / Ivy
package com.fitbur.bouncycastle.crypto.generators;
import com.fitbur.bouncycastle.crypto.AsymmetricCipherKeyPair;
import com.fitbur.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator;
import com.fitbur.bouncycastle.crypto.EphemeralKeyPair;
import com.fitbur.bouncycastle.crypto.KeyEncoder;
public class EphemeralKeyPairGenerator
{
private AsymmetricCipherKeyPairGenerator gen;
private KeyEncoder keyEncoder;
public EphemeralKeyPairGenerator(AsymmetricCipherKeyPairGenerator gen, KeyEncoder keyEncoder)
{
this.gen = gen;
this.keyEncoder = keyEncoder;
}
public EphemeralKeyPair generate()
{
AsymmetricCipherKeyPair eph = gen.generateKeyPair();
// Encode the ephemeral public key
return new EphemeralKeyPair(eph, keyEncoder);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy