private static RsaSsaPkcs1Parameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(PRIVATE_TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to RsaSsaPkcs1ProtoSerialization.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    com.google.crypto.tink.proto.RsaSsaPkcs1KeyFormat format;
    try {
      format =
          com.google.crypto.tink.proto.RsaSsaPkcs1KeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing RsaSsaPkcs1Parameters failed: ", e);
    }
    return RsaSsaPkcs1Parameters.builder()
        .setHashType(HASH_TYPE_CONVERTER.fromProtoEnum(format.getParams().getHashType()))
        .setPublicExponent(decodeBigInteger(format.getPublicExponent()))
        .setModulusSizeBits(format.getModulusSizeInBits())
        .setVariant(
            VARIANT_CONVERTER.fromProtoEnum(serialization.getKeyTemplate().getOutputPrefixType()))
        .build();
  }
Encodes a BigInteger using a big-endian encoding.
java_src/src/main/java/com/google/crypto/tink/signature/internal/RsaSsaPkcs1ProtoSerialization.java