<p>
获取公钥
</p>

@param keyMap 密钥对
@return
@throws Exception
17792
public static String getPublicKey(Map<String, Object> keyMap) throws Exception {
        Key key = (Key) keyMap.get(PUBLIC_KEY);
        return String.valueOf(Base64Utils.encode(key.getEncoded()));
    }
750317
public Actions keyUp(CharSequence key) {
    if (isBuildingActions()) {
      action.addAction(new KeyUpAction(jsonKeyboard, jsonMouse, asKeys(key)));
    }

    return addKeyAction(key, codePoint -> tick(defaultKeyboard.createKeyUp(codePoint)));
  }
347788
public static Map<String, Object> newFlatKeyMap(Map<String, ?> map) {
        return newFlatKeyMap(new HashMap<>(), map);
    }
684779
public JsonWriter keyLiteral(CharSequence key) {
        startKey();

        if (key == null) {
            throw new IllegalArgumentException("Expected map key, but got null.");
        }

        writer.write(key.toString());
        writer.write(':');
        return this;
    }
779424
static public Key readPut(String keyname, InputStream is) throws Exception {
    return readPut(Key.make(keyname), is);
  }
1329372
public static Map<String, Object> getKvMap(SupportFileTypeEnum supportFileTypeEnum, String fileName)
        throws Exception {

        DisconfFileTypeProcessor disconfFileTypeProcessor;

        //
        // 获取数据
        //
        Map<String, Object> dataMap;

        if (supportFileTypeEnum.equals(SupportFileTypeEnum.PROPERTIES)) {

            disconfFileTypeProcessor = new DisconfPropertiesProcessorImpl();

        } else if (supportFileTypeEnum.equals(SupportFileTypeEnum.XML)) {

            disconfFileTypeProcessor = new DisconfXmlProcessorImpl();

        } else {

            disconfFileTypeProcessor = new DisconfAnyFileProcessorImpl();
        }

        dataMap = disconfFileTypeProcessor.getKvMap(fileName);

        if (dataMap == null) {
            dataMap = new HashMap<String, Object>();
        }

        //
        // 进行数据过滤
        //
        for (String key : dataMap.keySet()) {

            if (key == null) {
                continue;
            }

            LOGGER.debug(key + "\t" + dataMap.get(key));
        }

        return dataMap;
    }
55515
public static Map.Entry<String, Map<String, ?>> pressKeyCodeCommand(int key) {
        return new AbstractMap.SimpleEntry<>(
                PRESS_KEY_CODE, prepareArguments("keycode", key));
    }
459112
private final void sign() throws Exception {
        String dataStr = this.getUserData().toString();
        byte[] data = Base64Coder.getBytes(dataStr);
        byte[] signature = sign(data, this.privateKey);
        this.setSignature(signature);
    }
59026
public synchronized void setDelegateMap(PropertyMap delegateMap)
    {
        if (!isCompatibleClass(delegateMap.getMapClass()))
            throw new IllegalArgumentException("The delegate map type (" + delegateMap.getMapClass() + " is an incompatible type with " + _mapClass);

        _delegateMap = delegateMap;
    }
390145
public static Map<String, Object> genKeyPair() throws Exception {
        KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM);
        keyPairGen.initialize(1024);
        KeyPair keyPair = keyPairGen.generateKeyPair();
        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
        Map<String, Object> keyMap = new HashMap<String, Object>(2);
        keyMap.put(PUBLIC_KEY, publicKey);
        keyMap.put(PRIVATE_KEY, privateKey);
        return keyMap;
    }
850763
public static PGPPublicKey getPublicKey(InputStream content) throws Exception {
        InputStream in = PGPUtil.getDecoderStream(content);
        PGPPublicKeyRingCollection keyRingCollection = new PGPPublicKeyRingCollection(in, new BcKeyFingerprintCalculator());
        PGPPublicKey key = null;
        Iterator<PGPPublicKeyRing> keyRings = keyRingCollection.getKeyRings();
        while(key == null && keyRings.hasNext()) {
            PGPPublicKeyRing keyRing = keyRings.next();
            Iterator<PGPPublicKey> keys = keyRing.getPublicKeys();
            while(key == null && keys.hasNext()) {
                PGPPublicKey current = keys.next();
                if(current.isEncryptionKey()) {
                    key = current;
                }
            }
        }
        return key;
    }
1151620
private static X509KeyManager getKeyManager(final String algorithm, final KeyStore keystore,
                                                final char[] password) throws Exception {
        val factory = KeyManagerFactory.getInstance(algorithm);
        factory.init(keystore, password);
        return (X509KeyManager) factory.getKeyManagers()[0];
    }
230372
public static Map<String, Object> keyValuePairAsMap(String key, Object value) {
    Map<String, Object> paramMap = new HashMap<>();
    paramMap.put(key, value);
    return paramMap;
  }
153574
final public ExpressionToken MapKey() throws ParseException {
        Token t = null;
        ExpressionToken eTok = null;
        jj_consume_token(LBRACKET);
        t = jj_consume_token(STRING_LITERAL);
        jj_consume_token(RBRACKET);
        eTok = new MapKeyToken(t.image);
        {
            if(true) return eTok;
        }
        throw new Error("Missing return statement in function");
    }
1346570
public JsonWriter keyUnescaped(CharSequence key) {
        startKey();

        if (key == null) {
            throw new IllegalArgumentException("Expected map key, but got null.");
        }

        writer.write('\"');
        writer.write(key.toString());
        writer.write('\"');
        writer.write(':');
        return this;

    }
1062867
public V put(K key, V value) {

        if ((key != null) && (value != null)) {
            return m_internalMap.put(key, value);
        }
        Exception e = new Exception();
        try {
            // we want to print a stack trace when null is used as a key/value
            throw e;
        } catch (Exception e2) {
            e = e2;
        }
        if (key == null) {
            LOG.warn("Invalid null key in map", e);
            return null;
        }
        if (value == null) {
            LOG.warn("Invalid null value in map", e);
            return m_internalMap.remove(key);
        }
        return null;
    }
559628
public T mapObject(final Map<String, String> values) throws Exception {

        T result = createInstance();

        // for each field
        for (Map.Entry<String, String> entry : values.entrySet()) {

            String field = entry.getKey();
            //get field raw value
            String value = values.get(field);

            Method setter = setters.get(field);
            if (setter == null) {
                LOGGER.warn("No public setter found for field {}, this field will be set to null (if object type) or default value (if primitive type)", field);
                continue;
            }

            Class<?> type = setter.getParameterTypes()[0];
            TypeConverter<String, ?> typeConverter = typeConverters.get(type);
            if (typeConverter == null) {
                LOGGER.warn(
                        "Type conversion not supported for type {}, field {} will be set to null (if object type) or default value (if primitive type)",
                        type, field);
                continue;
            }

            if (value == null) {
                LOGGER.warn("Attempting to convert null to type {} for field {}, this field will be set to null (if object type) or default value (if primitive type)", type, field);
                continue;
            }

            if (value.isEmpty()) {
                LOGGER.debug("Attempting to convert an empty string to type {} for field {}, this field will be ignored", type, field);
                continue;
            }

            convertValue(result, field, value, setter, type, typeConverter);

        }

        return result;
    }