So far I tried to generate x509 certificate in Go, using x509 library, but this doesn't succeed, since Go doesn't allow to generate negative modulus.
I tried to use openssl:
openssl req -nodes -new -x509 -keyout server.key -out server.cert
But it generate positive modulus RSA key.
For education purposes I still need negative RSA modulus, is it somehow possible using openssl?
An RSA key with a negative modulus is not an RSA key.
Per RFC 8017 (bolding mine):
All values by specification are positive integers, and the modulus is the product of two or more prime numbers.
And all prime numbers are defined as:
Any product of prime numbers therefore must also be greater than zero, making a negative modulus for an RSA key mathematically impossible.