private Key getPublicKey(final byte[] key) throws GeneralSecurityException {
    KeyFactory keyFactory = EngineFactory.KEY_FACTORY.getInstance(this.keyType);
    return validate(keyFactory.generatePublic(new X509EncodedKeySpec(key)));
  }
Reads a single key from {@code reader}.

@return a {@link Key} or null if the reader doesn't contain a valid PEM.
java_src/src/main/java/com/google/crypto/tink/PemKeyType.java