com.dyadicsec.provider.EDDSAKeyPairGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unbound-java-provider Show documentation
Show all versions of unbound-java-provider Show documentation
This is a collection of JAVA libraries that implement Unbound cryptographic classes for JAVA provider, PKCS11 wrapper, cryptoki, and advapi
package com.dyadicsec.provider;
import com.unbound.client.Partition;
import com.unbound.provider.UBEDDSAKeyPairGenerator;
import com.unbound.provider.UBEDDSAPublicKey;
import java.security.KeyPair;
public class EDDSAKeyPairGenerator
{
final UBEDDSAKeyPairGenerator gen;
public EDDSAKeyPairGenerator()
{
gen = new UBEDDSAKeyPairGenerator(Partition.getDefault());
}
public KeyPair generateKeyPair()
{
KeyPair kp = gen.generateKeyPair();
EDDSAPublicKey pub = new EDDSAPublicKey((UBEDDSAPublicKey)kp.getPrivate());
return new KeyPair(pub, kp.getPrivate());
}
}