private static ProtoKeySerialization serializePublicKey(
      JwtRsaSsaPkcs1PublicKey key, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    return ProtoKeySerialization.create(
        PUBLIC_TYPE_URL,
        getProtoPublicKey(key).toByteString(),
        KeyMaterialType.ASYMMETRIC_PUBLIC,
        toProtoOutputPrefixType(key.getParameters()),
        key.getIdRequirementOrNull());
  }
Encodes a BigInteger using a big-endian encoding.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtRsaSsaPkcs1ProtoSerialization.java