Java tutorial
//package com.java2s; import java.security.Key; import java.util.Map; public class Main { private static final String PUBLIC_KEY = "ECPublicKey"; public static byte[] getPublicKey(Map<String, Object> keyMap) throws Exception { Key key = (Key) keyMap.get(PUBLIC_KEY); return key.getEncoded(); } }