List of usage examples for org.bouncycastle.jce.provider JCEECPrivateKey getParameters
public org.bouncycastle.jce.spec.ECParameterSpec getParameters()
From source file:org.jmrtd.app.DocumentEditFrame.java
License:Open Source License
private static PublicKey getECPublicKeyFromPrivateKey(PrivateKey privateKey) throws GeneralSecurityException { KeyFactory keyFactory = KeyFactory.getInstance("EC", BC_PROVIDER); org.bouncycastle.jce.provider.JCEECPrivateKey priv = (org.bouncycastle.jce.provider.JCEECPrivateKey) privateKey; org.bouncycastle.jce.spec.ECParameterSpec params = priv.getParameters(); org.bouncycastle.jce.spec.ECPublicKeySpec pubKS = new org.bouncycastle.jce.spec.ECPublicKeySpec( params.getG().multiply(priv.getD()), params); PublicKey publicKey = keyFactory.generatePublic(pubKS); return publicKey; }