private static com.google.crypto.tink.proto.RsaSsaPkcs1PublicKey getProtoPublicKey(
      RsaSsaPkcs1PublicKey key) throws GeneralSecurityException {
    return com.google.crypto.tink.proto.RsaSsaPkcs1PublicKey.newBuilder()
        .setParams(getProtoParams(key.getParameters()))
        .setN(encodeBigInteger(key.getModulus()))
        .setE(encodeBigInteger(key.getParameters().getPublicExponent()))
        .build();
  }
Encodes a BigInteger using a big-endian encoding.
java_src/src/main/java/com/google/crypto/tink/signature/internal/RsaSsaPkcs1ProtoSerialization.java