public static AsymmetricKeyParameter getAsymmetricKeyParameter ( PublicKeyParameters publicKey ) { if ( publicKey instanceof BcAsymmetricKeyParameters ) { return ( ( BcAsymmetricKeyParameters ) publicKey ) . getParameters ( ) ; } else { try { return PublicKeyFactory . createKey ( publicKey . getEncoded ( ) ) ; } catch ( IOException e ) { // Very unlikely throw new IllegalArgumentException ( "Invalid public key, unable to encode." ) ; } } }
Convert public key parameters to asymmetric key parameter .