@SuppressWarnings("UnusedException")
  private static Ed25519PublicKey parsePublicKey(
      ProtoKeySerialization serialization, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    if (!serialization.getTypeUrl().equals(PUBLIC_TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to Ed25519ProtoSerialization.parsePublicKey: "
              + serialization.getTypeUrl());
    }
    try {
      com.google.crypto.tink.proto.Ed25519PublicKey protoKey =
          com.google.crypto.tink.proto.Ed25519PublicKey.parseFrom(
              serialization.getValue(), ExtensionRegistryLite.getEmptyRegistry());
      if (protoKey.getVersion() != 0) {
        throw new GeneralSecurityException("Only version 0 keys are accepted");
      }

      return Ed25519PublicKey.create(
          VARIANT_CONVERTER.fromProtoEnum(serialization.getOutputPrefixType()),
          Bytes.copyFrom(protoKey.getKeyValue().toByteArray()),
          serialization.getIdRequirementOrNull());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing Ed25519PublicKey failed");
    }
  }
Returns the proto serialization of a {@link Ed25519PublicKey}.

@param access may be null for public key material
@throws GeneralSecurityException if the key cannot be serialized (e.g. unknown variant)
java_src/src/main/java/com/google/crypto/tink/signature/internal/Ed25519ProtoSerialization.java