Example usage for org.bouncycastle.jce.provider DHUtil generatePublicKeyParameter

List of usage examples for org.bouncycastle.jce.provider DHUtil generatePublicKeyParameter

Introduction

In this page you can find the example usage for org.bouncycastle.jce.provider DHUtil generatePublicKeyParameter.

Prototype

static public AsymmetricKeyParameter generatePublicKeyParameter(PublicKey key) throws InvalidKeyException 

Source Link

Usage

From source file:org.forgerock.openicf.framework.remote.security.ECIESEncryptor.java

License:Open Source License

public ECIESEncryptor(PrivateKey privateKey, PublicKey publicKey) throws InvalidKeyException {

    if (publicKey instanceof ECPublicKey) {
        publicKeyParameter = ECUtil.generatePublicKeyParameter(publicKey);
        privateKeyParameter = ECUtil.generatePrivateKeyParameter(privateKey);
    } else {/*from w  w  w.  j  a v a2s . c om*/
        publicKeyParameter = DHUtil.generatePublicKeyParameter(publicKey);
        privateKeyParameter = DHUtil.generatePrivateKeyParameter(privateKey);
    }

}