How can I create X509Certificate using UiPath?

You have ambiguous name of the type which exists in two namespaces.
To avoid this error use full name.
So instead of:

AsymmetricCipherKeyPair subjectKeyPair;

type:

Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair subjectKeyPair;